# Repomix

> Pack your whole codebase into a single AI-friendly file

- Category: Retrieval & Knowledge (RAG) / Parsing & Ingestion
- Language: TypeScript
- Licence: MIT
- Repository: https://github.com/yamadashy/repomix
- Website: https://repomix.com
- Canonical page: https://ai-tldr.dev/tools/repomix/

## In short

Repomix is an open-source command-line tool that bundles your entire repository into a single file built for AI tools. Instead of copying files one by one into a chat, you run one command and get an output file you can paste or upload to an LLM. It sits in the Parsing & Ingestion category of the Retrieval & Knowledge (RAG) tools and is open-source, written in TypeScript and licensed MIT.

## Overview

Repomix is an open-source command-line tool that bundles your entire repository into a single file built for AI tools. Instead of copying files one by one into a chat, you run one command and get an output file you can paste or upload to an LLM.

The packed output is formatted so models like Claude, ChatGPT, DeepSeek, Perplexity, Gemini, and Llama can read it easily. Repomix counts tokens for each file and the whole repo, respects your .gitignore rules, and can run security checks to keep secrets out of the output.

## What it does

- Packs a full repository into one AI-optimized file with a single command
- Reports token counts per file and for the whole repo to help you stay within LLM context limits
- Git-aware: automatically respects .gitignore, .ignore, and .repomixignore files
- Security checks via Secretlint to detect and block sensitive information in the output
- Code compression with the --compress option, using Tree-sitter to keep key structure while cutting tokens
- Works on local folders or remote repositories with --remote, including a browser, website, and Docker option

## Getting started

You can run Repomix instantly with npx, or install it globally for repeated use. It generates a repomix-output.xml file you can hand to an AI assistant.

1. Run it instantly with npx

   From inside your project directory, run Repomix with no install needed. It creates a repomix-output.xml file containing your whole repository.

```bash
npx repomix@latest
```

2. Or install it globally

   Install once with your preferred package manager, then run the repomix command in any project directory.

```bash
npm install -g repomix
# or: yarn global add repomix
# or: bun add -g repomix
# or: brew install repomix

repomix
```

3. Pick files and compress output

   Use glob patterns to include or exclude paths, and the --compress option to reduce token count while keeping code structure.

```bash
repomix --include "src/**/*.ts,**/*.md"
repomix --ignore "**/*.log,tmp/"
repomix --compress
```

4. Pack a remote repository

   Point Repomix at a remote repo with --remote, using a full URL or GitHub shorthand, and optionally a branch, tag, or commit.

```bash
repomix --remote yamadashy/repomix
repomix --remote https://github.com/yamadashy/repomix --remote-branch main
```

## When to use it

- Feed your entire codebase to an AI assistant for a code review or refactoring suggestions
- Generate a detailed README or other documentation from the full project context
- Get a high-level overview or architecture summary of an unfamiliar library or repository
- Stay within an LLM's context window by checking token counts and compressing the packed output
