Output Formats
Plain Text (default)
repomix --style plainXML (best for Claude)
repomix --style xmlOutput:
<file path="src/auth/handler.ts">
export function login(credentials: Credentials) {
// ...
}
</file>
<file path="src/db/connection.ts">
// ...
</file>Markdown
repomix --style markdownAdvanced Usage
Filter Files
# Only TypeScript files in src/
repomix --include "src/**/*.ts"
# Exclude tests
repomix --exclude "**/*.test.ts,**/*.spec.ts"
# Only specific directories
repomix --include "src/auth/**,src/api/**"Token Counting
repomix --token-count
# Output: Total tokens: 45,231 (cl100k_base)Remote Repos
# Pack a GitHub repo directly
repomix --remote https://github.com/user/repoConfiguration File
Create repomix.config.json:
{
"output": {
"filePath": "context.txt",
"style": "xml"
},
"include": ["src/**/*.ts", "src/**/*.tsx"],
"ignore": {
"customPatterns": ["*.test.ts", "*.spec.ts", "dist/**"]
}
}Key Stats
- 8,000+ GitHub stars
- 3 output formats (plain, XML, markdown)
- Token counting built-in
- .gitignore aware
- Remote repo support
FAQ
Q: What is Repomix? A: Repomix is a CLI tool that packs a code repository into a single text file optimized for LLM context windows, with token counting and customizable filtering.
Q: Is Repomix free? A: Yes, fully open-source under MIT license.
Q: Which output format is best for Claude? A: XML format works best with Claude, as it uses XML tags to clearly delineate file boundaries.