当前位置: 首页 > news >正文

Repomix CLI命令大全:所有参数选项详解

Repomix CLI命令大全:所有参数选项详解

【免费下载链接】repomix📦 Repomix (formerly Repopack) is a powerful tool that packs your entire repository into a single, AI-friendly file. Perfect for when you need to feed your codebase to Large Language Models (LLMs) or other AI tools like Claude, ChatGPT, DeepSeek, Perplexity, Gemini, Gemma, Llama, Grok, and more.项目地址: https://gitcode.com/GitHub_Trending/rep/repomix

Repomix是一个强大的AI代码仓库打包工具,能够将整个代码库打包成单个AI友好文件。本文将详细介绍Repomix CLI的所有命令参数,帮助您充分利用这个工具的强大功能。无论您是初次使用Repomix的新手,还是想要深入了解高级功能的高级用户,这篇完整指南都将为您提供全面的CLI命令参考。

📦 基础命令与安装

快速开始

无需安装,直接使用npx运行最新版本:

npx repomix@latest

全局安装

如需频繁使用,建议全局安装:

npm install -g repomix

安装后,您可以直接在任何目录中使用repomix命令。

🔧 基础选项

版本信息

查看Repomix版本:

repomix --version

初始化配置

创建默认配置文件:

repomix --init

创建全局配置文件(存储在用户主目录):

repomix --init --global

帮助信息

查看所有可用选项:

repomix --help

📤 输入输出选项

输出控制

基本输出- 将结果输出到指定文件:

repomix -o output.xml repomix --output custom-output.md

标准输出- 将结果直接输出到终端:

repomix --stdout repomix --stdout > output.txt

管道处理- 与其他命令结合使用:

repomix --stdout | llm "请分析这个代码库"

输出到剪贴板- 自动复制到系统剪贴板:

repomix --copy

输出格式

选择不同的输出格式:

repomix --style xml # 默认格式,结构化最好 repomix --style markdown # Markdown格式 repomix --style json # JSON格式 repomix --style plain # 纯文本格式

输出优化选项

显示行号- 在输出中显示行号:

repomix --output-show-line-numbers

自定义头部文本- 添加自定义头部信息:

repomix --header-text "项目分析报告 - 生成于 $(date)"

使用指令文件- 包含自定义指令:

repomix --instruction-file-path instructions.md

📁 文件选择与过滤

包含模式

只包含特定文件:

repomix --include "src/**/*.ts,**/*.md" repomix --include "*.js,*.ts,*.jsx,*.tsx"

排除模式

排除特定文件:

repomix --ignore "**/*.test.js,docs/**" repomix --ignore "node_modules,dist,build"

忽略文件控制

禁用.gitignore- 不使用.gitignore规则:

repomix --no-gitignore

禁用.ignore文件- 不使用.ignore规则:

repomix --no-dot-ignore

禁用默认模式- 不使用内置忽略模式:

repomix --no-default-patterns

标准输入模式

从标准输入读取文件列表:

find src -name "*.ts" -type f | repomix --stdin git ls-files "*.ts" | repomix --stdin rg -l "TODO" **/*.ts | repomix --stdin

🚀 高级处理选项

代码压缩

使用Tree-sitter提取关键代码结构:

repomix --compress

注释和空行处理

移除注释

repomix --remove-comments

移除空行

repomix --remove-empty-lines

大文件处理

截断Base64数据

repomix --truncate-base64

分割输出文件- 按大小分割输出:

repomix --split-output 1mb repomix --split-output 500kb repomix --split-output 2.5mb

📊 仓库分析与统计

目录结构选项

包含空目录

repomix --include-empty-directories

显示完整目录结构

repomix --include-full-directory-structure

Git集成功能

包含差异信息- 显示工作区和暂存区的更改:

repomix --include-diffs

包含提交历史- 显示Git提交历史:

repomix --include-logs repomix --include-logs --include-logs-count 10

禁用Git排序- 不按更改频率排序文件:

repomix --no-git-sort-by-changes

令牌计数

令牌计数树- 显示文件令牌统计:

repomix --token-count-tree repomix --token-count-tree 1000 # 只显示1000+令牌的文件

令牌编码设置

repomix --token-count-encoding o200k_base # GPT-4o默认 repomix --token-count-encoding cl100k_base # GPT-3.5/4

文件摘要

禁用文件摘要

repomix --no-file-summary

禁用目录结构

repomix --no-directory-structure

仅元数据模式- 不包含文件内容:

repomix --no-files

🌐 远程仓库处理

远程仓库打包

基本远程打包

repomix --remote https://github.com/yamadashy/repomix repomix --remote yamadashy/repomix

指定分支或标签

repomix --remote https://github.com/yamadashy/repomix --remote-branch main repomix --remote https://github.com/yamadashy/repomix --remote-branch v1.0.0

指定特定提交

repomix --remote https://github.com/yamadashy/repomix --remote-branch 935b695

信任远程配置- 加载远程仓库的配置文件:

repomix --remote https://github.com/user/repo --remote-trust-config

复杂远程URL支持

支持各种GitHub URL格式:

repomix --remote https://github.com/yamadashy/repomix/tree/main repomix --remote https://github.com/yamadashy/repomix/commit/836abcd7335137228ad77feb28655d85712680f1

🔒 安全选项

安全检查

禁用安全检查- 跳过敏感数据扫描:

repomix --no-security-check

🤖 AI技能生成(实验性功能)

生成Claude Agent技能

基本技能生成

repomix --skill-generate repomix --skill-generate my-project-reference

指定输出目录

repomix --skill-generate --skill-output ./my-skills

强制覆盖- 跳过确认提示:

repomix --skill-generate --skill-output ./my-skills --force

远程仓库技能生成

repomix --remote user/repo --skill-generate repomix --remote user/repo --skill-generate my-skill --skill-output ./output --force

技能生成与过滤结合

生成特定文件的技能:

repomix --skill-generate --include "src/**/*.ts" --ignore "**/*.test.ts" repomix --skill-generate --compress

🖥️ MCP服务器模式

运行MCP服务器

启动Model Context Protocol服务器:

repomix --mcp

📈 性能与调试选项

日志级别控制

详细日志- 显示调试信息:

repomix --verbose

静默模式- 只显示错误:

repomix --quiet

文件统计

显示最大文件- 指定显示的最大文件数量:

repomix --top-files-len 20

🎯 实用组合示例

实际使用场景

完整项目分析

repomix --include "src/**/*" --ignore "**/*.test.*" --compress --include-diffs --include-logs

AI优化输出

repomix --compress --remove-comments --remove-empty-lines --style markdown

安全扫描模式

repomix --no-security-check --verbose --token-count-tree

批量处理脚本

#!/bin/bash for repo in repo1 repo2 repo3; do repomix --remote "$repo" --output "${repo}-analysis.xml" --quiet done

⚙️ 配置文件使用

自定义配置文件

使用自定义配置文件:

repomix --config custom-config.json

配置文件位置

Repomix按以下顺序查找配置文件:

  1. 命令行指定的--config文件
  2. 当前目录的repomix.config.json
  3. 用户主目录的.repomix/config.json

🐳 Docker使用

Docker容器运行

使用Docker运行Repomix:

docker run -v $(pwd):/app -it --rm ghcr.io/yamadashy/repomix docker run -v ./output:/app -it --rm ghcr.io/yamadashy/repomix --remote https://github.com/yamadashy/repomix

🔍 故障排除与提示

常见问题解决

权限问题- 确保对目标目录有读取权限内存不足- 使用--compress减少内存使用输出文件过大- 使用--split-output分割文件网络问题- 使用--verbose查看详细日志

性能优化建议

  • 使用--compress减少输出大小
  • 使用--ignore排除不必要文件
  • 使用--quiet减少日志输出
  • 使用--no-files只生成元数据

📚 总结与最佳实践

Repomix CLI提供了丰富的选项来满足不同场景的需求。通过合理组合这些参数,您可以:

  1. 优化AI处理- 使用--compress--remove-comments
  2. 提高安全性- 启用安全检查,排除敏感文件
  3. 增强可读性- 使用--output-show-line-numbers--style markdown
  4. 批量处理- 结合--stdin和管道操作
  5. 远程分析- 使用--remote处理GitHub仓库

掌握这些CLI命令将帮助您更高效地使用Repomix进行代码库分析和AI集成。无论是个人项目还是企业级应用,Repomix都能为您提供强大的代码打包和分析能力。

【免费下载链接】repomix📦 Repomix (formerly Repopack) is a powerful tool that packs your entire repository into a single, AI-friendly file. Perfect for when you need to feed your codebase to Large Language Models (LLMs) or other AI tools like Claude, ChatGPT, DeepSeek, Perplexity, Gemini, Gemma, Llama, Grok, and more.项目地址: https://gitcode.com/GitHub_Trending/rep/repomix

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

http://www.jsqmd.com/news/542426/

相关文章:

  • 如何为Rainmeter贡献多语言翻译:完整指南
  • 终极指南:如何使用Mermaid.js创建太空探索任务规划与系统架构图表
  • Linux exec进程替换详解
  • Llama-3.2V-11B-cot部署案例:中小企业低成本构建AI图文分析工作台
  • 5分钟快速上手:GetQzonehistory免费备份QQ空间所有历史说说
  • Particle Life模式探索指南:5个技巧发现前所未见的美学形态
  • 三极管基极下拉电阻在高速电路中的关键作用解析
  • 告别虚拟机!在Windows上用Navicat直连Ubuntu 20.04的MySQL 8.0,完整权限配置指南
  • 告别网络依赖:用这个开源工具+高德离线包,5步搞定前端地图离线展示
  • JPEXS Free Flash Decompiler社区大使选拔流程:申请与评审完全指南
  • HP-Socket社区贡献者奖励发放确认流程:接收与反馈
  • 新手也能懂的RAIM算法:用Python复现GNSS完好性监测(附代码与数据)
  • 如何为Obsidian Sample Plugin添加插件设置默认值:终极指南
  • 告别卡顿闪烁!在Cesium 1.134中集成SOG格式,让400万高斯秒级加载
  • Linux静态库与共享库(动态库)详解
  • Repomix构建流程解析:TypeScript编译与打包的完整指南
  • 2026年写饮品广告的广告语委托/告语优化/广告语服务/广州广告语策划优质公司推荐 - 品牌宣传支持者
  • ccmusic-database新手教程:Gradio输出组件定制——增强Top5结果可读性技巧
  • UEFI安全启动恢复流程文档:详细操作指南与故障排除
  • 高效离线收听解决方案:喜马拉雅音频批量下载工具完整指南
  • MangoHud日志数据分析工具:轻松将游戏性能数据导入Excel的实用指南
  • 终极GTA V菜单防护指南:3步构建YimMenu完整游戏保护系统
  • Python Twitter API IRC机器人开发:实时Twitter通知系统构建
  • 6个高效突破内容访问限制的开源工具使用指南
  • Photon与WebAssembly的完美融合:如何在浏览器中实现原生级别的图像处理
  • 2026年市场四边封包装袋定做厂家,自立拉链袋/八边封包装袋/中封袋/四边封包装袋/三边封包装袋,四边封包装袋企业找哪家 - 品牌推荐师
  • PX4飞控系统架构深度解析:从模块化设计到实时控制实现
  • 如何利用LangChain实现制造业智能质量控制与优化的完整指南
  • 别让BGA扇出毁了你的112G信号!实测1.0mm间距下差分线性能陷阱
  • 提升Jira效率的必备插件推荐