repomix
📦 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
open-sourcetool-integration
22.7k
Stars
+398
Stars/month
10
Releases (6m)
Star Growth
+107 (0.5%)
Overview
Repomix 是一个专门设计的工具,用于将整个代码仓库打包成单个 AI 友好的文件格式。该工具的核心价值在于为大型语言模型(LLMs)和其他 AI 工具提供结构化的代码库输入,使得 AI 能够更好地理解和分析整个项目。Repomix 拥有超过 22,000 个 GitHub 星标,证明了其在开发者社区中的受欢迎程度。工具提供了在线版本(repomix.com)和 npm 包两种使用方式,支持灵活的配置选项来处理不同规模和类型的项目。无论是进行代码审查、生成文档,还是寻求 AI 助手的代码建议,Repomix 都能将复杂的多文件项目转换为 AI 可以高效处理的统一格式。
Deep Analysis
Key Differentiator
Purpose-built codebase-to-LLM converter with token counting and security scanning — unlike generic file concatenation, optimized specifically for AI consumption with compression
⚡ Capabilities
- • Pack entire codebases into single AI-friendly files
- • Token counting for LLM context limit management
- • Multiple output formats (XML, Markdown, Plain Text)
- • Git-aware with .gitignore respect
- • Security scanning via Secretlint
- • Code compression with Tree-sitter
- • Remote repository support
- • Browser extension and VS Code extension
🔗 Integrations
GitHubChrome ExtensionFirefox Add-onVS CodeTree-sitterSecretlint
✓ Best For
- ✓ Feeding entire codebases to LLMs for analysis or refactoring
- ✓ Preparing repository context for AI coding assistants
✗ Not Ideal For
- ✗ Ongoing code editing (use IDE extensions instead)
- ✗ Non-code file processing
Languages
TypeScript
Deployment
npxnpm install -gHomebrewWeb app (repomix.com)
Pricing Detail
Free: Completely free and open-source
Paid: No paid tier
⚠ Known Limitations
- ⚠ Output size limited by target LLM context window
- ⚠ Large repos may produce files too big for most LLMs
- ⚠ No incremental/diff-based output
- ⚠ Security scanning is basic (Secretlint only)
Pros
- + 专为 AI 优化的文件格式,确保 LLMs 能够有效理解和处理代码库结构
- + 提供多种使用方式,包括便捷的在线版本和本地 npm 包安装
- + 活跃的社区支持,拥有 Discord 频道和持续更新的开发维护
Cons
- - 大型代码库可能生成体积很大的输出文件,可能超出某些 AI 工具的输入限制
- - 复杂项目结构可能需要详细配置才能获得最佳的打包效果
Use Cases
- • 将代码库提供给 ChatGPT、Claude 等 AI 助手进行代码审查和优化建议
- • 为 AI 工具生成项目文档、API 文档或代码解释
- • 在代码迁移或重构项目时,让 AI 分析整体架构和依赖关系
Getting Started
1. 通过 npm install -g repomix 安装命令行工具,或直接访问 repomix.com 使用在线版本;2. 在项目根目录创建 .repomixignore 文件配置需要排除的文件和目录;3. 运行 repomix 命令生成 AI 友好的代码库文件,然后将输出提供给你选择的 AI 工具