1. 安装
环境要求:Python >= 3.11。
python -m venv .venv
source .venv/bin/activate
pip install -e .[dev]
bash -n examples/demo-agent-repo/scripts/run_agent_task.sh
2. 最小验证
在进入完整多终端演示之前,先用公开 demo 注册表做一次最小验证。
agent-hub version
agent-hub --projects-file examples/agent-driven-projects.example.json list-projects
agent-hub --projects-file examples/agent-driven-projects.example.json list-project-task-templates demo-codex
3. 启动 Web 服务
使用建模了 repo-agent 组合的示例项目注册表。
python -m agent_hub --projects-file examples/agent-driven-projects.example.json serve --port 8080
http://127.0.0.1:8080/http://127.0.0.1:8080/apphttp://127.0.0.1:8080/dashboard
4. 启动 Dispatcher
python -m agent_hub --projects-file examples/agent-driven-projects.example.json dispatch
5. 打开你的助手终端
在另一个终端里打开 Codex 或 Claude Code,然后让它替你使用这个看板。
在 demo-codex 里创建一个 Codex 任务,排查本地构建脚本为什么不稳定,并总结可能的根因。在 demo-claude 里创建一个 Claude 任务,review 修复方案并指出对操作者有影响的风险。在 demo-codex 里为“给部署脚本增加 dry-run 模式”排队 review-then-implement pipeline。
如果你想先手动验证看板,也可以暂时不接入助手,直接运行:
python -m agent_hub --projects-file examples/agent-driven-projects.example.json run-task-template demo-codex delegate-task --input "Investigate why the local build script is flaky"
python -m agent_hub --projects-file examples/agent-driven-projects.example.json dashboard
底层助手会调用类似下面的命令:
python -m agent_hub --projects-file examples/agent-driven-projects.example.json run-task-template demo-codex delegate-task --input "Investigate why the local build script is flaky and summarize the likely root cause"
python -m agent_hub --projects-file examples/agent-driven-projects.example.json run-task-template demo-claude delegate-task --input "Review the proposed fix and call out any operator-facing risks"
python -m agent_hub --projects-file examples/agent-driven-projects.example.json run-pipeline demo-codex review-then-implement --input "Add a dry-run mode to the deployment helper"
这个 demo 使用 examples/demo-agent-repo/scripts/ 下的 wrapper 脚本,来模拟 Claude Code、Codex、Kimi Code、Qwen Code 这类真实工具。
6. 让助手检查交接状态
你也可以让助手直接检查看板并汇报结果。
给我看看 human inbox,并解释哪个任务需要人工路由。如果有失败任务,告诉我应该重试还是标记为人工 review。
底层会映射到类似这些命令:
TASK_ID=$(python -m agent_hub --projects-file examples/agent-driven-projects.example.json create-task "Manual review: choose agent" --kind noop | python - <<'PY'
import json,sys
print(json.load(sys.stdin)["id"])
PY
)
python -m agent_hub --projects-file examples/agent-driven-projects.example.json mark-needs-human "$TASK_ID" --note "operator must decide whether Codex or Claude should own this task"
python -m agent_hub --projects-file examples/agent-driven-projects.example.json add-task-label "$TASK_ID" routing
python -m agent_hub --projects-file examples/agent-driven-projects.example.json add-task-note "$TASK_ID" "ambiguous ownership; human should choose executor"
python -m agent_hub --projects-file examples/agent-driven-projects.example.json list-human-inbox
7. 让助手使用保存视图
当看板上已经有有价值的筛选视图时,助手就可以用保存查询回答类似这样的问题:
只显示 Codex 负责的任务。只显示需要人工 review 的任务。
底层命令类似:
python -m agent_hub --projects-file examples/agent-driven-projects.example.json create-saved-query tasks "Needs Human" --filter status=needs_human
python -m agent_hub --projects-file examples/agent-driven-projects.example.json create-saved-query tasks "Codex Tasks" --filter project_id=demo-codex
python -m agent_hub --projects-file examples/agent-driven-projects.example.json list-saved-queries
python -m agent_hub --projects-file examples/agent-driven-projects.example.json apply-saved-query <query-id>
8. 确认看板状态
任何时候,助手或操作者都可以直接检查当前看板状态:
python -m agent_hub --projects-file examples/agent-driven-projects.example.json dashboard
curl -s http://127.0.0.1:8080/dashboard | sed -n '1,80p'
预期结果
- 多个助手任务记录会通过同一个队列流动。
- 不同 repo-agent 组合会表现为不同的
project_id。 - 一个 pipeline 会展示串行的助手工作。
- human inbox 会显示歧义任务或需要人工 review 的案例。
- 保存视图可以按助手或交接状态切分看板。
更重要的是,正常使用方式应该很清楚:你和 Codex 或 Claude Code 对话,助手把工作提交进 agent-hub,而这个看板就成为很多代码助手任务共享的可视化层。