SuperAPI AI 工具集

repomix

通用与其它

查看项目

更新于 10-15 20:06

技能介绍

用途:Repomix 用于把整个代码仓库打包成单个、对 AI 友好的文件,方便将代码库作为上下文提供给 Claude、ChatGPT、Gemini 等大语言模型,适用于 AI 分析代码库、生成仓库快照、分析第三方库、准备安全审计、生成文档上下文、跨大型代码库排查缺陷等场景。

主要能力:支持 AI 优化的格式化与清晰分隔符;输出格式包括 XML、Markdown、JSON 和纯文本;遵循 .gitignore 的 Git 感知处理;统计单个文件、整个仓库及各格式输出的 Token 数量;使用 Secretlint 检测 API 密钥、密码、凭据、私钥、AWS 密钥等敏感信息;支持不克隆直接处理远程仓库,可指定提交;可移除 HTML、CSS、JavaScript、TypeScript、Vue、Svelte、Python、PHP、Ruby、C、C#、Java、Go、Rust、Swift、Kotlin、Dart、Shell、YAML 等语言的注释。

使用方式:检查安装用 repomix --version;安装可用 npm install -g repomix 或 brew install repomix。基本用法:repomix 打包当前目录并生成 repomix-output.xml;repomix --style markdown 或 --style json 指定格式;npx repomix --remote owner/repo 打包远程仓库;repomix --include "src/**/*.ts" --remove-comments -o output.md 自定义输出与过滤。文件选择可用 --include、-i 忽略模式、--no-gitignore;输出可用 -o、--copy;配置可用 -c custom-config.json 或 --init 生成 repomix.config.json。Token 管理可用 --token-count-tree 查看层级分布,并可加阈值如 --token-count-tree 1000。

限制与注意:分享前应始终检查输出,使用 .repomixignore 排除敏感文件,避免打包 .env 文件,检查硬编码凭据;必要时可用 --no-security-check 关闭安全检查。资料未提供收费、价格与平台支持等细节。