CLI Tool & Context Engineering Platform
7.3k 2026-04-18
mufeedvh/code2prompt
A powerful CLI tool and ecosystem to convert entire codebases into structured, token-counted prompts for Large Language Models.
Core Features
Interactive Terminal User Interface (TUI)
Smart file filtering with .gitignore support
Customizable prompt templating using Handlebars
Automatic token usage tracking for LLM context limits
Python SDK and local server for AI agent integration
Quick Start
cargo install code2promptDetailed Introduction
Code2Prompt is an advanced context engineering solution designed to streamline the process of preparing codebases for Large Language Models. It transforms complex code repositories into single, well-structured prompts, respecting `.gitignore` rules and providing token usage insights. Beyond its CLI, it offers a Rust-powered core library, a Python SDK for AI agents and RAG pipelines, and an MCP server for efficient local codebase access, making it an indispensable tool for developers working with LLMs.