Submit a product

code2prompt

command-line tool that packs a codebase into one LLM prompt

ToolCommand lineOpen source

code2prompt is a command-line tool that turns a code repository into a single prompt for a large language model. It writes out the directory tree and the source files in one text block, so the model can read the project in one pass. It is aimed at developers who want to ask an AI assistant questions about their code without copying files by hand.

The tool supports prompt templates, so the output can be wrapped in custom instructions. It also counts tokens, which helps when checking whether a project fits within a model's context limit. It runs from the terminal and is released under the MIT license, with the source code public on GitHub.

Alternatives to code2prompt

Products that do a similar job in AI Tools.

All alternatives

aider

terminal-based AI pair programmer that edits code in your git repo

ToolAI Tools··Open source·50k

OpenHands

AI software agent that writes and runs code from natural language requests

ToolAI Tools··Open source·95k

oh-my-pi

Command-line coding agent with editor integration built in

ToolAI Tools··Open source·40k

openclaude

command-line coding agent that works with many model providers

ToolAI Tools··Open source·35k

Nasiko

Open-source runtime for hosting and coordinating AI agents from a command line

ToolAI Tools··Open source·12k

openscience

Command-line AI workbench for scientific research work

ToolAI Tools··Open source·4.5k

gemini-cli

Terminal agent for working with Google's Gemini models

ToolAI Tools··Open source·110k

last30days-skill

Agent skill that researches a topic across Reddit, X, YouTube and more

ToolAI Tools··Open source·80k