# Repomix — Pack Any Repo into LLM-Ready Context
> CLI tool that packs an entire repository into a single AI-friendly text file optimized for LLM context windows. Supports token counting, .gitignore, and custom filtering. 8,000+ stars.
## Install
Save as a script file and run:
## Quick Use
```bash
# Install
npm install -g repomix
# Pack current directory
repomix
# Pack with options
repomix --output context.txt --include "src/**/*.ts" --style xml
```
Output is a single file ready to paste into any LLM chat.
---
## Intro
Repomix is a CLI tool that packs an entire code repository into a single, AI-friendly text file optimized for LLM context windows with 8,000+ GitHub stars. It respects .gitignore, counts tokens, supports multiple output formats (plain text, XML, Markdown), and lets you filter by file patterns. Instead of manually copying files one by one into ChatGPT or Claude, run `repomix` once and get a perfectly formatted context dump. Best for developers who need to give LLMs full project context for code review, refactoring, or architecture discussions. Works with: any LLM (Claude, GPT-4, Gemini). Setup time: under 1 minute.
---
## Output Formats
### Plain Text (default)
```bash
repomix --style plain
```
### XML (best for Claude)
```bash
repomix --style xml
```
Output:
```xml
export function login(credentials: Credentials) {
// ...
}
// ...
```
### Markdown
```bash
repomix --style markdown
```
## Advanced Usage
### Filter Files
```bash
# Only TypeScript files in src/
repomix --include "src/**/*.ts"
# Exclude tests
repomix --exclude "**/*.test.ts,**/*.spec.ts"
# Only specific directories
repomix --include "src/auth/**,src/api/**"
```
### Token Counting
```bash
repomix --token-count
# Output: Total tokens: 45,231 (cl100k_base)
```
### Remote Repos
```bash
# Pack a GitHub repo directly
repomix --remote https://github.com/user/repo
```
### Configuration File
Create `repomix.config.json`:
```json
{
"output": {
"filePath": "context.txt",
"style": "xml"
},
"include": ["src/**/*.ts", "src/**/*.tsx"],
"ignore": {
"customPatterns": ["*.test.ts", "*.spec.ts", "dist/**"]
}
}
```
### Key Stats
- 8,000+ GitHub stars
- 3 output formats (plain, XML, markdown)
- Token counting built-in
- .gitignore aware
- Remote repo support
### FAQ
**Q: What is Repomix?**
A: Repomix is a CLI tool that packs a code repository into a single text file optimized for LLM context windows, with token counting and customizable filtering.
**Q: Is Repomix free?**
A: Yes, fully open-source under MIT license.
**Q: Which output format is best for Claude?**
A: XML format works best with Claude, as it uses XML tags to clearly delineate file boundaries.
---
## Source & Thanks
> Created by [Yamadashy](https://github.com/yamadashy). Licensed under MIT.
>
> [repomix](https://github.com/yamadashy/repomix) — ⭐ 8,000+
Thanks for solving the "how do I give the LLM my whole project" problem.
---
## 快速使用
```bash
npm install -g repomix
repomix # 打包当前目录为一个 LLM 可用的文本文件
```
---
## 简介
Repomix 是一个 CLI 工具,将整个代码仓库打包成单个 AI 友好的文本文件,GitHub 8,000+ stars。支持 token 计数、.gitignore 过滤、多种输出格式(纯文本、XML、Markdown)。适合需要给 LLM 提供完整项目上下文的代码审查、重构或架构讨论。
---
## 来源与感谢
> Created by [Yamadashy](https://github.com/yamadashy). Licensed under MIT.
>
> [repomix](https://github.com/yamadashy/repomix) — ⭐ 8,000+
---
Source: https://tokrepo.com/en/workflows/259d2d70-d4e5-4bae-9205-035c101e26f3
Author: Script Depot