| Crates.io | repocat |
| lib.rs | repocat |
| version | 0.4.0 |
| created_at | 2024-08-09 03:24:13.553383+00 |
| updated_at | 2025-02-16 21:13:45.025655+00 |
| description | A tool to concatenate all code and text files in a github repo for LLM inference contexts |
| homepage | |
| repository | https://github.com/SamKG/repocat |
| max_upload_size | |
| id | 1330379 |
| size | 44,447 |
A simple CLI tool that accepts either:
and concatenates all text/code files into a single .txt file. This can be useful for providing context to LLMs or other tools that need a single “flattened” representation of your codebase.
repocat respects .gitignore and other ignore files (unless you disable it).--checkout).--keep-blank-lines).--no-ignore).If you have Rust (and Cargo) installed:
cargo install repocat
Alternatively, clone this repository and run:
cargo build --release
Your compiled binary will be in the target/release directory.
repocat --input /path/to/my-project
my-project folder, respecting .gitignore by default.*.toml, *.md, *.py, *.rs, *.cpp, *.h, *.hpp, *.c, *.rst, *.txt, *.cuh, *.cu.concatenated_output.txt..repocat --input https://github.com/owner/repo
repo from GitHub into a temporary folder.main or master).concatenated_output.txt.repocat --input https://github.com/owner/repo --checkout feature-branch
repocat --input https://github.com/owner/repo --checkout abcd1234
feature-branch or the commit abcd1234.repocat \
--input /path/to/my-project \
--include "*.rs,*.toml" \
--exclude "*.lock,*.bak"
.rs and .toml files, while excluding anything ending with .lock or .bak.By default, repocat removes blank lines for more compact output. If you want to preserve them:
repocat --input /path/to/my-project --keep-blank-lines
If you want to include hidden and/or binary files, you can disable all ignore logic:
repocat --input /path/to/my-project --no-ignore
.git.repocat uses the ignore crate by default, which means it respects .gitignore, .ignore, and .rgignore files, along with hidden file filtering and binary file detection.src/lib.rs, but can be overridden via the --include and --exclude flags.--keep-blank-lines. Otherwise, empty lines are removed.Thanks for checking out repocat! Feel free to open an issue or pull request if you have suggestions or encounter any problems.