website/client/src/en/guide/usage.md
Pack your entire repository:
repomix
repomix path/to/directory
Use glob patterns:
repomix --include "src/**/*.ts,**/*.md"
repomix --ignore "**/*.log,tmp/"
When working with large codebases, the packed output may exceed file size limits imposed by some AI tools (e.g., Google AI Studio's 1MB limit). Use --split-output to automatically split the output into multiple files:
repomix --split-output 1mb
This generates numbered files like:
repomix-output.1.xmlrepomix-output.2.xmlrepomix-output.3.xmlSize can be specified with units: 500kb, 1mb, 2mb, 1.5mb, etc. Decimal values are supported.
[!NOTE] Files are grouped by top-level directory to maintain context. A single file or directory will never be split across multiple output files.
# Using GitHub URL
repomix --remote https://github.com/user/repo
# Using shorthand
repomix --remote user/repo
# Specific branch/tag/commit
repomix --remote user/repo --remote-branch main
repomix --remote user/repo --remote-branch 935b695
Pass file paths via stdin for ultimate flexibility:
# Using find command
find src -name "*.ts" -type f | repomix --stdin
# Using git to get tracked files
git ls-files "*.ts" | repomix --stdin
# Using ripgrep (rg) to find files
rg --files --type ts | repomix --stdin
# Using grep to find files containing specific content
grep -l "TODO" **/*.ts | repomix --stdin
# Using ripgrep to find files with specific content
rg -l "TODO|FIXME" --type ts | repomix --stdin
# Using sharkdp/fd to find files
fd -e ts | repomix --stdin
# Using fzf to select from all files
fzf -m | repomix --stdin
# Interactive file selection with fzf
find . -name "*.ts" -type f | fzf -m | repomix --stdin
# Using ls with glob patterns
ls src/**/*.ts | repomix --stdin
# From a file containing file paths
cat file-list.txt | repomix --stdin
# Direct input with echo
echo -e "src/index.ts\nsrc/utils.ts" | repomix --stdin
The --stdin option allows you to pipe a list of file paths to Repomix, giving you ultimate flexibility in selecting which files to pack.
When using --stdin, the specified files are effectively added to the include patterns. This means that the normal include and ignore behavior still applies - files specified via stdin will still be excluded if they match ignore patterns.
[!NOTE] When using
--stdin, file paths can be relative or absolute, and Repomix will automatically handle path resolution and deduplication.
Reduce token count while preserving code structure. See the Code Compression guide for details.
repomix --compress
# You can also use it with remote repositories:
repomix --remote yamadashy/repomix --compress
Include Git information to provide development context for AI analysis:
# Include git diffs (uncommitted changes)
repomix --include-diffs
# Include git commit logs (last 50 commits by default)
repomix --include-logs
# Include specific number of commits
repomix --include-logs --include-logs-count 10
# Include both diffs and logs
repomix --include-diffs --include-logs
This adds valuable context about:
Understanding your codebase's token distribution is crucial for optimizing AI interactions. Use the --token-count-tree option to visualize token usage across your project:
repomix --token-count-tree
This displays a hierarchical view of your codebase with token counts:
š¢ Token Count Tree:
āāāāāāāāāāāāāāāāāāāā
āāā src/ (70,925 tokens)
āāā cli/ (12,714 tokens)
ā āāā actions/ (7,546 tokens)
ā āāā reporters/ (990 tokens)
āāā core/ (41,600 tokens)
āāā file/ (10,098 tokens)
āāā output/ (5,808 tokens)
You can also set a minimum token threshold to focus on larger files:
repomix --token-count-tree 1000 # Only show files/directories with 1000+ tokens
This helps you:
--include and --ignore patternsrepomix --style xml
repomix --style markdown
repomix --style json
repomix --style plain
See Comment Removal for supported languages and details.
repomix --remove-comments
repomix --output-show-line-numbers
repomix --copy
See Security for details on what Repomix detects.
repomix --no-security-check
Initialize configuration file:
repomix --init
See Configuration Guide for detailed options.