prmpt
prmpt is a Rust utility for turning an entire code repository into a prompt that a Large Language Model can understand. It also reinjects the model's answers back into the same repository. Use prmpt when you want a repeatable way to ship code in and out of an LLM without manually copying files.
Why prmpt?
- One command prompt generation – walk your project, honor
.gitignore, and produce a single text file ready for an LLM. - Docs‐only extraction – gather just the docstrings or comments so the model focuses on high level documentation.
- Jupyter notebook support – include cell outputs when you need them.
- Safe injection – prmpt reads the LLM output and places each code block into the correct file.
Install
- Install a Rust toolchain.
- Build prmpt from source:
The executable will be at target/release/prmpt.
Or
and the prmpt command will then be available.
Command overview
prmpt exposes two main subcommands. You can also invoke named configurations stored in a prmpt.yaml file.
Generate
Create a prompt file from a repository.
- Basic run
- Important flags
--ignore <pattern>– repeat to skip files or directories.--docs-comments-only– extract docstrings and comments without source code.--delimiter <token>– fence used around each block (defaults to```).
Inject
Read an LLM's output and write changes back into the repository.
- Basic run
The input file should contain a path followed by a fenced code block for every change:
Running with a configuration
A prmpt.yaml file allows named setups. A minimal example is below.
base:
path: ./my_project
language: rust
output: prompt.out
ignore:
- target
prompts:
- "Summarise the project before rewriting."
Execute that configuration simply by running:
Example output
Running prmpt generate on a small project might produce something like:
sample_project_1
├── README.md
└── main.py
```README.md
# Sample Project 1
```
```main.py
print("Hello, world!")
```
This output can be fed directly into your favourite LLM. After editing, feed the modified file back to prmpt inject.
Library usage
prmpt can also be used as a library. The Generator and Injector types expose the same logic as the CLI:
use ;
let config = Config ;
let generator = default;
run_and_write?;
prmpt streamlines the tedious parts of preparing code for an LLM and applying the results. Give it a try on your next project and focus on the creative parts instead of file management.