Loading repository dataโฆ
Loading repository dataโฆ
AndersonBY / repository
๐ฆ python-repomix is a powerful tool that packs your entire repository into a single, AI-friendly file. Perfect for when you need to feed your codebase to Large Language Models (LLMs) or other AI tools like Claude, ChatGPT, and Gemini.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
English | ็ฎไฝไธญๆ
Repomix is a powerful tool that packs your entire repository into a single, AI-friendly file. It's perfect for when you need to feed your codebase to Large Language Models (LLMs) or other AI tools like Claude, ChatGPT, and Gemini.
The original Repomix is written in JavaScript, and this is the ported Python version.
--token-count-encoding).repomix src lib tests)..gitignore, .repomixignore, and .ignore files.detect-secrets).--exclude โ "Did you mean: --ignore?").--quiet.chardet) beyond UTF-8, increasing robustness.The easiest way to use Repomix is with uvx - no installation required:
uvx repomix
That's it! This will pack your current directory into an AI-friendly file.
More examples:
# Pack with JSON output
uvx repomix --style json
# Pack a remote repository
uvx repomix --remote https://github.com/username/repo
# Pack with specific patterns
uvx repomix --include "src/**/*.py" --ignore "tests/**"
# Use a specific version
uvx repomix@0.5.0
You can also use pipx: pipx run repomix
For frequent usage, you can install Repomix globally:
pip install repomix
Then run in any project directory:
repomix
You can also use Repomix with Docker without installing it locally:
# Build the Docker image
docker build -t repomix .
# Run repomix on the current directory
docker run --rm -v "$(pwd)":/app repomix
# Run repomix with specific options
docker run --rm -v "$(pwd)":/app repomix --style markdown --output custom-output.md
# Run repomix on a different directory
docker run --rm -v "/path/to/your/project":/app repomix
Docker Benefits:
That's it! Repomix will generate a repomix-output.md file (by default) 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 multiple directories at once:
repomix src lib tests
To pack a remote repository:
repomix --remote https://github.com/username/repo
To pack a specific branch of a remote repository:
repomix --remote https://github.com/username/repo --remote-branch feature-branch
To initialize a new configuration file:
repomix --init
# Use --global to create a global configuration file (see Configuration Options below)
repomix --init --global
Create a repomix.config.json file in your project root for custom configurations. Repomix also automatically loads a global configuration file if it exists (e.g., ~/.config/repomix/repomix.config.json on Linux), merging it with lower priority than local config and CLI options.
{
"input": {
"max_file_size": 52428800
},
"output": {
"file_path": "repomix-output.md",
"style": "markdown",
"header_text": "",
"instruction_file_path": "",
"remove_comments": false,
"remove_empty_lines": false,
"top_files_length": 5,
"show_line_numbers": false,
"copy_to_clipboard": false,
"include_empty_directories": false,
"calculate_tokens": false,
"show_file_stats": false,
"show_directory_structure": true,
"include_full_directory_structure": false,
"split_output": null,
"token_count_tree": false,
"git": {
"sort_by_changes": true,
"sort_by_changes_max_commits": 100,
"include_diffs": false,
"include_logs": false,
"include_logs_count": 50
}
},
"security": {
"enable_security_check": true,
"exclude_suspicious_files": true
},
"ignore": {
"custom_patterns": [],
"use_gitignore": true,
"use_default_ignore": true,
"use_dot_ignore": true
},
"compression": {
"enabled": false,
"keep_signatures": true,
"keep_docstrings": true,
"keep_interfaces": true
},
"remote": {
"url": "",
"branch": ""
},
"include": [],
"token_count": {
"encoding": "o200k_base"
}
}
[!NOTE] Note on
remove_comments: This feature is language-aware, correctly handling comment syntax for various languages rather than using a simple generic pattern. Supported languages: Python, JavaScript, TypeScript, JSX, TSX, Vue, Svelte, Java, C, C++, C#, Go, Rust, Ruby, PHP, Swift, Kotlin, HTML, CSS, XML, YAML
The remote section allows you to configure remote repository processing:
url: The URL of the remote Git repository to processbranch: The specific branch, tag, or commit hash to process (optional, defaults to repository's default branch)When a remote URL is specified in the configuration, Repomix will process the remote repository instead of the local directory. This can be overridden by CLI parameters (--remote-branch).
You can use various URL formats with --remote:
# GitHub shorthand
repomix --remote user/repo
# Full GitHub URL
repomix --remote https://github.com/user/repo
# Specific branch
repomix --remote https://github.com/user/repo --remote-branch feature-branch
# Specific tag
repomix --remote https://github.com/user/repo --remote-branch v1.0.0
# Specific commit
repomix --remote https://github.com/user/repo --remote-branch abc123
Command Line Options
repomix [directories...]: Target directories (defaults to current directory). Supports multiple directories.-v, --version: Show version.-o, --output <file>: Specify output file name.--style <style>: Specify output style (plain, xml, markdown, json).--remote <url>: Process a remote Git repository.--remote-branch <name>: Specify branch, tag, or commit for remote repository.--init: Initialize configuration file (repomix.config.json) in the current directory.--global: Use with --init to create/manage the global configuration file (located in a platform-specific user config directory, e.g., ~/.config/repomix on Linux). The global config is automatically loaded if present.--no-security-check: Disable security check.--include <patterns>: Comma-separated list of include patterns (glob format).-i, --ignore <patterns>: Additional comma-separated ignore patterns.-c, --config <path>: Path to a custom configuration file.--copy: Copy generated output to system clipboard.--top-files-len <number>: Max number of largest files to display in summary.--output-show-line-numbers: Add line numbers to output code blocks.--stdin: Read file paths from standard input (one per line) instead of discovering files automatically.--verbose: Enable verbose logging for debugging.--quiet: Suppress all console output except errors. Cannot be used with --verbose.--parsable-style: By escaping and formatting, ensure the output is parsable as a document of its type.--stdout: Output to stdout instead of writing to a file.--remove-comments: Remove comments from source code.--remove-empty-lines: Remove empty lines from source code.--truncate-base64: Enable truncation of base64 data strings.--include-empty-directories: Include empty directories in the output.--include-diffs: Include git diffs in the output.--include-logs: Include git log history in the output.Repomix includes built-in security checks using the detect-secrets library to detect potentially sensitive information (API keys, credentials, etc.). By default (exclude_suspicious_files: true), detected files are excluded from the output.
Disable checks via configuration or CLI:
repomix --no-security-check
You can add custom instructions to the output file that will guide AI tools on how to interpret and use the packed codebase.
Create a markdown file (e.g., repomix-instruction.md) with your instructions:
## Project Context
This is a Python web application using FastAPI.
Please follow PEP 8 conventions when suggesting code changes.
Then specify the path via CLI or configuration:
# Via CLI
repomix --instruction-file-path repomix-instruction.md
# Via configuration (repomix.config.json)
{
"output": {
"instruction_file_path": "repomix-instruction.md"
}
}
The instruction content will be included in the "Instruction" section of the output file.
Repomix provides token counting to help you understan
--include-logs-count <count>--include-logs--sort-by-changes: Sort files by git change frequency (most changed first).--no-file-summary: Omit the file summary section from output.--no-directory-structure: Omit the directory tree visualization from output.--no-files: Generate metadata only without file contents.--no-gitignore: Don't use .gitignore rules for filtering files.--no-dot-ignore: Don't use .ignore rules for filtering files.--no-default-patterns: Don't apply built-in ignore patterns.--no-git-sort-by-changes: Don't sort files by git change frequency.--include-full-directory-structure: Show entire repository tree even when using --include patterns.--token-count-encoding <encoding>: Tokenizer encoding for counting (e.g., o200k_base for GPT-4o, cl100k_base for GPT-3.5/4).--token-count-tree [threshold]: Show file tree with token counts; optional threshold to show only files with โฅN tokens.--split-output <size>: Split output into multiple numbered files (e.g., 500kb, 2mb).--header-text <text>: Custom text to include at the beginning of the output.--instruction-file-path <path>: Path to file containing custom instructions to include in output.--compress: Enable tree-sitter based code compression.--skill-generate [name]: Generate Claude Agent Skills format output to .claude/skills/<name>/ directory.--skill-output <path>: Specify skill output directory path directly.-f, --force: Skip all confirmation prompts (currently: skill directory overwrite).