Linux command
repomix 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
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
说明
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.
参数
- -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.
FAQ
What is the repomix command used for?
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.
How do I run a basic repomix example?
Run `repomix` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -o, --output _FILE_ do in repomix?
Output filename.