#10 · Primary category: Prompt Engineering Tools

code2prompt

ai chatgpt claude cli command-line command-line-tool gpt llm prompt prompt-engineering prompt-generator prompt-toolkit rust

A CLI tool to convert your codebase into a single LLM prompt with source tree, prompt templating, and token counting.

Project last updated:06/29/26

GitHub Stars

7.6K

Forks

437

Contributors

38

License

MIT

Why we included this project

Anyone who feeds a codebase to a language model knows the slow part: assembling the context, not asking the question. Code2Prompt handles that assembly for you. It walks your project, builds a source tree, and packages the relevant files into one structured prompt you can paste into ChatGPT or any other model. Handlebars templates let you define reusable prompt layouts, and the token counter keeps you inside a model's context window before a run fails halfway. It runs as a plain CLI or an interactive terminal UI, and you can call it from Python when you want to wire context into an agent or a small MCP server. Teams that prepare code context by hand every day will find this a genuine timesaver rather than another wrapper around a chat interface.

Articles for this project

No articles for this project yet.

To suggest a topic or contribute an article, contact us.

Related projects in this category