Install: npm_config_registry=https://registry.npmmirror.com npm install -g repomix && repomix --version
What you will run into
You want to hand your repo to an LLM but the context window cannot fit it — repomix packs an entire repository into a single file (tokens compressed, includes scoped) for LLM context. The two things people trip on: the output file lands in the current directory (default repomix-output.txt) and can accidentally get committed to git (add it to .gitignore), and large repos blow the token budget (use --compress + --include to scope). When to use it:
- Preparing repo context for LLM prompts/agents;
- Token-budgeting with compression and include scoping;
- Sharing a full-repo snapshot as one file.
When not to use it: tiny single-file snippets — just paste the file.
Path: Quick fix (30s, one command) -> Step by step (skimmable) -> How to confirm it works (success criteria). In a hurry? Jump to Quick fix.
Why this happens
CLI run in the target repo root. repomix . --compress --output repomix-output.txt packs with token compression; --output changes the output path (verified); --include scopes the pack (official feature, not tested). The default output file is written to the current directory. Repo structure is respected (e.g. .gitignore matches are excluded by default). Key concepts:
- Pack Summary: Total Files / Total Tokens / Output path;
- --compress: token compression;
- --include: scope limiting (official feature, not tested).
Where it writes: no user-level config; output single file to the current directory (default repomix-output.txt, suggest .gitignore).
Quick fix (skip the explanation, just run it)
note: verified path here; use the npmmirror prefix on mainland networks (verified seconds-level install 2026-08-29)
npm_config_registry=https://registry.npmmirror.com npm install -g repomix
repomix --version
Expected output: 1.18.0 (verified seconds-level install 2026-08-29)
Step by step
Step 1: Install (why npmmirror: mainland npm direct is slow)
Why: global npm install; mainland npm direct is slow, so use the npmmirror registry prefix (verified seconds-level install 2026-08-29). Node >= 18 (npm/npx form).
npm_config_registry=https://registry.npmmirror.com npm install -g repomix
repomix --version
Expected output: repomix 1.18.0 (verified 2026-08-29) After install, confirm:
repomix --versionprints 1.18.0;repomix --helplists pack/init etc.
Stuck? How to recover:
- npm slow/timeout → make sure the command has the npmmirror prefix;
- command not found → confirm the npm global bin is on PATH.
Step 2: Pack the repo (verified here)
Why: run in the target repo root. --compress compresses tokens; --output sets the output path (default repomix-output.txt). Verified 2026-08-29: 2 files → 1983 chars.
repomix . --compress --output repomix-output.txt
Expected output: Pack Summary (Total Files / Total Tokens / Output path; verified 2026-08-29, 2 files → 1983 chars) After install, confirm:
- Pack Summary outputs normally;
- the output file exists (default repomix-output.txt in the current directory).
Stuck? How to recover:
- output file got into git → add it to .gitignore (pack files should not be committed);
- pack slow → scope with --include on large repos.
Step 3: Control scope and token budget
Why: --include scopes the pack (official feature, not tested); --output changes the output path (verified). Large-repo verification 2026-08-29: site docs full dir → 62KB/959 lines single file.
repomix . --compress --include "src/**/*.ts,README.md"
Expected output: only matched files are packed (--compress verified; --include is an official feature, not tested)
repomix . --output /tmp/repo-context.txt
Expected output: single file written to the specified path (--output verified 2026-08-29) After install, confirm:
- --include only packs matched files;
- --output writes to the specified path.
Stuck? How to recover:
- --include behaves unexpectedly → official feature (not tested), follow —help/official docs;
- output path not writable → switch to a writable directory (--output).
How to confirm it works
Step 1: Confirm the pack path
Why: repomix . --compress --output repomix-output.txt finishing with a Pack Summary and an existing output file means the pack path is complete and working.
repomix . --compress --output repomix-output.txt
ls -l repomix-output.txt
Expected output: Pack Summary (Total Files / Total Tokens / Output path) + the output file exists (verified 2026-08-29, 2 files → 1983 chars) Stuck? How to recover:
- Pack Summary errors → confirm you are in the target repo root and the directory is readable;
- output file got into git → add repomix-output.txt to .gitignore (pack files should not be committed).
Step 2: Confirm scope control works
Why: --output changing paths is verified; --include scoping is an official feature (not tested) — both limit what goes into the context.
repomix . --output /tmp/repo-context.txt
ls -l /tmp/repo-context.txt
Expected output: single file written to the specified path (--output verified) Stuck? How to recover:
- --include behaves unexpectedly → official feature (not tested), follow —help/official docs;
- output path not writable → switch to a writable directory (--output).
Other environments
- Node version: >= 18 required (npm/npx form); the official single-binary Release needs no Node (not tested).
- Windows / macOS: npm install and commands are the same (npmmirror prefix recommended domestically, verified seconds-level install).
- Write surface: no user-level config; output single file to the current directory (default repomix-output.txt, suggest .gitignore).
- Co-install: with code-review-graph / swe-rex judged possible-compatible — write surfaces do not overlap (output file / review report / fix diff), co-install not tested.
Daily usage
Startup and entry
Run the CLI in the target repo root; no resident service.
Common operations
Operation 1: Pack the repo into a single file
repomix . --compress --output repomix-output.txt
Expected output: Pack Summary (Total Files / Total Tokens / Output path; verified 2026-08-29, 2 files → 1983 chars) Operation 2: Control pack scope and token budget
repomix . --compress --include "src/**/*.ts,README.md"
Expected output: only matched files are packed (--compress verified; --include is an official feature, not tested) Operation 3: Specify the output path
repomix . --output /tmp/repo-context.txt
Expected output: single file written to the specified path (--output verified 2026-08-29)
Data and directories
- Output: repomix-output.txt in the current directory (or the --output path);
- Config: optional repomix.config.json (generated by --init, in the workspace; --init write surface not tested).
Uninstall & cleanup
note: npm global uninstall + command-surface verification; residue = output files and the optional repomix.config.json (workspace, manual delete)
npm uninstall -g repomix
command -v repomix >/dev/null 2>&1 && echo "残留: repomix 仍存在" || echo "repomix removed: OK"
Expected output: repomix removed: OK Manual checklist (for full cleanup):
- output files (default repomix-output.txt in the current directory, or the --output path)
- repomix.config.json (if generated with --init, in the workspace)
- ~/.npm npx cache (used by the npx no-install form; no cleanup needed)
Dependency warnings
- Version:
[1.18.0, 1.18.0]locked (verified 2026-08-29). - Environment: Node >= 18 (npm/npx form); the single-binary Release needs no Node (not tested).
- Network: npm via npmmirror prefix (verified seconds-level install 2026-08-29).
- Write surface: no user-level config; output single file to the current directory (default repomix-output.txt, suggest .gitignore).
- Co-install: with code-review-graph / swe-rex judged possible-compatible — write surfaces do not overlap (output file / review report / fix diff), co-install not tested.
FAQ
- Q: Will it change my config? A: no user-level config writes; at runtime it may read an optional global config under ~/.config/repomix/ (--init write surface not tested); the output single file goes to the current directory (default repomix-output.txt).
- Q: Conflicts with code-review-graph / swe-rex installed together? A: judged possible-compatible — write surfaces do not overlap (output file / review report / fix diff), co-install not tested.
- Q: Large repo over the token limit? A: --compress + --include scoping (verified 2026-08-29: site docs full dir → 62KB/959 lines single file).
- Q: Will the output file get into git? A: .gitignore matches are excluded by default, but the output file itself should be added to .gitignore.
- Q: Can't npm install domestically? A: use the npmmirror prefix from the install section (verified seconds-level install 2026-08-29).
- Q: Where to report problems? A: install/uninstall issues on this marketplace go through the entry feedback channel; project issues go to the author's repository.
Verification Evidence
- Verified:
local repro log 2026-08-29(2026-08-29, npm install + version + pack + --output, full chain);local repro log 2026-08-30(npx repomix --version + pack --compress --include with exclusions verified);local repro log 2026-08-30(echo y | repomix --initconfig generation + file check — --include/--init moved from untested to tested). - Not tested: single-binary Release (commands from official site docs; --include and --init verified via usage on 2026-08-30).
← Trove | evidence & precheck records kept locally; conclusions and sources published here