| Crates.io | codebase-to-prompt |
| lib.rs | codebase-to-prompt |
| version | 1.0.1 |
| created_at | 2025-08-24 11:58:49.852137+00 |
| updated_at | 2025-09-20 09:59:56.569472+00 |
| description | A tool for bundling text files like code to single file. |
| homepage | |
| repository | https://github.com/GKaszewski/codebase-to-prompt |
| max_upload_size | |
| id | 1808285 |
| size | 65,153 |
codebase-to-prompt is a Rust-based CLI tool designed to bundle files from a directory into a single output file. It supports filtering files by extensions, respecting .gitignore rules, and formatting the output in Markdown, plain text, or console-friendly formats.
.gitignore Respect: Optionally respect .gitignore rules.There are multiple ways to install codebase-to-prompt.
cargo install (Recommended for Rust developers)If you have the Rust toolchain installed, you can easily install the latest version from crates.io:
cargo install codebase-to-prompt
You can download and run the installation script, which will install the latest release binary for your system:
curl -fsSL https://raw.githubusercontent.com/GKaszewski/codebase-to-prompt/master/install.sh | sh
You can download the pre-compiled binary for your operating system directly from the Releases page.
git clone https://github.com/GKaszewski/codebase-to-prompt
cd codebase-to-prompt
cargo build --release
target/release/codebase-to-prompt.Run the tool with the following options:
codebase-to-prompt [OPTIONS] [DIRECTORY]
-o, --output <FILE>: Specify the output file. Defaults to stdout if not provided.-i, --include <EXTENSIONS>: Comma-separated list of file extensions to include.-e, --exclude <EXTENSIONS>: Comma-separated list of file extensions to exclude.--format <FORMAT>: Output format (console, markdown, text). Defaults to console.-d, --append-date: Append the current date to the output file name.-g, --append-git-hash: Append the current Git hash to the output file name.-l, --line-numbers: Include line numbers in the output.-H, --ignore-hidden: Ignore hidden files.-R, --respect-gitignore: Respect .gitignore rules. Enabled by default.Bundle all .rs files in the current directory into output.md in Markdown format:
codebase-to-prompt -o output.md -i rs
Bundle all files except .log files, appending the current date and Git hash to the output file name:
codebase-to-prompt -o output.txt -e log -d -g
Output all files to the console, including line numbers:
codebase-to-prompt -l
To build the project:
cargo build --release
To run tests:
cargo test
To lint the code:
cargo clippy
To format the code:
cargo fmt
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Feel free to open issues or submit pull requests.