Convert your codebase into a formatted markdown file for inference.
This tool converts all text files in your project into a neatly formatted markdown file (codebase.md), respecting files and directories defined in .gitignore. It offers two methods to achieve this: a Bash script (codebase.sh) and a Rust CLI program (codebase-to-markdown).
- A POSIX-compatible terminal (e.g., Git Bash, Bash, Zsh).
- The
treecommand-line tool installed.
- Rust and Cargo installed. Install via rustup.
- Install the CLI tool using Cargo:
Alternatively, you can install the CLI tool using Cargo from the GitHub repository:
cargo install codebase-to-markdown
cargo install --git https://github.com/Quantaindew/codebase-to-markdown
- Run the tool:
codebase-to-markdown
- Your codebase will be formatted into
codebase.md.
- Ensure the script has executable permissions after downloading:
chmod +x ./codebase.sh
- Run the script:
./codebase.sh
- Your codebase will be formatted into
codebase.md.
In both methods, the output is a codebase.md file containing:
- A project structure tree.
- The contents of all text files (excluding binary/image files and those in
.gitignore), wrapped in<file src="...">tags.
This project is licensed under the MIT License. See the LICENSE file for details.