OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Developer Tools & SDKs

Code2Prompt — raphaelmansuy

Code2Prompt is a Python command-line utility that collects content from files and directories and generates a Markdown document for providing codebase context to large language models.

Independent OpenViST project profile, based on linked sources.

Code2Prompt — raphaelmansuy — OpenViST project profile in AI Developer Tools & SDKs.
OpenViST project illustration. See the linked sources for product details.
Understand the project

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.
Before you choose

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.

Source-based practical guide

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

  1. Install with pipx install code2prompt or the command below.

    Documented command
    pip install code2prompt
  2. Run 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.
Source-based practical guide

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

  1. Install Code2Prompt using pip or pipx.

  2. 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.
Evidence and transparency

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