About
code2prompt is a free and open-source AI tool that simplifies the process of generating prompts for large language models (LLMs) from your codebase. By traversing your directory structure and understanding each file's content, it builds an organized and detailed tree structure, allowing for easy prompt generation tailored to your needs.
This tool is especially beneficial for developers looking to engage LLMs in code analysis, snippet generation, or various programming tasks without the tedious manual setup.
Highlights
- Easy Installation: Quickly install with
cargo install code2prompt
. - Customizable Prompts: Utilize Handlebars templates to tailor the generated prompts to fit specific use cases.
- Comprehensive Tree Structure: Generates a well-organized Markdown prompt detailing the entire codebase for intuitive usage.
- Clipboard & File Saving: Automatically copies generated prompts to your clipboard and allows saving to an output file.
- Filter Options: Exclude files using glob patterns or respect .gitignore settings, making it highly adaptable.
- Token Count Display: Keep track of the token count for generated prompts, aiding in context management.
- Git Integration: Optionally include Git diff output for tracking changes in staged files.
- Support for Hidden Files: Control the inclusion of hidden files with one simple flag.
- Online Documentation: Comprehensive documentation is available to guide you through features and usage effectively.
Combine all these features to streamline your code-related tasks while enhancing your interactions with advanced AI models.