RepoText is an open-source tool that packs your entire repository into a single, AI-friendly file. It's designed to help developers feed their codebase into LLMs/AI tools like Claude, ChatGPT, and Gemini for comprehensive project analysis and advice.
- Optimized for AI tools like Claude, ChatGPT, etc.
- Includes project and folder structure for AI context
- Provides token counts for each file and the entire repo
- One-command repo packing
- Customizable file inclusion/exclusion
- Security checks to detect and prevent inclusion of sensitive information
- Language and project type agnostic
- Optimized for smallest file size possible
- Intelligent file ordering
- Dependency analysis
- Diff-style output for changes since the last pack
To run RepoText without installation:
-
Clone the repository: git clone https://github.com/yourusername/repotext.git cd repotext
-
Run directly using Python: python3 run.py /path/to/your/repo --output packed_repo.txt
It's recommended to use a virtual environment to avoid conflicts with other Python packages:
- Create a virtual environment:
python3 -m venv venv
- Activate the virtual environment:
source venv/bin/activate
- Install the package:
pip install -e .
-
You can now use RepoText within this virtual environment.
-
When you're done, you can deactivate the virtual environment:
deactivate
If you prefer to install RepoText:
-
Clone the repository: git clone https://github.com/yourusername/repotext.git cd repotext
-
Install the package:
pip install -e .
- Run RepoText: repotext /path/to/your/repo --output packed_repo.txt
To pack a repository:
repotext /path/to/your/repo --output packed_repo.txt
Options:
--output, -o
: Specify the output file name (default: repotext_output.txt)--exclude, -e
: Patterns to exclude (can be used multiple times)--diff
: Generate diff from last pack--compress
: Compress the output--format
: Output format (txt, md, or json)
Example with options:
repotext /path/to/your/repo -o packed_repo.txt --exclude ".pyc" --exclude "venv/" --diff --compress --format md
We welcome contributions! Please see our Contributing Guide for more details.
This project is licensed under the MIT License - see the LICENSE file for details.