gitnexus-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGitNexus CLI Commands
GitNexus CLI 命令
All commands work via — no global install required.
npx所有命令均可通过运行——无需全局安装。
npxCommands
命令
analyze — Build or refresh the index
analyze — 构建或刷新索引
bash
npx gitnexus analyzeRun from the project root. This parses all source files, builds the knowledge graph, writes it to , and generates CLAUDE.md / AGENTS.md context files.
.gitnexus/| Flag | Effect |
|---|---|
| Force full re-index even if up to date |
| Enable embedding generation for semantic search (off by default) |
When to run: First time in a project, after major code changes, or when reports the index is stale.
gitnexus://repo/{name}/contextbash
npx gitnexus analyze在项目根目录运行此命令。它会解析所有源文件,构建知识图谱,将其写入目录,并生成CLAUDE.md / AGENTS.md上下文文件。
.gitnexus/| 标志 | 作用 |
|---|---|
| 即使索引已最新,也强制进行完整重新索引 |
| 启用语义搜索的嵌入生成(默认关闭) |
**运行时机:**首次在项目中使用时、进行重大代码变更后,或当报告索引已过期时。
gitnexus://repo/{name}/contextstatus — Check index freshness
status — 检查索引新鲜度
bash
npx gitnexus statusShows whether the current repo has a GitNexus index, when it was last updated, and symbol/relationship counts. Use this to check if re-indexing is needed.
bash
npx gitnexus status显示当前仓库是否有GitNexus索引、上次更新时间以及符号/关系计数。使用此命令检查是否需要重新索引。
clean — Delete the index
clean — 删除索引
bash
npx gitnexus cleanDeletes the directory and unregisters the repo from the global registry. Use before re-indexing if the index is corrupt or after removing GitNexus from a project.
.gitnexus/| Flag | Effect |
|---|---|
| Skip confirmation prompt |
| Clean all indexed repos, not just the current one |
bash
npx gitnexus clean删除目录并将仓库从全局注册表中注销。如果索引损坏,或在项目中移除GitNexus后,可在重新索引前运行此命令。
.gitnexus/| 标志 | 作用 |
|---|---|
| 跳过确认提示 |
| 清理所有已索引的仓库,而非仅当前仓库 |
wiki — Generate documentation from the graph
wiki — 从图谱生成文档
bash
npx gitnexus wikiGenerates repository documentation from the knowledge graph using an LLM. Requires an API key (saved to on first use).
~/.gitnexus/config.json| Flag | Effect |
|---|---|
| Force full regeneration |
| LLM model (default: minimax/minimax-m2.5) |
| LLM API base URL |
| LLM API key |
| Parallel LLM calls (default: 3) |
| Publish wiki as a public GitHub Gist |
bash
npx gitnexus wiki使用LLM从知识图谱生成仓库文档。需要API密钥(首次使用时会保存到)。
~/.gitnexus/config.json| 标志 | 作用 |
|---|---|
| 强制完整重新生成 |
| LLM模型(默认:minimax/minimax-m2.5) |
| LLM API基础URL |
| LLM API密钥 |
| 并行LLM调用数(默认:3) |
| 将wiki发布为公开的GitHub Gist |
list — Show all indexed repos
list — 显示所有已索引的仓库
bash
npx gitnexus listLists all repositories registered in . The MCP tool provides the same information.
~/.gitnexus/registry.jsonlist_reposbash
npx gitnexus list列出中注册的所有仓库。MCP的工具提供相同信息。
~/.gitnexus/registry.jsonlist_reposAfter Indexing
索引完成后
- Read to verify the index loaded
gitnexus://repo/{name}/context - Use the other GitNexus skills (,
exploring,debugging,impact-analysis) for your taskrefactoring
- **查看**以验证索引已加载
gitnexus://repo/{name}/context - 使用其他GitNexus技能(、
exploring、debugging、impact-analysis)完成你的任务refactoring
Troubleshooting
故障排除
- "Not inside a git repository": Run from a directory inside a git repo
- Index is stale after re-analyzing: Restart Claude Code to reload the MCP server
- Embeddings slow: Omit (it's off by default) or set
--embeddingsfor faster API-based embeddingOPENAI_API_KEY
- "Not inside a git repository":在git仓库内的目录中运行命令
- 重新分析后索引仍过期:重启Claude Code以重新加载MCP服务器
- 嵌入生成缓慢:省略(默认已关闭)或设置
--embeddings以使用更快的基于API的嵌入生成OPENAI_API_KEY