从入门到精通
dsh 插件
在 DeepSeek Harness 里直接触发/接管 Grape 流水线:工具集 + 侧边栏面板。
@grape-dev/grape-dsh 是给 DeepSeek Harness(dsh) 用的插件:在 dsh 里直接触发、监控、接管 Grape 流水线(场景)。它不部署任何服务,装在你的编码智能体一侧;真正干活的仍是 Grape 的引擎(部署在 Worker 上)。
它给你什么
| 面 | 内容 |
|---|---|
面向模型的 grape_* 工具 |
流水线触发/状态、Issue 生命周期、事件、场景、仓库、技能、知识库、看板、项目模板 |
| 侧边栏面板 + 聚焦钉 | 每个 Issue 一张流水线卡、节点链、接管操作、Worker 接入 |
两个面都通过 grape CLI 子进程(面板/接管走 HTTP API)与 Grape 通信,插件本身不存储任何密钥。
安装步骤
| 步骤 | 做什么 | 完成标志 |
|---|---|---|
| 第 1 步 | 准备 dsh、Node、grape CLI、Grape 地址和用户级 API Key | 版本满足要求,Key 可用 |
| 第 2 步 | 安装 @grape-dev/grape-dsh |
dsh plugin list 中出现插件 |
| 第 3 步 | 配置 cordis.patch.yml 的 baseUrl / token |
配置中包含 id: grape-tools |
| 第 4 步 | 重启 dsh 并验证插件 | --dump-config 能看到插件配置 |
| 第 5 步 | 接入本机 Worker,确认环境匹配 | 面板可启停,状态不是「环境不匹配」 |
第 1 步:准备前置与凭据
| 依赖 | 版本 | 用途 |
|---|---|---|
| dsh | 按插件 README 的版本要求 | 宿主环境 |
| Node.js | >= 18 |
dsh 与插件运行环境 |
| Python | >= 3.10 |
grape CLI |
| grape CLI | >= 0.3.3 |
工具传输(grape … --json-out) |
| Grape 服务端 | 含 takeover API | 接管、Worker 接入、面板路由 |
另外要一个 Grape 用户级 API Key(grape_…,在 用户设置 → API Keys 生成)和 Grape 的 base URL。
第 2 步:安装插件
推荐脚本
仓库自带安装技能 skills/grape-dsh-install/SKILL.md。把它指给你的 agent(dsh / Claude Code / Codex / opencode),让它按 preflight → install → verify 执行,第一个失败门就停。
bash · 确定性脚本(agent 也用它)
git clone --depth 1 https://gitcode.com/grape-dev/grape-dsh.git
bash grape-dsh/skills/grape-dsh-install/scripts/install.sh <profile>
# Windows: pwsh -File grape-dsh\skills\grape-dsh-install\scripts\install.ps1 -Profile <profile>
它会从源码构建 lib/、打包成 tgz 并安装,打印稳定的 tgz 路径。skipped: already-present 表示该版本已装。
手工安装(备选)
bash · 五条路,按需选一条
# 1) 已发布版本(0.5.0+ 自带 lib/)——最短路径,建议锁版本
dsh plugin --profile <profile> add @grape-dev/grape-dsh@<version>
# 2) 未发布 ref 或本地改动:从源码打 tarball 再装
cd grape-dsh && bash skills/grape-dsh-install/scripts/install.sh <profile>
# 3) 装已构建好的 tarball(离线/内网)
npm pack
dsh plugin --profile <profile> add file:/abs/path/grape-dev-grape-dsh-<version>.tgz
# dsh 会话内等价:plugin_manager install_bundle "<abs tgz>"
# 4) 从 git 装(能装,但 pnpm 的 prepare-script 门禁可能拦,优先 tarball)
dsh plugin --profile <profile> add git+https://gitcode.com/grape-dev/grape-dsh.git
# 5) 本地开发(link)
cd /path/to/grape-dsh && pnpm link --global
cd ~/.dsh/profiles/<profile> && pnpm link @grape-dev/grape-dsh
💡 要可复现就锁版本
profile 需要可复现时写精确版本;
npm view @grape-dev/grape-dsh version查当前发布版本。
第 3 步:配置插件
yaml · ~/.dsh/profiles/
- id: grape-tools
name: '@grape-dev/grape-dsh'
config:
baseUrl: 'https://<your-grape-domain>' # 必填,且是环境地址的唯一来源
token: 'grape_xxx' # 必填,只从 config 读
deviceName: 'dsh-worker-001' # 可选,必须以 dsh 开头
bin: '' # 可选 → GRAPE_CLI_BIN 或 PATH 里的 grape
timeout: 30
🚨 环境变量在这里不算数
插件只从 config 读
baseUrl与token,不再读GRAPE_BASE_URL/GRAPE_SERVER_URL/GRAPE_API_TOKEN,也没有内置默认值——配错会直接报错,而不是悄悄连到另一个服务端。
第 4 步:重启并验证插件
安装插件或修改 cordis.patch.yml 后,先重启 dsh 宿主或当前会话,让配置重新加载,再执行验证:
dsh plugin --profile <profile> list # 应含 @grape-dev/grape-dsh
dsh --profile <profile> --dump-config # 应含 id: grape-tools
✓ 期望结果:两条命令都命中;面板里能看到流水线卡与「接入本机」状态,不再是环境不匹配。
第 5 步:接入本机 Worker,确认环境匹配
本机 Worker 的 RUNTIME_SERVER_URL(在 ~/.grape/runtime.env)必须与 config.baseUrl 一致。不一致时面板判定该环境没有 Worker,显示「环境不匹配」,拒绝启停。
操作步骤
- 在 dsh 中打开 Grape 插件面板
- 如果显示「环境不匹配」,点击「接入本机」
- 等待插件重写
runtime.env,并按配置的deviceName重新签发凭据 - 确认面板不再提示环境不匹配,流水线卡可以正常启停
「接入本机」会覆盖本机的 Worker 地址和凭据。同一台机器要切换 Grape 环境时,必须重新接入,不能只改
config.baseUrl。
失败态
| 现象 | 原因 | 动作 |
|---|---|---|
| 面板显示「环境不匹配」 | runtime.env 的 URL ≠ config.baseUrl |
点「接入本机」重装,重写 runtime.env |
| 工具全报错但 dsh 正常 | grape CLI 不在 PATH,或版本 < 0.3.3 | 配 bin 或 GRAPE_CLI_BIN,升级 CLI |
| 401 / 403 | token 不是 grape_ 用户级 Key |
去 用户设置 → API Keys 重新生成 |
| 从 git 装失败 | pnpm prepare-script 门禁 | 改用 tarball 安装 |
完整资料在哪
| 文件 | 内容 |
|---|---|
grape-dsh/README.md |
工具清单、流水线状态语义、接管流程、本机 Worker 状态 |
AGENT-DEPLOYMENT-GUIDE.md |
装法的五个门禁、实测失败与修法 |
skills/grape-dsh-install/SKILL.md |
给 agent 执行的安装技能 |
相关
安装和启动方式 | CLI 命令行 | 运行时与 Worker | A2A 协作接口