AI-Optimized
Formats your codebase in a way that's easy for AI to understand and process.
Pack your codebase into AI-friendly formats
For advanced users who need more control, Repomix offers extensive customization options through its CLI interface.
You can try Repomix instantly in your project directory without installation:
npx repomix
Or install globally for repeated use:
# Install using npm
npm install -g repomix
# Alternatively using yarn
yarn global add repomix
# Alternatively using Homebrew (macOS)
brew install repomix
# Then run in any project directory
repomix
That's it! Repomix will generate a repomix-output.txt
file in your current directory, containing your entire repository in an AI-friendly format.
To pack your entire repository:
repomix
To pack a specific directory:
repomix path/to/directory
To pack specific files or directories using glob patterns:
repomix --include "src/**/*.ts,**/*.md"
To exclude specific files or directories:
repomix --ignore "**/*.log,tmp/"
To pack a remote repository:
repomix --remote https://github.com/yamadashy/repomix
# You can also use GitHub shorthand:
repomix --remote yamadashy/repomix
# You can specify the branch name, tag, or commit hash:
repomix --remote https://github.com/yamadashy/repomix --remote-branch main
# Or use a specific commit hash:
repomix --remote https://github.com/yamadashy/repomix --remote-branch 935b695
To initialize a new configuration file (repomix.config.json
):
repomix --init
Once you have generated the packed file, you can use it with Generative AI tools like Claude, ChatGPT, and Gemini.
You can also run Repomix using Docker 🐳
This is useful if you want to run Repomix in an isolated environment or prefer using containers.
Basic usage (current directory):
docker run -v .:/app -it --rm ghcr.io/yamadashy/repomix
To pack a specific directory:
docker run -v .:/app -it --rm ghcr.io/yamadashy/repomix path/to/directory
Process a remote repository and output to a output
directory:
docker run -v ./output:/app -it --rm ghcr.io/yamadashy/repomix --remote https://github.com/yamadashy/repomix
Choose your preferred output format:
# XML format (default)
repomix --style xml
# Markdown format
repomix --style markdown
# Plain text format
repomix --style plain
Create a repomix.config.json
for persistent settings:
{
"output": {
"style": "markdown",
"filePath": "custom-output.md",
"removeComments": true,
"showLineNumbers": true,
"topFilesLength": 10
},
"ignore": {
"customPatterns": ["*.test.ts", "docs/**"]
}
}
TIP
💡 Check out our GitHub repository for complete documentation and more examples!