New: Repomix Website & Discord Community!
- Try Repomix in your browser at repomix.com
- Join our Discord Server for support and discussion
Features
- AI-Optimized: Formats your codebase in a way that's easy for AI to understand and process.
- Token Counting: Provides token counts for each file and the entire repository, useful for LLM context limits.
- Simple to Use: You need just one command to pack your entire repository.
- Customizable: Easily configure what to include or exclude.
- Git-Aware: Automatically respects your
.gitignore
files and.git/info/exclude
.
- Security-Focused: Incorporates Secretlint for robust security checks to detect and prevent inclusion of sensitive information.
- Code Compression: The
--compress
option uses Tree-sitter to extract key code elements, reducing token count while preserving structure.
Quick Start
Using the CLI Tool `>_`
repomix-output.xml
file in your current directory, containing your entire
repository in an AI-friendly format.Using The Website
Available Options
- Customizable output format (XML, Markdown, or Plain Text)
- Instant token count estimation
- Much more!
Using The VSCode Extension
Alternative Tools
Gitingest
, which is better suited for Python ecosystem and data
science workflows:
https://github.com/cyclotruc/gitingestUsage
repomix.config.json
):Docker Usage
output
directory:Prompt Examples
Code Review and Refactoring
Documentation Generation
Test Case Generation
Code Quality Assessment
Library Overview
Community Discussion
- Which AI tools they're using with Repomix
- Effective prompts they've discovered
- How Repomix has helped them
- Tips and tricks for getting the most out of AI code analysis
Output File Format
XML Format (default)
When your prompts involve multiple components like context, instructions, and examples, XML tags can be a game-changer. They help Claude parse your prompts more accurately, leading to higher-quality outputs.
Markdown Format
--style markdown
option:Plain Text Format
--style plain
option:Command Line Options
Basic Options
-v, --version
: Show tool version
Output Options
-o, --output <file>
: Specify the output file name
--style <style>
: Specify the output style (xml
,markdown
,plain
)
--parsable-style
: Enable parsable output based on the chosen style schema. Note that this can increase token count.
--compress
: Perform intelligent code extraction, focusing on essential function and class signatures to reduce token count
--output-show-line-numbers
: Show line numbers in the output
--copy
: Additionally copy generated output to system clipboard
--no-file-summary
: Disable file summary section output
--no-directory-structure
: Disable directory structure section output
--remove-comments
: Remove comments from supported file types
--remove-empty-lines
: Remove empty lines from the output
--header-text <text>
: Custom text to include in the file header
--instruction-file-path <path>
: Path to a file containing detailed custom instructions
--include-empty-directories
: Include empty directories in the output
--no-git-sort-by-changes
: Disable sorting files by git change count (enabled by default)
Filter Options
--include <patterns>
: List of include patterns (comma-separated)
-i, --ignore <patterns>
: Additional ignore patterns (comma-separated)
--no-gitignore
: Disable .gitignore file usage
--no-default-patterns
: Disable default patterns
Remote Repository Options
--remote <url>
: Process a remote Git repository
--remote-branch <name>
: Specify the remote branch name, tag, or commit hash (defaults to repository default branch)
Configuration Options
-c, --config <path>
: Path to a custom config file
--init
: Create config file
--global
: Use global config
Security Options
--no-security-check
: Disable security check
Token Count Options
--token-count-encoding <encoding>
: Specify token count encoding used by OpenAI's tiktoken tokenizer (e.g.,o200k_base
for GPT-4o,cl100k_base
for GPT-4/3.5). See tiktoken model.py for encoding details.
MCP
--mcp
: Run as a MCP (Model Context Protocol) server
Other Options
--top-files-len <number>
: Number of top files to display in the summary
--verbose
: Enable verbose logging
--quiet
: Disable all output to stdout
Updating Repomix
npx repomix
is generally more convenient as it always uses the latest version.Remote Repository Processing
--remote
option followed by the repository URL:Code Compression
--compress
option utilizes Tree-sitter to perform intelligent code extraction, focusing on essential function and class signatures while removing implementation details. This can help reduce token count while retaining important structural information.[!NOTE] This is an experimental feature that we'll be actively improving based on user feedback and real-world usage
MCP Server Integration
Configuring MCP Servers
- Using the Install Badge:
- Using the Command Line:
cline_mcp_settings.json
file:Cursor Settings
> MCP
> + Add new global MCP server
with a configuration similar to Cline.claude_desktop_config.json
file with similar configuration to Cline's config.Available MCP Tools
- pack_codebase: Package a local code directory into a consolidated file for AI analysis
- Parameters:
- pack_remote_repository: Fetch, clone and package a GitHub repository
- Parameters:
- read_repomix_output: Read the contents of a Repomix output file in environments where direct file access is not possible
- Parameters:
- Features:
- file_system_read_file: Read a file using an absolute path with security validation
- Parameters:
- Security features:
- file_system_read_directory: List contents of a directory using an absolute path
- Parameters:
- Features:
Configuration
repomix.config.json
file in your project root for custom configurations.[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
- Comments (both single-line and multi-line)
- Trailing commas in objects and arrays
- Unquoted property names
- More relaxed string syntax
Global Configuration
- Windows:
%LOCALAPPDATA%\Repomix\repomix.config.json
- macOS/Linux:
$XDG_CONFIG_HOME/repomix/repomix.config.json
or~/.config/repomix/repomix.config.json
Include and Ignore
Include Patterns
- Use
**/*.js
to include all JavaScript files in any directory
- Use
src/**/*
to include all files within thesrc
directory and its subdirectories
- Combine multiple patterns like
["src/**/*.js", "**/*.md"]
to include JavaScript files insrc
and all Markdown files
Ignore Patterns
- .gitignore: By default, patterns listed in your project's
.gitignore
files and.git/info/exclude
are used. This behavior can be controlled with theignore.useGitignore
setting or the--no-gitignore
cli option.
- Default patterns: Repomix includes a default list of commonly excluded files and directories (e.g., node_modules,
.git, binary files). This feature can be controlled with the
ignore.useDefaultPatterns
setting or the--no-default-patterns
cli option. Please see defaultIgnore.ts for more details.
- .repomixignore: You can create a
.repomixignore
file in your project root to define Repomix-specific ignore patterns. This file follows the same format as.gitignore
.
- Custom patterns: Additional ignore patterns can be specified using the
ignore.customPatterns
option in the configuration file. You can overwrite this setting with the-i, --ignore
command line option.
- Custom patterns
ignore.customPatterns
.repomixignore
.gitignore
and.git/info/exclude
(ifignore.useGitignore
is true and--no-gitignore
is not used)
- Default patterns (if
ignore.useDefaultPatterns
is true and--no-default-patterns
is not used)
Custom Instruction
output.instructionFilePath
option allows you to specify a separate file containing detailed instructions or
context about your project. This allows AI systems to understand the specific context and requirements of your project,
potentially leading to more relevant and tailored analysis or suggestions.- Create a file named
repomix-instruction.md
in your project root:
- In your
repomix.config.json
, add theinstructionFilePath
option:
repomix-instruction.md
in a dedicated section.Put long-form data at the top: Place your long documents and inputs (~20K+ tokens) near the top of your prompt, above your query, instructions, and examples. This can significantly improve Claude's performance across all models. Queries at the end can improve response quality by up to 30% in tests, especially with complex, multi-document inputs.
Comment Removal
output.removeComments
is set to true
, Repomix will attempt to remove comments from supported file types. This
feature can help reduce the size of the output file and focus on the essential code content.Security Check
security.enableSecurityCheck
to
false
in your configuration file:--no-security-check
command line option:[!NOTE] Disabling security checks may expose sensitive information. Use this option with caution and only when necessary, such as when working with test files or documentation that contains example credentials.
Using Repomix as a Library
Installation
Basic Usage
Process Remote Repository
Using Core Components
Contribution
Contributors
Privacy Policy
Repomix CLI Tool
- Data Collection: The Repomix CLI tool does not collect, transmit, or store any user data, telemetry, or repository information.
- Network Usage: Repomix CLI operates fully offline after installation. The only cases where an internet connection is needed are:
- Security Considerations: Since all processing is local, Repomix CLI is safe to use with private and internal repositories.
Repomix Website ([repomix.com](https://repomix.com/))
- Data Collection: The Repomix website uses Google Analytics to collect usage data, such as page views and user interactions. This helps us understand how the website is used and improve the user experience.
Liability Disclaimer
License
New: Repomix Website & Discord Community!
- Try Repomix in your browser at repomix.com
- Join our Discord Server for support and discussion
Features
- AI-Optimized: Formats your codebase in a way that's easy for AI to understand and process.
- Token Counting: Provides token counts for each file and the entire repository, useful for LLM context limits.
- Simple to Use: You need just one command to pack your entire repository.
- Customizable: Easily configure what to include or exclude.
- Git-Aware: Automatically respects your
.gitignore
files and.git/info/exclude
.
- Security-Focused: Incorporates Secretlint for robust security checks to detect and prevent inclusion of sensitive information.
- Code Compression: The
--compress
option uses Tree-sitter to extract key code elements, reducing token count while preserving structure.
Quick Start
Using the CLI Tool `>_`
repomix-output.xml
file in your current directory, containing your entire
repository in an AI-friendly format.Using The Website
Available Options
- Customizable output format (XML, Markdown, or Plain Text)
- Instant token count estimation
- Much more!
Using The VSCode Extension
Alternative Tools
Gitingest
, which is better suited for Python ecosystem and data
science workflows:
https://github.com/cyclotruc/gitingestUsage
repomix.config.json
):Docker Usage
output
directory:Prompt Examples
Code Review and Refactoring
Documentation Generation
Test Case Generation
Code Quality Assessment
Library Overview
Community Discussion
- Which AI tools they're using with Repomix
- Effective prompts they've discovered
- How Repomix has helped them
- Tips and tricks for getting the most out of AI code analysis
Output File Format
XML Format (default)
When your prompts involve multiple components like context, instructions, and examples, XML tags can be a game-changer. They help Claude parse your prompts more accurately, leading to higher-quality outputs.
Markdown Format
--style markdown
option:Plain Text Format
--style plain
option:Command Line Options
Basic Options
-v, --version
: Show tool version
Output Options
-o, --output <file>
: Specify the output file name
--style <style>
: Specify the output style (xml
,markdown
,plain
)
--parsable-style
: Enable parsable output based on the chosen style schema. Note that this can increase token count.
--compress
: Perform intelligent code extraction, focusing on essential function and class signatures to reduce token count
--output-show-line-numbers
: Show line numbers in the output
--copy
: Additionally copy generated output to system clipboard
--no-file-summary
: Disable file summary section output
--no-directory-structure
: Disable directory structure section output
--remove-comments
: Remove comments from supported file types
--remove-empty-lines
: Remove empty lines from the output
--header-text <text>
: Custom text to include in the file header
--instruction-file-path <path>
: Path to a file containing detailed custom instructions
--include-empty-directories
: Include empty directories in the output
--no-git-sort-by-changes
: Disable sorting files by git change count (enabled by default)
Filter Options
--include <patterns>
: List of include patterns (comma-separated)
-i, --ignore <patterns>
: Additional ignore patterns (comma-separated)
--no-gitignore
: Disable .gitignore file usage
--no-default-patterns
: Disable default patterns
Remote Repository Options
--remote <url>
: Process a remote Git repository
--remote-branch <name>
: Specify the remote branch name, tag, or commit hash (defaults to repository default branch)
Configuration Options
-c, --config <path>
: Path to a custom config file
--init
: Create config file
--global
: Use global config
Security Options
--no-security-check
: Disable security check
Token Count Options
--token-count-encoding <encoding>
: Specify token count encoding used by OpenAI's tiktoken tokenizer (e.g.,o200k_base
for GPT-4o,cl100k_base
for GPT-4/3.5). See tiktoken model.py for encoding details.
MCP
--mcp
: Run as a MCP (Model Context Protocol) server
Other Options
--top-files-len <number>
: Number of top files to display in the summary
--verbose
: Enable verbose logging
--quiet
: Disable all output to stdout
Updating Repomix
npx repomix
is generally more convenient as it always uses the latest version.Remote Repository Processing
--remote
option followed by the repository URL:Code Compression
--compress
option utilizes Tree-sitter to perform intelligent code extraction, focusing on essential function and class signatures while removing implementation details. This can help reduce token count while retaining important structural information.[!NOTE] This is an experimental feature that we'll be actively improving based on user feedback and real-world usage
MCP Server Integration
Configuring MCP Servers
- Using the Install Badge:
- Using the Command Line:
cline_mcp_settings.json
file:Cursor Settings
> MCP
> + Add new global MCP server
with a configuration similar to Cline.claude_desktop_config.json
file with similar configuration to Cline's config.Available MCP Tools
- pack_codebase: Package a local code directory into a consolidated file for AI analysis
- Parameters:
- pack_remote_repository: Fetch, clone and package a GitHub repository
- Parameters:
- read_repomix_output: Read the contents of a Repomix output file in environments where direct file access is not possible
- Parameters:
- Features:
- file_system_read_file: Read a file using an absolute path with security validation
- Parameters:
- Security features:
- file_system_read_directory: List contents of a directory using an absolute path
- Parameters:
- Features:
Configuration
repomix.config.json
file in your project root for custom configurations.[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
- Comments (both single-line and multi-line)
- Trailing commas in objects and arrays
- Unquoted property names
- More relaxed string syntax
Global Configuration
- Windows:
%LOCALAPPDATA%\Repomix\repomix.config.json
- macOS/Linux:
$XDG_CONFIG_HOME/repomix/repomix.config.json
or~/.config/repomix/repomix.config.json
Include and Ignore
Include Patterns
- Use
**/*.js
to include all JavaScript files in any directory
- Use
src/**/*
to include all files within thesrc
directory and its subdirectories
- Combine multiple patterns like
["src/**/*.js", "**/*.md"]
to include JavaScript files insrc
and all Markdown files
Ignore Patterns
- .gitignore: By default, patterns listed in your project's
.gitignore
files and.git/info/exclude
are used. This behavior can be controlled with theignore.useGitignore
setting or the--no-gitignore
cli option.
- Default patterns: Repomix includes a default list of commonly excluded files and directories (e.g., node_modules,
.git, binary files). This feature can be controlled with the
ignore.useDefaultPatterns
setting or the--no-default-patterns
cli option. Please see defaultIgnore.ts for more details.
- .repomixignore: You can create a
.repomixignore
file in your project root to define Repomix-specific ignore patterns. This file follows the same format as.gitignore
.
- Custom patterns: Additional ignore patterns can be specified using the
ignore.customPatterns
option in the configuration file. You can overwrite this setting with the-i, --ignore
command line option.
- Custom patterns
ignore.customPatterns
.repomixignore
.gitignore
and.git/info/exclude
(ifignore.useGitignore
is true and--no-gitignore
is not used)
- Default patterns (if
ignore.useDefaultPatterns
is true and--no-default-patterns
is not used)
Custom Instruction
output.instructionFilePath
option allows you to specify a separate file containing detailed instructions or
context about your project. This allows AI systems to understand the specific context and requirements of your project,
potentially leading to more relevant and tailored analysis or suggestions.- Create a file named
repomix-instruction.md
in your project root:
- In your
repomix.config.json
, add theinstructionFilePath
option:
repomix-instruction.md
in a dedicated section.Put long-form data at the top: Place your long documents and inputs (~20K+ tokens) near the top of your prompt, above your query, instructions, and examples. This can significantly improve Claude's performance across all models. Queries at the end can improve response quality by up to 30% in tests, especially with complex, multi-document inputs.
Comment Removal
output.removeComments
is set to true
, Repomix will attempt to remove comments from supported file types. This
feature can help reduce the size of the output file and focus on the essential code content.Security Check
security.enableSecurityCheck
to
false
in your configuration file:--no-security-check
command line option:[!NOTE] Disabling security checks may expose sensitive information. Use this option with caution and only when necessary, such as when working with test files or documentation that contains example credentials.
Using Repomix as a Library
Installation
Basic Usage
Process Remote Repository
Using Core Components
Contribution
Contributors
Privacy Policy
Repomix CLI Tool
- Data Collection: The Repomix CLI tool does not collect, transmit, or store any user data, telemetry, or repository information.
- Network Usage: Repomix CLI operates fully offline after installation. The only cases where an internet connection is needed are:
- Security Considerations: Since all processing is local, Repomix CLI is safe to use with private and internal repositories.
Repomix Website ([repomix.com](https://repomix.com/))
- Data Collection: The Repomix website uses Google Analytics to collect usage data, such as page views and user interactions. This helps us understand how the website is used and improve the user experience.