build-graph
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBuild Graph
构建图谱
Build or incrementally update the persistent code knowledge graph for this repository.
构建或增量更新当前仓库的持久化代码知识图谱。
Steps
步骤
-
Check graph status by calling theMCP tool.
list_graph_stats_tool- If the graph has never been built (last_updated is null), proceed with a full build.
- If the graph exists, proceed with an incremental update.
-
Build the graph by calling theMCP tool:
build_or_update_graph_tool- For first-time setup:
build_or_update_graph_tool(full_rebuild=True) - For updates: (incremental by default)
build_or_update_graph_tool()
- For first-time setup:
-
Verify by callingagain and report the results:
list_graph_stats_tool- Number of files parsed
- Number of nodes and edges created
- Languages detected
- Any errors encountered
-
检查图谱状态:调用MCP工具。
list_graph_stats_tool- 若图谱从未构建(last_updated为null),则执行完整构建。
- 若图谱已存在,则执行增量更新。
-
构建图谱:调用MCP工具:
build_or_update_graph_tool- 首次设置:
build_or_update_graph_tool(full_rebuild=True) - 更新操作:(默认增量更新)
build_or_update_graph_tool()
- 首次设置:
-
验证:再次调用并报告结果:
list_graph_stats_tool- 已解析文件数量
- 创建的节点和边数量
- 检测到的编程语言
- 遇到的任何错误
When to Use
使用场景
- First time setting up the graph for a repository
- After major refactoring or branch switches
- If the graph seems stale or out of sync
- The graph auto-updates via hooks on edit/commit, so manual builds are rarely needed
- 首次为仓库设置图谱时
- 完成重大重构或分支切换后
- 图谱显示过时或不同步时
- 图谱会在编辑/提交时通过钩子自动更新,因此很少需要手动构建
Notes
注意事项
- The graph is stored as a SQLite database () in the repo root
.code-review-graph/graph.db - Binary files, generated files, and patterns in are skipped
.code-review-graphignore - Supported languages: Python, TypeScript/JavaScript, Vue, Go, Rust, Java, Scala, C#, Ruby, Kotlin, Swift, PHP, Solidity, C/C++
- 图谱存储在仓库根目录的SQLite数据库()中
.code-review-graph/graph.db - 二进制文件、生成文件以及中指定的模式会被跳过
.code-review-graphignore - 支持的语言:Python、TypeScript/JavaScript、Vue、Go、Rust、Java、Scala、C#、Ruby、Kotlin、Swift、PHP、Solidity、C/C++