Skip to content

Repomix

A command-line tool that packs a whole code repository into one AI-friendly file.

Stars
29.1k
Forks
1.6k
Licence
MIT
Language
TypeScript
Last update
5 days ago
Type
CLI

What it is

Repomix scans a project folder and combines all of its files into a single output file, such as XML, Markdown, or plain text. People use it to give an AI assistant like ChatGPT or Claude the full context of a codebase at once. It respects .gitignore files, can count tokens per file, and uses Secretlint to leave out files that look like they contain credentials.

  • Pack a project into repomix-output.xml and send it to an AI assistant with a refactoring request
  • Check token counts for each file to see which parts of a repo are too large for a model
  • Use the --compress option to shrink the output while keeping code structure
  • Use the repomix.com website or Chrome/Firefox extension to pack a public GitHub repository without installing the CLI

Great for

  • Developers who want to ask an AI assistant questions about a whole project
  • People preparing a codebase for an LLM with a limited context window who need token counts
  • Teams that want to review or refactor code with an AI tool using one file as input
  • Users who prefer not to install anything by running it with npx

Not ideal for

  • Projects that are too large to fit in an AI model's context window, since the single file may exceed it
  • Anyone who needs guaranteed secret removal, because it relies on Secretlint pattern matching for known credential formats
  • Non-technical users who are uncomfortable using a terminal, unless they use the website or browser extension instead
Step-by-step guide: how to use RepomixInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: Node.js

    Run without installing

    npx repomix@latest

    Install globally with npm

    npm install -g repomix

    Install with Homebrew (macOS/Linux)

    brew install repomix
  2. 2

    Run it

    • Open a terminal in your project directory.
    • Run `repomix` (or `npx repomix@latest` if you did not install it).
    • Find the generated repomix-output.xml file in the current directory.
    • Upload or paste that file into an AI assistant along with your question.
  3. 3

    Get the most out of it

    • Use the --compress option to reduce token count while preserving code structure, using Tree-sitter.
    • Add a .repomixignore file to exclude files you do not want in the output.
    • Use a repomix.config.json file to set include and exclude rules; the VSCode extension also reads it.
    • Try the website at repomix.com to pack a repository without installing anything.

Downloads

Strengths

  • Simple to start: one command, and it can run without installation via npx
  • Respects .gitignore, .ignore, and .repomixignore files and offers configurable include and exclude rules
  • Provides token counts and multiple output formats (XML, Markdown, plain text)

Trade-offs

  • A large repository packed into one file can exceed an AI model's context limit
  • Secret detection depends on Secretlint's known formats, so it cannot guarantee that no sensitive data is included
  • The README is truncated, so some setup details and options may be missing from this summary

How it compares

ProjectStarsTypeLevelUpdatedBest for
repomix (this)29.1kCLIbeginner5 days agoDevelopers who want to ask an AI assistant questions about a whole project
gitingest16.1kDev toolbeginner4 days agoDevelopers who want to give an AI assistant context about a codebase
OpenHands92.5kAppintermediate4 days agoDevelopers who want coding agents running on a server while their laptop is off
botpress15kDev toolintermediate7 days agoDevelopers who want to write integrations and bots as TypeScript code using the Botpress CLI and SDK
generative-ai-for-beginners123kLearning resourcebeginner5 days agoDevelopers who know some Python or TypeScript and want a guided introduction to generative AI
one-api37.3kAppintermediate10 months agoDevelopers who want one OpenAI-compatible endpoint for several model providers

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.