A blazing-fast Rust implementation of repomix
Pack your entire repository into a single, AI-friendly file
Installation β’ Usage β’ Configuration β’ Features β’ Examples β’ License
Remix prepares your codebase for AI analysis by packing it into a single file. Perfect for feeding your code to Large Language Models (LLMs) like Claude, ChatGPT, DeepSeek, Perplexity, Gemini, and more.
flowchart TD
A[CLI Execution] --> B[Parse Command Line Arguments]
B --> C[Load Configuration]
C --> D{Remote Repository?}
D -->|Yes| E[Parse Remote URL]
E --> F[Clone Repository to Temp Directory]
F --> G[Checkout Target Branch/Commit]
D -->|No| H[Use Local Directory Path]
G --> I[Scan Repository]
H --> I
I --> J[Apply Include/Ignore Filters]
J --> K[Multi-layer Filtering]
K --> L[File Size Check]
L --> M[Binary File Detection]
M --> N[Parallel File Processing]
N --> O[Read File Content]
O --> P{Security Check Enabled?}
P -->|Yes| Q[Check for Sensitive Content]
P -->|No| R[Skip Security Check]
Q --> S[Filter Sensitive Files]
R --> T[Process File Content]
S --> T
T --> U{Compression Mode?}
U -->|Yes| V[Compress Content]
U -->|No| W{Comment Removal?}
V --> X[Format Output]
W -->|Yes| Y[Remove Comments]
W -->|No| X
Y --> X
X --> Z[Generate Repository Summary]
Z --> AA[Format Output File]
AA --> BB{Markdown Format}
AA --> CC{JSON Format}
AA --> DD{Text Format}
BB --> EE[Write Markdown File]
CC --> FF[Write JSON File]
DD --> GG[Write Text File]
EE --> HH{Open File?}
FF --> HH
GG --> HH
HH -->|Yes| II[Open Output File]
HH -->|No| JJ[Workflow Complete]
II --> JJ
A visualization of how Remix processes your repository
| Feature | Description |
|---|---|
| β‘ High Performance | Built in Rust for maximum speed and efficiency |
| π Repository Packing | Combine your entire codebase into a single file |
| π Remote Repository Support | Process GitHub repositories directly with branch/tag/commit support |
| π― Intelligent Filtering | Include/exclude files using glob patterns |
| π‘οΈ Multi-layered Ignore System | Uses .gitignore, .mixignore, and custom ignore patterns |
| π Security Checks | Automatically detect and warn about sensitive information |
| π Multiple Output Formats | Markdown, JSON, plain text, TOON, and SQLite SQL support |
| π§Ή Comment Removal | Optionally strip comments from source code to reduce token count |
| βοΈ Flexible Configuration | JSON-based config files with CLI overrides |
| π¨ AI Tool Optimized | Formatted output designed for LLM consumption |
From Crates.io:
cargo install remixFrom Source:
git clone https://github.com/CodingInCarhartts/remix.git
cd remix
cargo build --release
# Binary will be available at target/release/remixAs a Cargo Subcommand:
cargo install --features cargo-subcommand remix
# Then use as: cargo mix [options]Pack your entire repository:
remixPack a specific directory:
remix /path/to/your/projectPack a remote repository:
remix --remote https://github.com/username/repoπ File Selection
# Include specific files or directories using glob patterns
remix --include "*.rs,*.toml"
remix --include "src/**/*.rs,tests/**/*.rs"
# Exclude specific files or directories
remix --ignore "*.log,*.tmp"
remix --ignore "node_modules/**,target/**"
# Set maximum file size (in bytes)
remix --max-file-size 50000π Remote Repositories
# Pack a remote repository (full URL)
remix --remote https://github.com/microsoft/vscode
# Pack a specific branch
remix --remote https://github.com/user/repo --remote-branch develop
# Pack a specific tag
remix --remote https://github.com/user/repo --remote-branch v1.2.3
# Using GitLab
remix --remote https://gitlab.com/example/projectβοΈ Processing Options
# Remove comments from code
remix --remove-comments
# Skip security checks (use with caution)
remix --skip-sensitive-check
# Compress the output
remix --compress
# Add custom instructions for AI
remix --instruction "Please analyze this Rust codebase"
# Use instruction file
remix --instruction-file ./context.txt
# Initialize a new configuration file
remix --initπ Output Options
# Specify output path
remix --output ./my-repo.md
# Change output format (md, json, txt, toon, sql)
remix --format sql
# Open output file after generation
remix --openCreate a remix.config.json file in your project root for custom configurations:
{
"include": [],
"ignore": {
"use_gitignore": true,
"use_default_patterns": true,
"use_mixignore": true,
"custom_patterns": []
},
"max_file_size": 100000,
"compress": false,
"security": {
"enable_security_check": true
},
"output": {
"format": "md",
"open_file": false,
"path": "./remix-output.txt",
"instruction_file_path": null,
"remove_comments": false
},
"instruction": null
}Basic configuration with custom includes
{
"include": ["src/**/*.rs", "Cargo.toml", "README.md"],
"output": {
"path": "./my-project.md"
}
}Configuration for a Node.js project
{
"include": ["src/**/*.js", "package.json", "README.md"],
"ignore": {
"custom_patterns": ["node_modules/**", "*.log"]
},
"output": {
"format": "md",
"remove_comments": true
}
}Configuration for AI analysis
{
"include": ["src/**/*.py", "requirements.txt", "docs/**"],
"max_file_size": 50000,
"output": {
"format": "md",
"instruction_file_path": "./ai-instructions.txt"
},
"instruction": "Please analyze this Python codebase for security vulnerabilities"
}Remix uses a multi-layered ignore system:
.gitignore- Standard Git ignore patterns are respected.mixignore- Project-specific ignore patterns for Remix- Command line
--ignorepatterns or configuration file settings - Default patterns - Common files and directories (node_modules, target, etc.)
You can disable any of these layers using command-line options:
--no-gitignore- Don't use .gitignore patterns--no-default-patterns- Don't use default ignore patterns
Generates a well-formatted markdown file with:
- File tree structure
- Syntax-highlighted code blocks
- File metadata (size, path)
- Instructions and context at the top
Structured JSON output containing:
- Repository metadata
- File contents as base64-encoded strings
- File information (path, size, type)
- Configuration used
Token-efficient output using the TOON format:
- Compact representation optimized for LLM prompts
- 30-60% fewer tokens than JSON for structured data
- Human-readable with indentation-based structure
- Ideal for AI analysis workflows
Plain text output with:
- Simple file headers
- Raw code content
- Minimal formatting
Generates a SQLite-compatible SQL script that:
- Creates tables for repository data (runs, summary, files, extensions, binary files, suspicious files)
- Inserts all repository metadata and file contents
- Uses proper escaping for special characters (single quotes, newlines)
- Can be imported directly into a SQLite database:
remix --format sql --output remix.sql sqlite3 remix.db < remix.sql sqlite3 remix.db "SELECT * FROM remix_files;"
Pack the current directory:
remixPack a specific project:
remix ~/projects/my-appInclude only Rust files:
remix --include "*.rs"Add instructions for AI analysis:
remix --instruction "Please review this codebase for security issues" --output ./security-review.mdUse instruction file:
echo "Analyze the following Rust code for performance optimizations:" > instructions.txt
remix --instruction-file ./instructions.txt --include "*.rs"Process only small files:
remix --max-file-size 10000Exclude build artifacts:
remix --ignore "target/**,*.log""No files found" error:
- Check your include patterns
- Verify the path exists and contains files
- Try
--no-default-patternsif files are being excluded
Large output files:
- Use
--max-file-sizeto limit file sizes - Add more ignore patterns with
--ignore - Use
--compressto reduce output size
Permission denied:
- Ensure you have read access to the target directory
- For remote repos, ensure the repository is public or you have access
Configuration not loading:
- Verify the JSON syntax is valid
- Check the config file path
- Use
--initto create a new config file
- Use specific include patterns instead of processing entire directories
- Exclude large directories like
node_modules,target, etc. - Use
--compressfor smaller output files - For large repositories, consider using
--max-file-size
Contributions are welcome! Feel free to open issues or submit pull requests.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT License - See the LICENSE file for details.
Built with β€οΈ by CodingInCarhartts of the Rust community