Practical overview
When it fits
Use it before a separate LLM workflow when you want to assemble selected codebase content into a portable Markdown prompt.
Who it is for
- Developers preparing project context for LLM-assisted code analysis, documentation or improvement.
- Teams that need a portable Markdown representation of selected source files.
Documented uses
- Collect one or more project paths into a Markdown context document.
- Include or exclude files with patterns and respect project .gitignore rules.
- Adapt generated prompts with Jinja2 templates and input variables.
- Add line numbers, strip comments or map custom extensions for syntax highlighting.
Requirements & limits
The project is open source under the MIT license and its documented installation methods are pip and pipx.
- It is a CLI workflow that requires access to the files you want to process.
- Input paths can point to files or directories, with multiple paths supported.
- Options cover filtering and exclusion, .gitignore handling, line numbers, comment suppression and syntax mapping.
- The generated Markdown is for use in a separate LLM workflow; the evidence does not identify a model-vendor API integration.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Create a Markdown context file for a project
Collect a project’s files into a saved Markdown document for use in a separate LLM workflow.
Before you start
- Install Code2Prompt with pip or pipx.
- Have the target project directory available to the command line.
Steps
Install with
pipx install code2promptor the command below.pip install code2promptRun
code2prompt --path /path/to/your/project --output project_summary.md.
Expected outcome
A Markdown file named `project_summary.md` containing generated project context.
Guide limitations
- This generates the context document; it does not submit it to an LLM.
- The command shown does not configure file filters or exclusions.
Generate context from selected source paths while excluding tests
Create a Markdown context file from two paths while excluding files matching a tests pattern.
Before you start
- Install Code2Prompt with pip or pipx.
- Have the source and library paths available to the command line.
Steps
Install Code2Prompt using pip or pipx.
Run
code2prompt --path /path/to/src --path /path/to/lib --exclude "*/tests/*" --output codebase_summary.md.
Expected outcome
A Markdown output file generated from the supplied paths with files matching the exclusion pattern omitted.
Guide limitations
- The example does not specify additional include filters or template settings.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 5 November 2026
- Original website title
- raphaelmansuy/code2prompt · Official homepage title · retained in its source language

