# Code2Prompt Code2Prompt is a [[Rust]]-based CLI tool that can be used to convert an entire codebase into a single LLM prompt, including the source tree, prompt templating, token counting, etc. ## Installation First, [[Cargo (Rust)|Cargo (Rust)]] needs to be installed. Then, this Rust crate can be installed using: `cargo install code2prompt` ## Usage - Basic usage: `code2prompt path/to/codebase` - Counting tokens: `code2prompt path/to/codebase --tokens` - Generate an output file: `code2prompt "./30 Areas/33 Permanent notes" --include "*.md" --tokens --output="./50 Resources/57 Prompts/Areas.md"` ## References - Source code and documentation: https://github.com/mufeedvh/code2prompt ## Related - [[files-to-prompt]] - [[CodeWeaver]]