AI Skill Hub 强烈推荐:Repomix仓库打包工具 是一款优质的MCP工具。在 GitHub 上收获超过 24.9k 颗 Star,AI 综合评分 8.5 分,在同类工具中表现稳健。如果你正在寻找可靠的MCP工具解决方案,这是一个值得深入了解的选择。
将整个代码仓库打包成单一文件的强大工具,支持MCP协议,便于将项目上下文发送给AI模型。适合开发者、AI工程师快速共享项目信息,提高AI辅助编程效率。
Repomix仓库打包工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
将整个代码仓库打包成单一文件的强大工具,支持MCP协议,便于将项目上下文发送给AI模型。适合开发者、AI工程师快速共享项目信息,提高AI辅助编程效率。
Repomix仓库打包工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/yamadashy/repomix
# 方式二:手动配置 claude_desktop_config.json
{
"mcpServers": {
"repomix------": {
"command": "npx",
"args": ["-y", "repomix"]
}
}
}
# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
# 安装后在 Claude 对话中直接使用 # 示例: 用户: 请帮我用 Repomix仓库打包工具 执行以下任务... Claude: [自动调用 Repomix仓库打包工具 MCP 工具处理请求] # 查看可用工具列表 # 在 Claude 中输入:"列出所有可用的 MCP 工具"
// claude_desktop_config.json 配置示例
{
"mcpServers": {
"repomix______": {
"command": "npx",
"args": ["-y", "repomix"],
"env": {
// "API_KEY": "your-api-key-here"
}
}
}
}
// 保存后重启 Claude Desktop 生效
repomix --skill-generate --skill-project-name "My Project"
.gitignore, .ignore, and .repomixignore files.--compress option uses Tree-sitter to extract key code elements, reducing token count while preserving structure.npm install -g repomix
You can also run Repomix using Docker. This is useful if you want to run Repomix in an isolated environment or prefer using containers.
Basic usage (current directory):
docker run -v .:/app -it --rm ghcr.io/yamadashy/repomix
To pack a specific directory:
docker run -v .:/app -it --rm ghcr.io/yamadashy/repomix path/to/directory
Process a remote repository and output to a output directory:
docker run -v ./output:/app -it --rm ghcr.io/yamadashy/repomix --remote https://github.com/yamadashy/repomix
/plugin install repomix-mcp@repomix
/plugin install repomix-commands@repomix
/plugin install repomix-explorer@repomix
**Note**: The `repomix-mcp` plugin is recommended as a foundation. The `repomix-commands` plugin provides convenient slash commands, while `repomix-explorer` adds AI-powered analysis capabilities. While you can install them independently, using all three provides the most comprehensive experience.
**Alternatively, use the interactive plugin installer:**
text /plugin
This will open an interactive interface where you can browse and install available plugins.
#### Available Plugins
**1. repomix-mcp** (MCP Server Plugin)
Foundation plugin that provides AI-powered codebase analysis through MCP server integration.
**Features:**
- Pack local and remote repositories
- Read and search packed outputs
- Automatic Tree-sitter compression (~70% token reduction)
**2. repomix-commands** (Slash Commands Plugin)
Provides convenient slash commands for quick operations with natural language support.
**Available Commands:**
- `/repomix-commands:pack-local` - Pack local codebase with various options
- `/repomix-commands:pack-remote` - Pack and analyze remote GitHub repositories
**Example usage:**text /repomix-commands:pack-local Pack this project as markdown with compression
/repomix-commands:pack-remote yamadashy/repomix Pack only TypeScript files from the yamadashy/repomix repository
**3. repomix-explorer** (AI Analysis Agent Plugin)
AI-powered repository analysis agent that intelligently explores codebases using Repomix CLI.
**Features:**
- Natural language codebase exploration and analysis
- Intelligent pattern discovery and code structure understanding
- Incremental analysis using grep and targeted file reading
- Automatic context management for large repositories
**Available Commands:**
- `/repomix-explorer:explore-local` - Analyze local codebase with AI assistance
- `/repomix-explorer:explore-remote` - Analyze remote GitHub repositories with AI assistance
**Example usage:**text /repomix-explorer:explore-local ./src Find all authentication-related code
/repomix-explorer:explore-remote facebook/react Show me the main component architecture ```
The agent automatically: 1. Runs npx repomix@latest to pack the repository 2. Uses Grep and Read tools to efficiently search the output 3. Provides comprehensive analysis without consuming excessive context
npx repomix@latest for up-to-date featuresFor more details, see the plugin documentation in the .claude/plugins/ directory.
To pack your entire repository:
repomix
To pack a specific directory:
repomix path/to/directory
To pack specific files or directories using glob patterns:
repomix --include "src/**/*.ts,**/*.md"
To exclude specific files or directories:
repomix --ignore "**/*.log,tmp/"
To pack a remote repository:
```bash repomix --remote https://github.com/yamadashy/repomix
Once you have generated the packed file with Repomix, you can use it with AI tools like ChatGPT, DeepSeek, Perplexity, Gemini, Gemma, Llama, Grok, and more. Here are some example prompts to get you started:
For a comprehensive code review and refactoring suggestions:
This file contains my entire codebase. Please review the overall structure and suggest any improvements or refactoring opportunities, focusing on maintainability and scalability.
To generate project documentation:
Based on the codebase in this file, please generate a detailed README.md that includes an overview of the project, its main features, setup instructions, and usage examples.
For generating test cases:
Analyze the code in this file and suggest a comprehensive set of unit tests for the main functions and classes. Include edge cases and potential error scenarios.
Evaluate code quality and adherence to best practices:
Review the codebase for adherence to coding best practices and industry standards. Identify areas where the code could be improved in terms of readability, maintainability, and efficiency. Suggest specific changes to align the code with best practices.
Get a high-level understanding of the library
This file contains the entire codebase of library. Please provide a comprehensive overview of the library, including its main purpose, key features, and overall architecture.
Feel free to modify these prompts based on your specific needs and the capabilities of the AI tool you're using.
repomix
repomix --stdout | llm "Please explain what this code does."
repomix --remote user/repo --skill-generate my-skill --skill-output ./output --force
#### Generated Structure
The Skills are generated with the following structure:
text .claude/skills/<skill-name>/ ├── SKILL.md # Main Skills metadata & documentation └── references/ ├── summary.md # Purpose, format, and statistics ├── project-structure.md # Directory tree with line counts ├── files.md # All file contents (grep-friendly) └── tech-stacks.md # Languages, frameworks, dependencies
#### What's Included
- **SKILL.md**: Contains Skills metadata, file/line/token counts, overview, and usage instructions
- **summary.md**: Explains the Skills' purpose, usage guidelines, and provides statistics breakdown by file type and language
- **project-structure.md**: Directory tree with line counts per file for easy file discovery
- **files.md**: All file contents with syntax highlighting headers, optimized for grep-friendly searching
- **tech-stacks.md**: Auto-detected tech stack per package from dependency files (`package.json`, `requirements.txt`, `Cargo.toml`, etc.)
#### Auto-Generated Skills Names
If no name is provided, Repomix auto-generates one:
bash repomix src/ --skill-generate # → repomix-reference-src repomix --remote user/repo --skill-generate # → repomix-reference-repo repomix --skill-generate CustomName # → custom-name (normalized to kebab-case)
#### Integration with Repomix Features
Skills generation respects all standard Repomix options:
bash
#### Basic Options - -v, --version: Show version information and exit
| Option | Description |
|---|---|
--verbose | Enable detailed debug logging (shows file processing, token counts, and configuration details) |
--quiet | Suppress all console output except errors (useful for scripting) |
--stdout | Write packed output directly to stdout instead of a file (suppresses all logging) |
--stdin | Read file paths from stdin, one per line (specified files are processed directly) |
--copy | Copy the generated output to system clipboard after processing |
--token-count-tree [threshold] | Show file tree with token counts; optional threshold to show only files with ≥N tokens (e.g., --token-count-tree 100) |
--top-files-len <number> | Number of largest files to show in summary (default: 5) |
| Option | Description |
|---|---|
-o, --output <file> | Output file path (default: repomix-output.xml, use "-" for stdout) |
--style <style> | Output format: xml, markdown, json, or plain (default: xml) |
--output-file-path-style <style> | How file paths are shown in output: target-relative or cwd-relative (default: target-relative) |
--parsable-style | Escape special characters to ensure valid XML/Markdown (needed when output contains code that breaks formatting) |
--compress | Extract essential code structure (classes, functions, interfaces) using Tree-sitter parsing |
--output-show-line-numbers | Prefix each line with its line number in the output |
--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 (useful for repository analysis) |
--remove-comments | Strip all code comments before packing |
--remove-empty-lines | Remove blank lines from all files |
--truncate-base64 | Truncate long base64 data strings to reduce output size |
--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 |
--split-output <size> | Split output into multiple numbered files (e.g., repomix-output.1.xml); size like 500kb, 2mb, or 1.5mb |
--include-empty-directories | Include folders with no files in directory structure |
--include-full-directory-structure | Show complete directory tree in output, including files not matched by --include patterns |
--no-git-sort-by-changes | Don't sort files by git change frequency (default: most changed files first) |
--include-diffs | Add git diff section showing working tree and staged changes |
--include-logs | Add git commit history with messages and changed files |
--include-logs-count <count> | Number of recent commits to include with --include-logs (default: 50) |
| Option | Description |
|---|---|
--include <patterns> | Include only files matching these glob patterns (comma-separated, e.g., "src/**/*.js,*.md") |
-i, --ignore <patterns> | Additional patterns to exclude (comma-separated, e.g., "*.test.js,docs/**") |
--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 (node_modules, .git, build dirs, etc.) |
| Option | Description |
|---|---|
--remote <url> | Clone and pack a remote repository (GitHub URL or user/repo format) |
--remote-branch <name> | Specific branch, tag, or commit to use (default: repository's default branch) |
--remote-trust-config | Trust and load config files from remote repositories (disabled by default for security). On an interactive terminal, the config is shown and you are asked to confirm |
| Option | Description |
|---|---|
-c, --config <path> | Use custom config file instead of repomix.config.json |
--init | Create a new repomix.config.json file with defaults |
--global | With --init, create config in home directory instead of current directory |
#### Security Options - --no-security-check: Skip scanning for sensitive data like API keys and passwords
#### Token Count Options - --token-count-encoding <encoding>: Tokenizer model for counting: o200k_base (GPT-4o), cl100k_base (GPT-3.5/4), etc. (default: o200k_base) - --token-budget <number>: Fail with a non-zero exit code when the packed output exceeds N tokens. Useful as a guard in CI pipelines and agent workflows to keep output within a target model's context window. The output is still generated; only the exit code signals the overflow.
#### MCP - --mcp: Run as Model Context Protocol server for AI tool integration - --sandbox [dir]: (with --mcp) confine the MCP server's file tools to a workspace directory (defaults to the working directory; e.g. --sandbox path/to/project) — every path is relative to that root, absolute/host paths are refused, and remote packing, skill generation, and attaching external outputs are disabled.
| Option | Description |
|---|---|
--skill-generate [name] | Generate Claude Agent Skills format output to .claude/skills/<name>/ directory (name auto-generated if omitted) |
--skill-project-name <name> | Override the project name used in generated Skills descriptions |
--skill-output <path> | Specify skill output directory path directly (skips location prompt) |
-f, --force | Skip all confirmation prompts (skill directory overwrite, remote config trust) |
#### Watch Mode - -w, --watch: Watch for file changes and automatically re-pack. Debounces rapid changes (300ms) and logs a timestamp on each rebuild. Stop with Ctrl+C.
Watch mode only works with local directories, so it cannot be combined with --remote, a positional remote repository URL, --stdout, --stdin, --split-output, --skill-generate, or --copy (whether set on the command line or in your config file).
```bash
repomix --remote https://github.com/yamadashy/repomix --remote-branch main
repomix --remote https://github.com/yamadashy/repomix --remote-branch 935b695
Repomix supports multiple configuration file formats for flexibility and ease of use.
Repomix will automatically search for configuration files in the following priority order:
repomix.config.ts, repomix.config.mts, repomix.config.cts)repomix.config.js, repomix.config.mjs, repomix.config.cjs)repomix.config.json5, repomix.config.jsonc, repomix.config.json)Create a repomix.config.json file in your project root:
repomix --init
This will create a repomix.config.json file with default settings.
TypeScript configuration files provide the best developer experience with full type checking and IDE support.
Installation:
To use TypeScript or JavaScript configuration with defineConfig, you need to install Repomix as a dev dependency:
npm install -D repomix
Example:
// repomix.config.ts
import { defineConfig } from 'repomix';
export default defineConfig({
output: {
filePath: 'output.xml',
style: 'xml',
removeComments: true,
},
ignore: {
customPatterns: ['**/node_modules/**', '**/dist/**'],
},
});
Benefits: - ✅ Full TypeScript type checking in your IDE - ✅ Excellent IDE autocomplete and IntelliSense - ✅ Use dynamic values (timestamps, environment variables, etc.)
Dynamic Values Example:
// repomix.config.ts
import { defineConfig } from 'repomix';
// Generate timestamp-based filename
const timestamp = new Date().toISOString().slice(0, 19).replace(/[:.]/g, '-');
export default defineConfig({
output: {
filePath: `output-${timestamp}.xml`,
style: 'xml',
},
});
JavaScript configuration files work the same as TypeScript, supporting defineConfig and dynamic values.
Here's an explanation of the configuration options:
| Option | Description | Default |
|---|---|---|
input.maxFileSize | Maximum file size in bytes to process. Files larger than this will be skipped | 50000000 |
input.processors | Ordered array of { pattern, command, timeout?, onError? } entries that run an external command to transform matching files before packing (e.g. JSON→TOON). First matching glob wins. Runs arbitrary commands, so it runs only for local CLI runs (and remote repos with --remote-trust-config). See [File Processors](#file-processors) | Not set |
output.filePath | The name of the output file | "repomix-output.xml" |
output.style | The style of the output (xml, markdown, json, plain) | "xml" |
output.filePathStyle | How file paths are shown in output (target-relative keeps paths relative to each target root, cwd-relative keeps paths relative to the current working directory) | "target-relative" |
output.parsableStyle | Whether to escape the output based on the chosen style schema. Note that this can increase token count. | false |
output.compress | Whether to perform intelligent code extraction to reduce token count | false |
output.patterns | Per-file inclusion levels. An ordered array of { pattern, compress?, directoryStructureOnly? } entries; the first matching glob wins and overrides the global output.compress for that file. See [Per-file Inclusion Levels](#per-file-inclusion-levels-outputpatterns) | Not set |
output.headerText | Custom text to include in the file header | null |
output.instructionFilePath | Path to a file containing detailed custom instructions | null |
output.fileSummary | Whether to include a summary section at the beginning of the output | true |
output.directoryStructure | Whether to include the directory structure in the output | true |
output.files | Whether to include file contents in the output | true |
output.removeComments | Whether to remove comments from supported file types | false |
output.removeEmptyLines | Whether to remove empty lines from the output | false |
output.showLineNumbers | Whether to add line numbers
You can try Repomix instantly in your project directory without installation:
npx repomix@latest
Or install globally for repeated use:
```bash
Get instant access to Repomix directly from any GitHub repository! Our Chrome extension adds a convenient "Repomix" button to GitHub repository pages.

#### Install - Chrome Extension: Repomix - Chrome Web Store - Firefox Add-on: Repomix - Firefox Add-ons
#### Features - One-click access to Repomix for any GitHub repository - More exciting features coming soon!
A community-maintained VSCode extension called Repomix Runner (created by massdo) lets you run Repomix right inside your editor with just a few clicks. Run it on any folder, manage outputs seamlessly, and control everything through VSCode's intuitive interface.
Want your output as a file or just the content? Need automatic cleanup? This extension has you covered. Plus, it works smoothly with your existing repomix.config.json.
Try it now on the VSCode Marketplace! Source code is available on GitHub.
cat repomix-output.json | jq -r '.files | keys[] | select(endswith(".ts"))'
Repomix supports the Model Context Protocol (MCP), allowing AI assistants to directly interact with your codebase. When run as an MCP server, Repomix provides tools that enable AI assistants to package local or remote repositories for analysis without requiring manual file preparation.
repomix --mcp
By default the MCP server can read any path the host user can. That is convenient for a trusted local assistant, but too broad when the server is exposed to an untrusted client or agent. The --sandbox flag confines the server's file tools to a single workspace directory:
```bash
Repomix provides official plugins for Claude Code that integrate seamlessly with the AI-powered development environment.
1. Add the Repomix plugin marketplace:
/plugin marketplace add yamadashy/repomix
2. Install plugins:
```text
yarn global add repomix
bun add -g repomix
brew install repomix
If you're using Python, you might want to check out Gitingest, which is better suited for Python ecosystem and data science workflows: https://github.com/cyclotruc/gitingest
Repomix 是一个用于优化代码仓库的工具,特别适合于 AI 的理解和处理。它可以格式化代码以便于 AI 处理,并提供 token 计数等功能。
Repomix 的功能包括 AI 优化、token 计数、简单易用的界面、可定制的配置和 Git 感知等。
可以使用 npm 安装 Repomix,或者使用 Docker 运行 Repomix。在 Docker 中,使用 `docker run` 命令即可启动 Repomix。还可以使用 MCP 服务器插件来安装 Repomix。
使用 Repomix 的方法包括:使用 `repomix` 命令来打包整个代码仓库,使用 `repomix path/to/directory` 命令来打包特定目录,使用 `repomix --include` 和 `repomix --ignore` 命令来指定打包和忽略的文件或目录。
Repomix 的配置包括基本选项(如版本信息和调试日志),CLI 输入/输出选项(如详细调试日志和静默模式),以及使用 `--remote-branch` 选项来指定远程分支的方法。
Repomix 可以使用 CLI 工具 `npx` 来直接在项目目录中使用,无需安装。还可以使用 Docker 来运行 Repomix。
Repomix 可以与 GitHub 的浏览器扩展和 VSCode 扩展结合使用。还可以使用 MCP 服务器插件来安装 Repomix。
高质量MCP工具,解决了AI工程中常见的项目上下文传递问题。设计简洁实用,社区活跃度高,是AI开发者的必备工具。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
总体来看,Repomix仓库打包工具 是一款质量优秀的MCP工具,在同类工具中具备一定竞争力。AI Skill Hub 将持续追踪其更新动态,建议收藏备用,结合自身场景选择合适时机引入使用。
| 原始名称 | repomix |
| 原始描述 | 开源MCP工具:📦 Repomix is a powerful tool that packs your entire repository into a single, A。⭐24.9k · TypeScript |
| Topics | 代码仓库文件打包AI工程MCP协议上下文管理 |
| GitHub | https://github.com/yamadashy/repomix |
| License | MIT |
| 语言 | TypeScript |
收录时间:2026-05-16 · 更新时间:2026-05-19 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端