code2prompt is a command-line tool (CLI) that converts your codebase into a single LLM prompt with a source tree, prompt templating, and token counting.
You can run this tool on the entire directory and it would generate a well-formatted Markdown prompt detailing the source tree structure, and all the code.
You can then upload this document to either GPT or Claude models with higher context windows and ask it to:
.gitignore (can be disabled with --no-ignore).--hidden flag.You can customize the prompt template to achieve any of the desired use cases. It essentially traverses a codebase and creates a prompt with all source files combined.
In short, it automates copy-pasting multiple source files into your prompt and formatting them along with letting you know how many tokens your code consumes.
Download the latest binary for your OS from Releases.
Requires:
git clone https://github.com/mufeedvh/code2prompt.git
cd code2prompt/
cargo build --release installs from the crates.io registry.
cargo install code2prompt For unpublished builds:
cargo install --git https://github.com/mufeedvh/code2prompt --force For more information click here.
In MySQL Server 5.5 and earlier versions, the MyISAM was the default storage engine. So,…
A newly disclosed vulnerability in Microsoft Authenticator could expose one time sign in codes or…
Modrinth is a modern platform that’s rapidly changing the landscape of Minecraft modding, providing an…
A new, highly sophisticated malware campaign named BlackSanta has emerged, primarily targeting HR and recruitment…
Perplexity has unveiled an exciting new feature, Personal Computer, which allows AI agents to seamlessly…
In a recent cyber incident, a group named CARDINAL, associated with the label Russian Legion,…