| Crates.io | codebase-flattener |
| lib.rs | codebase-flattener |
| version | 0.1.0 |
| created_at | 2025-04-25 18:53:43.483294+00 |
| updated_at | 2025-04-25 18:53:43.483294+00 |
| description | Flatten a Rust (or any) codebase into one file for LLM ingestion. |
| homepage | https://github.com/szczuroskoczek/codebase-flattener |
| repository | https://github.com/szczuroskoczek/codebase-flattener |
| max_upload_size | |
| id | 1649361 |
| size | 17,779 |
Flatten a codebase into a single file for easy LLM ingestion.
Features:
.gitignore, .llmignore, and custom ignore rules.codebase.txt).Ensure you have Rust and Cargo installed (edition 2021).
# Install from crates.io
cargo install codebase-flattener
Or build locally:
git clone https://github.com/youruser/codebase-flattener.git
cd codebase-flattener
cargo build --release
# The binary will be in target/release/
# Run with defaults (respects .gitignore & .llmignore, follows symlinks)
codebase-flattener
# Add custom ignore files
codebase-flattener --ignore extra.ignore --ignore temp.ignore
# Disable all default ignore files
codebase-flattener --no-default-ignores --ignore only.ignore
# Don’t follow symlinks
codebase-flattener --no-follow
# Change the output filename
codebase-flattener --output project_dump.txt
By default, all files are dumped into codebase.txt with separators:
<<< FILE: path/to/file.ext >>>
<file contents>
| Option | Description |
|---|---|
-i, --ignore <FILE> |
Append a custom ignore filename (can be used multiple times) |
--no-default-ignores |
Disable default .gitignore & .llmignore loading |
-n, --no-follow |
Don’t follow symbolic links |
-o, --output <FILENAME> |
Set the output file name (default: codebase.txt) |
-h, --help |
Print help information |
-V, --version |
Print version info |
git checkout -b feature/foo)git commit -am "Add foo")git push origin feature/foo)We welcome improvements, bug fixes, and enhanced documentation!
Licensed under MIT See LICENSE for details.
Created by Krystian Mikołajczyk | Crates.io | GitHub