understand-dashboard

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

/understand-dashboard

/understand-dashboard

Start the Understand Anything dashboard to visualize the knowledge graph for the current project.
启动Understand Anything仪表板,以可视化当前项目的知识图谱。

Instructions

操作步骤

  1. Determine the project directory:
    • If
      $ARGUMENTS
      contains a path, use that as the project directory
    • Otherwise, use the current working directory
  2. Check that
    .understand-anything/knowledge-graph.json
    exists in the project directory. If not, tell the user:
    No knowledge graph found. Run /understand first to analyze this project.
  3. Find the dashboard code. The dashboard is at
    packages/dashboard/
    relative to this plugin's root directory. Use the Bash tool to resolve the path:
    bash
    PLUGIN_ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
    Or locate it by checking these paths in order:
    • ${CLAUDE_PLUGIN_ROOT}/packages/dashboard/
    • The parent directory of this skill file, then
      ../../packages/dashboard/
  4. Install dependencies if needed:
    bash
    cd <dashboard-dir> && pnpm install --frozen-lockfile 2>/dev/null || pnpm install
  5. Start the Vite dev server pointing at the project's knowledge graph:
    bash
    cd <dashboard-dir> && GRAPH_DIR=<project-dir> npx vite --open
    Run this in the background so the user can continue working.
  6. Report to the user:
    Dashboard started at http://localhost:5173
    Viewing: <project-dir>/.understand-anything/knowledge-graph.json
    
    The dashboard is running in the background. Press Ctrl+C in the terminal to stop it.
  1. 确定项目目录:
    • 如果
      $ARGUMENTS
      包含路径,则使用该路径作为项目目录
    • 否则,使用当前工作目录
  2. 检查项目目录中是否存在
    .understand-anything/knowledge-graph.json
    。如果不存在,告知用户:
    未找到知识图谱。请先运行/understand命令分析此项目。
  3. 查找仪表板代码。仪表板位于此插件根目录的
    packages/dashboard/
    路径下。使用Bash工具解析路径:
    bash
    PLUGIN_ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
    或者按以下顺序检查路径来定位:
    • ${CLAUDE_PLUGIN_ROOT}/packages/dashboard/
    • 此skill文件的父目录,然后是
      ../../packages/dashboard/
  4. 如有需要,安装依赖:
    bash
    cd <dashboard-dir> && pnpm install --frozen-lockfile 2>/dev/null || pnpm install
  5. 启动指向项目知识图谱的Vite开发服务器:
    bash
    cd <dashboard-dir> && GRAPH_DIR=<project-dir> npx vite --open
    在后台运行此命令,以便用户可以继续工作。
  6. 向用户反馈:
    仪表板已在http://localhost:5173启动
    当前查看:<project-dir>/.understand-anything/knowledge-graph.json
    
    仪表板正在后台运行。在终端中按Ctrl+C可停止它。

Notes

注意事项

  • The dashboard auto-opens in the default browser via
    --open
  • If port 5173 is already in use, Vite will pick the next available port
  • The
    GRAPH_DIR
    environment variable tells the dashboard where to find the knowledge graph
  • 仪表板会通过
    --open
    参数在默认浏览器中自动打开
  • 如果端口5173已被占用,Vite会选择下一个可用端口
  • GRAPH_DIR
    环境变量用于告知仪表板知识图谱的位置