Simple CLI to output source code blocks for LLM prompts.
Project description
inprompt
A tiny CLI for outputting files or glob patterns as Markdown code blocks. Useful when you need to copy code into prompts for large language models (e.g., ChatGPT).
Usage
From the command line, you can pass files and glob patterns to inprompt:
inprompt pyproject.toml '**/*.py' | pbcopy
Note: It's important to enclose glob patterns (like '**/*.py') in single or double
quotes. This prevents your shell from expanding the pattern before inprompt sees it,
ensuring correct file matching, especially for recursive patterns (**).
The | pbcopy (or equivalent) then pipes the formatted output directly to your
clipboard:
-
On macOS,
pbcopycopies STDOUT to the clipboard. -
On Ubuntu/Linux, you can use
xclip. Define aliases for convenience:alias pbcopy='xclip -selection clipboard' alias pbpaste='xclip -selection clipboard -o'
Then you can use the same
inprompt ... | pbcopypattern.
Any matched files will be printed to standard output (and thus copied by pbcopy) in
the format:
<filename>
````
<file contents>
````
You can then paste those code blocks into an LLM prompt.
Installation
Option 1: With pip
pip install inprompt
This installs the inprompt command on your system or in your virtual environment.
Option 2: With pipx
pipx install inprompt
This installs inprompt globally, isolated from your system's site packages.
License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file inprompt-1.2.0.tar.gz.
File metadata
- Download URL: inprompt-1.2.0.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.2 CPython/3.12.10 Darwin/24.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1ab9420cddef73a84501aa18320516f0e3406c2807758e037898ab1c2b38cf2
|
|
| MD5 |
d9674f1c079b63483f9c50d5a410fe88
|
|
| BLAKE2b-256 |
17dab837256b7415331bea74ef0ed530f1795f2b1ab924c4519d520ab413b70e
|
File details
Details for the file inprompt-1.2.0-py3-none-any.whl.
File metadata
- Download URL: inprompt-1.2.0-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.2 CPython/3.12.10 Darwin/24.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb5fcc71ce5a54a2da2c7d623dd5541cf1e537825d863e843c228ff63559a575
|
|
| MD5 |
164249b6dbfd44d75a6b3ac5e13bc3c1
|
|
| BLAKE2b-256 |
f77513c3fc267ce3e3286d4e91b12f8bfd84ef981c59e78c18d5af51f4556ac9
|