Scripts2026年4月2日·1 分钟阅读

Repomix — Pack Any Repo into One AI-Ready File

Packs your entire codebase into a single AI-friendly file with token counting, security scanning, and multiple output formats. Perfect for LLM context.

TO
TokRepo精选 · Community
快速使用

先拿来用,再决定要不要深挖

这里应该同时让用户和 Agent 知道第一步该复制什么、安装什么、落到哪里。

```bash # No install needed — run directly with npx npx repomix@latest # Or install globally npm install -g repomix # Pack a remote GitHub repo npx repomix --remote https://github.com/user/repo # Output as Markdown with token count npx repomix --output repomix-output.md --style markdown ```
## Introduction Repomix is a developer tool that **packs your entire repository into a single, AI-optimized file**. When you need to give an LLM full context of your codebase — for code review, architecture questions, or migration planning — Repomix creates a structured document that fits within context windows. Key features: - **AI-Optimized Output** — Structured formatting designed specifically for LLM comprehension (XML, Markdown, JSON, or plain text) - **Token Counting** — Shows exact token count per file and total, so you know what fits in your context window - **Git-Aware** — Respects `.gitignore` and supports custom include/exclude patterns - **Security Scanning** — Built-in Secretlint integration detects API keys, passwords, and secrets before you paste into an LLM - **Remote Repos** — Pack any public GitHub repo without cloning: `npx repomix --remote user/repo` - **MCP Server** — Also available as an MCP server for direct AI assistant integration Works great as a preprocessing step before feeding code to Claude, GPT, or any LLM. ## FAQ **Q: How large of a repo can it handle?** A: Repomix can process repos with thousands of files. Use `--include` and `--exclude` patterns to focus on relevant directories if the output exceeds your LLM's context window. **Q: What output format should I use?** A: XML format (`--style xml`) is recommended for Claude as it parses XML structure well. Markdown works great for readability. **Q: Does it leak secrets?** A: Repomix includes built-in security scanning via Secretlint. It warns you if API keys, tokens, or passwords are detected in the output. **Q: Can I use it as an MCP server?** A: Yes. Add `repomix` as an MCP server in your config to let AI assistants pack repos on demand. ## Works With - Claude Code / Claude Desktop / ChatGPT / Any LLM - npm / npx / Homebrew (`brew install repomix`) - MCP-compatible AI assistants (via built-in MCP server) - Any Git repository (local or remote)
🙏

来源与感谢

- GitHub: [yamadashy/repomix](https://github.com/yamadashy/repomix) - License: MIT - Stars: 22,000+ - Maintainer: @yamadashy Thanks to @yamadashy for creating the most popular repo-to-LLM tool, solving the "how do I give my AI the full codebase" problem elegantly.

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产