repomix

Pack repository into AI-friendly format

TLDR

Pack repository
$ repomix
Pack specific directory
$ repomix [path/to/repo]
Custom output file
$ repomix -o [output.txt]
Include specific files
$ repomix --include "[*.ts,*.js]"
Exclude patterns
$ repomix --ignore "[node_modules,dist]"
XML output format
$ repomix --style xml

SYNOPSIS

repomix [-o file] [--include pattern] [--ignore pattern] [path]

DESCRIPTION

repomix packs an entire code repository into a single text file optimized for use as context in AI language model conversations. It concatenates source files with clear file boundary markers and a directory tree summary, making it easy for LLMs to understand the full structure and content of a codebase.The tool automatically respects .gitignore rules to skip irrelevant files like dependencies and build artifacts. Include and exclude patterns provide fine-grained control over which files are packed. Built-in token counting estimates how much of an LLM's context window the output will consume, helping users stay within model limits.Output formats include plain text, XML, and Markdown, each with clear file delimiters and optional metadata headers. The tool can be configured via a repomix.config.json file for consistent usage across a project.

PARAMETERS

-o, --output FILE

Output filename.
--include PATTERN
Include patterns.
--ignore PATTERN
Ignore patterns.
--style FORMAT
Output style (plain, xml, markdown).
--top-files-len N
Summary file count.
-c, --config FILE
Config file path.

CONFIGURATION

repomix.config.json

Project-level configuration file specifying default output format, include/exclude patterns, and output filename. Loaded automatically from the repository root.

INSTALL

brew install repomix
nix profile install nixpkgs#repomix

CAVEATS

Large repos may exceed limits. Binary files skipped. Needs Node.js.

HISTORY

repomix was created to package codebases into a single file optimized for AI language model context windows.

SEE ALSO

git(1), tree(1), cat(1)