| name | repo2txt |
| description | Convert code repositories to formatted text for LLM analysis. Use when the user wants to send code to Gemini, Claude, or other LLMs for debugging, code review, or analysis. Triggers on phrases like "convert code to text", "repo to text", "format code for LLM", "send code to Gemini", or when analyzing code structure and contents for LLM consumption. |
Repo2txt
Overview
This skill converts local code repositories into a formatted text file suitable for sending to LLMs like Gemini, Claude, or ChatGPT. It's similar to https://repo2txt.simplebasedomain.com/ but runs locally, giving you full control over file selection and formatting.
Quick Start
Basic Usage
Convert a repository to text and display in terminal:
python3 scripts/repo2txt.py /path/to/repo
Save to a file:
python3 scripts/repo2txt.py /path/to/repo -o output.txt
Filter by Extensions
Only include specific file types:
python3 scripts/repo2txt.py /path/to/repo -e .py,.js,.ts
Exclude certain extensions:
python3 scripts/repo2txt.py /path/to/repo -x .test.js,.spec.ts
Common Scenarios
Debug a specific module:
python3 scripts/repo2txt.py ./src/components -e .tsx,.ts -o component_debug.txt
Analyze backend API:
python3 scripts/repo2txt.py ./src/api -e .py -o api_analysis.txt
Review configuration files:
python3 scripts/repo2txt.py . -e .json,.yaml,.yml,.toml -o config_review.txt
Output Format