两种模式:
本地运行(直接在本机分析仓库,推荐)
- 安装/构建插件(仅第一次或改动后):
bash
cd ~/.understand-anything/repo/understand-anything-plugin
pnpm install
pnpm --filter @understand-anything/core build
-
在项目根运行分析(写入项目的 knowledge-graph.json):
- 如果系统有全局 understand 命令:understand /path/to/project --full --language zh
- 否则用插件内的脚本(常见位置):
- PLUGIN_ROOT=~/.understand-anything/repo/understand-anything-plugin
- bash "$PLUGIN_ROOT/skills/understand/understand.sh" /path/to/project --full --language zh
- 可选参数:
- --full 强制重建,--review 启用 LLM 审核,--language zh 生成中文内容,--auto-update/--no-auto-update 控制自动更新。
-
结果:会在项目下生成/更新 knowledge-graph.json、meta.json 和可能的中间文件;之后可用本地静态服务器打开 dashboard。
插件/斜杠命令(在 Copilot/agent 环境中触发)
- 在 Copilot/agent 聊天中直接运行命令式交互:
- 在 Copilot 聊天框输入:/understand --full --language zh
- 或在 agent UI 选择并运行 understand skill,按提示确认 .understandignore、语言等选项。
- 特点:
- 插件会自动解析并找到插件根(可处理多种安装路径),必要时会自动执行 pnpm build。
- 对于 git worktree,默认会把输出重定向到主仓库根(可通过环境变量覆盖)。
- 适合在 Copilot/agent 环境下可视化交互与分阶段运行(不需要手动构建插件)。