name: repomix description: Pack a codebase into a single AI-friendly file using the repomix CLI. Use when the user asks to bundle, snapshot, or export a repository (local or remote) for an LLM, count a repo's token size, or generate a compressed code overview. metadata: tool: repomix
Run the repomix CLI to merge a repository into one structured file with a file summary, directory tree, and per-file contents. Output is safe to feed to LLMs: secretlint strips files matching known credential patterns, and .gitignore/.ignore/.repomixignore are respected automatically.
No install required; npx fetches and caches it:
npx -y repomix@latest --version # verify, ~1.18+
# Pack current repo (writes ./repomix-output.xml)
npx -y repomix
# Pack a specific directory or glob selection
npx -y repomix path/to/dir
npx -y repomix --include "src/**/*.ts,*.md" --ignore "**/*.test.ts"
# Output to stdout (pipe or capture) instead of a file
npx -y repomix --stdout
# Other output formats
npx -y repomix --style markdown|json|plain -o out.md
# Compressed structural overview (tree-sitter, drops function bodies)
npx -y repomix --compress
# Remote repo (no clone needed); branch/tag/commit via --remote-branch
npx -y repomix --remote user/repo
# Token budget guard: non-zero exit if output exceeds N tokens
npx -y repomix --token-budget 100000
# Show per-file token counts before committing to a full pack
npx -y repomix --token-count-tree
--token-count-tree first to see the size picture.--include globs, or --compress for structure-only./tmp/opencode/repomix-output.xml (or --stdout) rather than the repo root, unless the user wants it in the project.file:line from the original paths shown in the output.repomix-output.xml in the working directory; use -o to change it.--split-output 2mb splits huge packs into numbered parts.--include-logs / --include-diffs add git history and working-tree diffs to the pack.--no-security-check if the user explicitly asks.repomix.config.json; npx -y repomix --init creates one.repomix --mcp for an MCP server, --skill-generate to emit a per-repo context skill) — prefer this CLI skill unless the user asks for those.