ARTICLE DETAIL

资讯详情

深耕网站建设、视觉设计与SEO优化的一线实战洞察。

把 Windows 侧的接入步骤列成一张可以照做的清单

把 Windows 侧的接入步骤列成一张可以照做的清单

✅ 已写入windows/README.md并推送(d2122ab),bootstrap.ps1也支持-HiveHost了。


Windows 接入清单

全部在PowerShell里执行。[ ]按顺序勾,每步有验收判据。win10只是个机器标签(不是必须等于 hostname),你叫pc2、work都行——只要dispatch --host时用同一个名字。

A. 前提

  • Windows 能打开http://192.168.1.5:3000
  • powershell winget install --id Git.Git -e winget install --id Python.Python.3.12 -e
  • 开新终端(PATH 要重开才生效)验证:powershell git --version python --version✅ 都有版本号

B. 拿工具仓

  • powershell git clone http://192.168.1.5:3000/skywalk/hive.git C:\hive cd C:\hive git log --oneline -3✅ 能看到feat(host)或更新的提交

C. 先干跑(不改任何东西)

  • powershell powershell -ExecutionPolicy Bypass -File C:\hive\windows\bootstrap.ps1 ` -Agent win10 -HiveHost win10✅ 打印一段 MCP JSON,路径是C:\hive\hive.py✅ 没加-Apply,所以什么都没真改

D. 登记 + 接入(二选一)

D1. GUI agent → 走 MCP(推荐,不用 worker)

  • powershell powershell -ExecutionPolicy Bypass -File C:\hive\windows\bootstrap.ps1 ` -Apply -Register -Agent win10 -HiveHost win10 -Mode manual
  • 把打印的 JSON 粘进 agent 的 MCP 配置 (Claude/Cursor 用mcpServers,VS Code 用servers,Codex 用mcp_servers)
  • 重启 agent 客户端
  • 在对话里让它调hive_whoami✅ 返回"agent": "win10"+claimable列表

D2. 有命令行 agent → 走 worker(全自动)

  • powershell powershell -ExecutionPolicy Bypass -File C:\hive\windows\bootstrap.ps1 ` -Apply -Register -InstallTask -Agent win10 -HiveHost win10 -Mode verify
  • powershell Get-ScheduledTask -TaskName HiveWorker-win10 | Format-List State✅Ready或Running
  • powershell Get-Content C:\hive\logs\worker-win10.log -Tail 20✅ 有worker win10 启动

⚠️D1 和 D2 别同时开—— 两条路都会领卡,会重复劳动。

E. 在 FreeBSD 侧确认

  • sh python3 hive.py --dir ~/dswork/hive agent list✅ 看到win10 host=win10
  • sh python3 hive.py --dir ~/dswork/hive dispatch --host win10✅ 命令正常(没卡会提示"没有可分派的任务",也算通)

F. 第一张真卡(端到端)

  • 在 FreeBSD 写一张只改文档的小卡
  • sh python3 hive.py --dir ~/dswork/hive dispatch --host win10 --apply
  • Windows 侧领取并完成(D1 让 agent 调hive_claim,D2 等 worker 自动领)
  • sh python3 hive.py --dir ~/dswork/hive result T-xxxx✅status: done
  • sh python3 hive.py --dir ~/dswork/hive land T-xxxx --apply

G. 排障速查

现象处理
禁止运行脚本命令前加powershell -ExecutionPolicy Bypass -File
python 不是内部或外部命令重装 Python 勾 Add to PATH;或-Python C:\Python312\python.exe
Git 弹窗要密码用 Gitea 账号 +专门给 hive 仓的 access token
agent list没 win10-Register没加,或 push 失败(看 bootstrap 输出)
host 不是 win10登记时漏了-HiveHost win10,重跑 D 步
worker 日志could not readgit -C C:\hive pull,再重启计划任务
卡一直 running 但 VM 死了FreeBSD 上hive gc后hive retry T-xxxx
MCP 工具没出现配置粘错位置 / 没重启客户端 / 看客户端日志

三个最容易踩的坑

  1. -HiveHost必须和dispatch --host完全一致(大小写不敏感,但拼写要对)。漏了它就默认取 Windows 的COMPUTERNAME,可能叫DESKTOP-XXXX,你--host win10就永远派不到。
  2. D1/D2 二选一,双开会重复领卡。
  3. 第一次别跳过 C 步干跑——bootstrap.ps1在真机上没实跑过(只做过静态检查),先看 dry-run 输出确认 MCP 那段对了再加-Apply。

需要的话,你在 Windows 上跑到哪一步卡住,把输出贴给我,我帮你对照排。

返回列表