| Crates.io | cr-prep |
| lib.rs | cr-prep |
| version | 0.2.1 |
| created_at | 2025-03-27 10:33:48.615234+00 |
| updated_at | 2026-01-12 04:55:41.93687+00 |
| description | A CLI tool for collecting code files for code review |
| homepage | |
| repository | https://github.com/kyuki3rain/cr-prep |
| max_upload_size | |
| id | 1607793 |
| size | 36,792 |
A CLI tool for collecting code files for code review. This tool recursively searches through a specified directory and outputs the content of code files in a Markdown format suitable for code review with LLMs.
.gitignore - automatically excludes files matching gitignore patternsYou can install cr-prep using cargo:
cargo install cr-prep
Or build from source:
git clone https://github.com/kyuki3rain/cr-prep
cd cr-prep
cargo build --release
Basic usage:
# Output to stdout
cr-prep --path /path/to/your/project
# Output to a file
cr-prep --path /path/to/your/project --output review.md
-p, --path <DIRECTORY>: Directory to search for code files (required)-o, --output <FILE>: Output file path (optional, defaults to stdout)The output is in Markdown format with each file wrapped in a language-specific code block:
## src/main.rs
\`\`\`rust
fn main() {
println!("Hello, world!");
}
\`\`\`
## src/app.tsx
\`\`\`tsx
export const App = () => <div>Hello</div>;
\`\`\`
| Language | Extensions |
|---|---|
| Rust | .rs |
| TypeScript | .ts, .tsx |
| JavaScript | .js, .jsx, .mjs, .cjs |
| Python | .py |
| Go | .go |
| Java | .java |
| Kotlin | .kt, .kts |
| Scala | .scala |
| C/C++ | .c, .h, .cpp, .cc, .cxx, .hpp, .hxx |
| C# | .cs |
| Ruby | .rb |
| PHP | .php |
| Swift | .swift |
| Dart | .dart |
| Elixir | .ex, .exs |
| Erlang | .erl |
| Haskell | .hs |
| OCaml | .ml, .mli |
| F# | .fs, .fsi, .fsx |
| Clojure | .clj, .cljs, .cljc |
| Lua | .lua |
| Zig | .zig |
| Nim | .nim |
| R | .r, .R |
| Julia | .jl |
| Type | Extensions |
|---|---|
| HTML | .html, .htm |
| CSS | .css, .scss, .sass, .less |
| Vue | .vue |
| Svelte | .svelte |
| Markdown | .md, .mdx |
| Type | Extensions |
|---|---|
| JSON | .json |
| YAML | .yaml, .yml |
| TOML | .toml |
| XML | .xml |
| SQL | .sql |
| GraphQL | .graphql, .gql |
| Protocol Buffers | .proto |
| Type | Extensions |
|---|---|
| Bash | .sh, .bash |
| Zsh | .zsh |
cr-prep automatically respects .gitignore files in your project. Files and directories matching gitignore patterns will be excluded from the output. This includes:
.gitignore in the project root and subdirectories.git/info/exclude patternsThis project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.