code2prompt is an open source command line tool designed to convert an entire codebase into a structured prompt that can be easily used with large language models. It analyzes a project directory, gathers relevant source files, and formats them into a single prompt that includes the source tree and code content. This approach helps developers quickly provide full project context to AI models without manually copying files or assembling prompts. code2prompt is built in Rust and focuses on performance, enabling fast traversal of large repositories while maintaining low resource usage. It also respects common project conventions such as .gitignore, ensuring that unnecessary files are automatically excluded from the generated prompt. The generated output can be saved to a file, printed to standard output, or copied to the clipboard for immediate use. In addition to the core command line interface, the project also includes a library, Python bindings, and an MCP server.

Features

  • Generates a complete prompt from an entire codebase including source tree
  • Interactive terminal user interface for configuring prompt generation
  • Smart file filtering that respects .gitignore and glob patterns
  • Customizable prompt templates using the Handlebars templating system
  • Token usage tracking to stay within language model context limits
  • Optional Git integration to include diffs, logs, or branch comparisons

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow Code2Prompt

Code2Prompt Web Site

Other Useful Business Software
AestheticsPro Medical Spa Software Icon
AestheticsPro Medical Spa Software

Our new software release will dramatically improve your medspa business performance while enhancing the customer experience

AestheticsPro is the most complete Aesthetics Software on the market today. HIPAA Cloud Compliant with electronic charting, integrated POS, targeted marketing and results driven reporting; AestheticsPro delivers the tools you need to manage your medical spa business. It is our mission To Provide an All-in-One Cutting Edge Software to the Aesthetics Industry.
Learn More
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Code2Prompt!

Additional Project Details

Programming Language

JavaScript, Python, Rust

Related Categories

Python Artificial Intelligence Software, JavaScript Artificial Intelligence Software, Rust Artificial Intelligence Software

Registered

2026-03-13