gitnexus-cli

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

GitNexus CLI Commands

GitNexus CLI 命令

All commands work via
npx
— no global install required.
所有命令均可通过
npx
运行——无需全局安装。

Commands

命令

analyze — Build or refresh the index

analyze — 构建或刷新索引

bash
npx gitnexus analyze
Run from the project root. This parses all source files, builds the knowledge graph, writes it to
.gitnexus/
, and generates CLAUDE.md / AGENTS.md context files.
FlagEffect
--force
Force full re-index even if up to date
--embeddings
Enable embedding generation for semantic search (off by default)
When to run: First time in a project, after major code changes, or when
gitnexus://repo/{name}/context
reports the index is stale.
bash
npx gitnexus analyze
在项目根目录运行此命令。它会解析所有源文件,构建知识图谱,将其写入
.gitnexus/
目录,并生成CLAUDE.md / AGENTS.md上下文文件。
标志作用
--force
即使索引已最新,也强制进行完整重新索引
--embeddings
启用语义搜索的嵌入生成(默认关闭)
**运行时机:**首次在项目中使用时、进行重大代码变更后,或当
gitnexus://repo/{name}/context
报告索引已过期时。

status — Check index freshness

status — 检查索引新鲜度

bash
npx gitnexus status
Shows 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 clean
Deletes the
.gitnexus/
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.
FlagEffect
--force
Skip confirmation prompt
--all
Clean all indexed repos, not just the current one
bash
npx gitnexus clean
删除
.gitnexus/
目录并将仓库从全局注册表中注销。如果索引损坏,或在项目中移除GitNexus后,可在重新索引前运行此命令。
标志作用
--force
跳过确认提示
--all
清理所有已索引的仓库,而非仅当前仓库

wiki — Generate documentation from the graph

wiki — 从图谱生成文档

bash
npx gitnexus wiki
Generates repository documentation from the knowledge graph using an LLM. Requires an API key (saved to
~/.gitnexus/config.json
on first use).
FlagEffect
--force
Force full regeneration
--model <model>
LLM model (default: minimax/minimax-m2.5)
--base-url <url>
LLM API base URL
--api-key <key>
LLM API key
--concurrency <n>
Parallel LLM calls (default: 3)
--gist
Publish wiki as a public GitHub Gist
bash
npx gitnexus wiki
使用LLM从知识图谱生成仓库文档。需要API密钥(首次使用时会保存到
~/.gitnexus/config.json
)。
标志作用
--force
强制完整重新生成
--model <model>
LLM模型(默认:minimax/minimax-m2.5)
--base-url <url>
LLM API基础URL
--api-key <key>
LLM API密钥
--concurrency <n>
并行LLM调用数(默认:3)
--gist
将wiki发布为公开的GitHub Gist

list — Show all indexed repos

list — 显示所有已索引的仓库

bash
npx gitnexus list
Lists all repositories registered in
~/.gitnexus/registry.json
. The MCP
list_repos
tool provides the same information.
bash
npx gitnexus list
列出
~/.gitnexus/registry.json
中注册的所有仓库。MCP的
list_repos
工具提供相同信息。

After Indexing

索引完成后

  1. Read
    gitnexus://repo/{name}/context
    to verify the index loaded
  2. Use the other GitNexus skills (
    exploring
    ,
    debugging
    ,
    impact-analysis
    ,
    refactoring
    ) for your task
  1. **查看
    gitnexus://repo/{name}/context
    **以验证索引已加载
  2. 使用其他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
    --embeddings
    (it's off by default) or set
    OPENAI_API_KEY
    for faster API-based embedding
  • "Not inside a git repository":在git仓库内的目录中运行命令
  • 重新分析后索引仍过期:重启Claude Code以重新加载MCP服务器
  • 嵌入生成缓慢:省略
    --embeddings
    (默认已关闭)或设置
    OPENAI_API_KEY
    以使用更快的基于API的嵌入生成