Repomix logo

Repomix

Free

Pack your codebase into AI-friendly formats. [#opensource](https://github.com/yamadashy/repomix)

FreeFree tier
Type
Open Source

About Repomix

Repomix is a powerful, open-source command-line tool that packages an entire codebase into a single AI-friendly file (XML, Markdown, or Plain). It is designed to provide complete repository context to AI assistants like ChatGPT, Claude, Gemini, and Grok without requiring subscription-specific integrations. Key capabilities include AI-optimized formatting, automatic .gitignore awareness, built-in security checks via Secretlint, token counting per file and for the whole repository, and options to compress code using Tree-sitter, remove comments, and remove empty lines. Repomix can be used instantly via npx, or installed globally via npm, yarn, bun, or Homebrew. It enables use cases such as code review, refactoring, bug investigation, third-party library security analysis, and documentation generation.

Key Features

AI-optimized output formats (XML, Markdown, Plain) for easy LLM consumption
Git-aware – automatically respects .gitignore files
Security-focused – integrates Secretlint to detect sensitive information
Token counting for each file and the entire repository
CLI tool usable instantly with npx or installable via npm, yarn, bun, Homebrew
Compress code using Tree-sitter to extract essential signatures and reduce tokens
Options to remove comments and empty lines from output
Include/exclude files using glob patterns
Add file summary, directory structure, and line numbers to output

Pros & Cons

Pros
  • Open source and completely free
  • Works with any LLM service (ChatGPT, Claude, Gemini, Grok, etc.) without extra cost
  • Respects .gitignore, reducing noise and token usage
  • Built-in security scanning prevents accidental inclusion of secrets
  • Provides token counts, helpful for staying within LLM context limits
  • Supports multiple output formats and extensive customization options
  • Can be used without installation via npx
Cons
  • Command-line only, no graphical interface
  • Output file can become very large for big repositories
  • Requires some familiarity with terminal and glob patterns for advanced usage

Best For

Code review and refactoring with AI assistantsBug investigation and root cause analysis with full codebase contextThird-party library security checks by packaging dependencies for AI scanningAutomated documentation generation from codebase structureImplementation planning and architecture analysis with LLMsGetting comprehensive AI assistance without file-by-file exploration

FAQ

What output formats does Repomix support?
Repomix supports XML, Markdown, and Plain text output formats.
How can I get started using Repomix?
You can try Repomix instantly in any project directory by running 'npx repomix@latest'. Alternatively, install it globally via npm, yarn, bun, or Homebrew, then run 'repomix' in your project directory.
Does Repomix work with private repositories?
Yes, because Repomix uses your locally installed git, it can access any repository you have access to locally, including private ones.