# 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. ## Install Save as a script file and run: # Repomix — Pack Any Repo into One AI-Ready File ## Quick Use ```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) ## Source & Thanks - 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. --- Source: https://tokrepo.com/en/workflows/d659a8be-dc16-40f4-853f-14e6ae758a27 Author: TokRepo精选