💡 Idea: Add 'dsh doctor' CLI command for environment & dependency diagnostics #1719
Replies: 15 comments 2 replies
|
这个设想已经有一个可用的社区实现,而且不止环境诊断:dsh-plugin-doctor(v1.3.0)把"发布前插件体检 + profile 宿主遮蔽检测 + 环境诊断"三件事合并成一个命令。 对应你提的检查项
用法npx dsh-plugin-doctor --env # 环境诊断(等 npm 发布后;现在可从 GitHub Release 装)
node lib/bin.js --env # 仓库内直接跑
node lib/bin.js --full ./my-plugin # 插件发布前完整自检
node lib/bin.js --profile ~/.dsh/profiles/web验证
如果官方想把它收编成 |
|
Adding the other community data point to this: there's a second, older offline diagnostic for the same niche — moonquake2004/dsh-doctor (19 checks mapped to 18 community failure reports: env 7 / profile 4 / session 8, all fixture-verified). Mapping your four proposed groups to it:
The two community tools are complementary (his = author-side pre-publish bundle checks + profile tripwire; ours = user-side profile/session/env offline diagnostics + a self-updating remote check catalog), so the ecosystem already has the substance. The most useful thing an official |
|
Thanks for the independent verification — that means a lot coming from the author of the P5 check. I've cross-linked both tools so users find the complementary path from either side:
Your E-check mapping is a good framing: Also: the |
|
Reciprocal link is in: dsh-doctor README → Related community tools now lists dsh-plugin-doctor (commit On the
If you publish a mapping table, we'll mirror it in our README and keep the JSON shape ( |
|
既然两边实现都在(dsh-plugin-doctor 的 建议规格:
|
| 组 | 检查 | 来源 |
|---|---|---|
| env | node 版本 / pnpm / zstd / dsh on PATH / node-pty 原生二进制 | dsh-doctor E1/E3/E4 + doctor --env |
| profile | profile 顶层真实目录 @deepseek-ai/* 副本(宿主遮蔽)、profile 合成配置可解析 |
dsh-doctor P5 + doctor --profile |
| session | 会话目录可写、session 文件 JSON 合法、残留锁 | dsh-doctor S 组 |
| runtime | cordis 配置语法、插件 bundle 可加载、--dump-config 包含预期插件 id |
doctor --full 的 manifest/patch/install |
| port | Web UI 端口(3080)可用 | doctor --env |
JSON 输出:
{ "ok": false, "checks": [ { "name": "profile-shadow", "status": "FAIL", "detail": "..." } ] }为什么这样设计:
- 退出码 0/1/2 让 CI 和用户脚本都能直接用;
profile-shadow这类检查必须 FAIL(不是 WARN),因为它是 Bug: installing any plugin that depends on @deepseek-ai/dsh-tools breaks every tool call (Cannot read properties of undefined (reading 'prepare')) #1697 那种"装了必炸"的前置条件;- WARN 只用于"可用但可优化"(如 dsh 不在 PATH 时,doctor 仍能跑插件检查)。
现有两个社区实现都输出兼容这个形状的数据;如果官方愿意收编,可以直接把两边 check 清单合并成一个 RFC 文档,我再补一版完整映射表。
|
The spec is well-structured — two sync points from our side: Two items in the spec landed in our 0.2.3 release just now. The JSON shape alignment is straightforward. We currently emit +1 on the RFC consolidation. I can contribute a full check-inventory mapping table (20 built-in checks + the remote catalog rules) for the RFC doc — happy to align our check-id scheme with whatever the official command settles on. |
|
v1.4.0: dsh-plugin-doctor --env --port 8090 --jsonRelease:https://github.com/zoahdev/dsh-plugin-doctor/releases/tag/v1.4.0 |
|
Great — looking forward to the mapping table. One addition to fold in from the start: our env group now has E10 (port 3080 availability), which landed in 0.2.3 (published earlier today). It's the For reference, our full env group today is:
We'll mirror the final mapping in our README once you share it, and keep our JSON output shaped as |
|
As promised in #1697 ? here is a concrete proposal for syncing the two doctor contracts so dsh-doctor contract v1 (proposed)Envelope{
"schema": "dsh-doctor/v1",
"generatedAt": "2026-08-15T00:00:00.000Z",
"profile": "web",
"exitCode": 0,
"summary": { "pass": 18, "warn": 1, "fail": 0 },
"checks": []
}Single check{
"group": "profile",
"name": "profile-shadow",
"status": "pass",
"message": "no @deepseek-ai scope at profile top-level node_modules",
"hint": "?optional actionable fix?",
"data": {}
}
Exit codes (shared with
|
|
{
"schema": "dsh-doctor/v1",
"generatedAt": "...",
"profile": "...",
"exitCode": 0,
"summary": { "pass": 2, "warn": 0, "fail": 0 },
"ok": true,
"checks": [ { "name": "...", "status": "pass" | "warn" | "fail", "detail": "..." } ]
}
Release: https://github.com/zoahdev/dsh-plugin-doctor/releases/tag/v1.6.0 |
|
Contract acceptance harness is now real and green for the zoahdev side:
Result (v1.6.0, Windows, real run): For
Either way, the fixture set is ready ? clean/BOM/shadow profiles with exact exit-code expectations. Happy to iterate on the shape here before it hardens. |
|
Adopted the envelope — option ① landed in
Fixture coverage for the envelope (in Happy to run your |
|
社区先行版已可用:https://github.com/ciceroyang/dsh-doctor 零依赖单文件 CLI,覆盖提案中的检查项 + 三个实战补充:
输出 ok/warn/fail 三态 + 可执行建议,支持 --json。用法: 如果官方未来做内置 dsh doctor,这个可以继续作为生态版参考实现;在此之前它可以直接帮用户自诊。欢迎试用反馈。 |
|
Welcome to the niche — three implementations now, converging nicely. Two suggestions:
Thanks for the Node ≥22.15 note on reading history session logs — we have that as an E3 detail hint; will cross-check our wording against yours. |
|
对齐完成 — ciceroyang/dsh-doctor 0.3.0 已采纳 dsh-doctor/v1 信封(commit 2429f7e)。
关于 BOM fixture:我方目前没有 cordis.patch.yml 的结构化 lint(P7 级别的检查不在当前检查项内),所以 BOM 场景不在我方断言范围——如果契约里 BOM 需要 FAIL,建议在信封标准里明确"哪个检查、针对哪个文件",三方一起实现,避免各家语义漂移。 三方实现现在可互换了:CI/marketplace 脚本用同一个信封驱动。如果官方未来内置 dsh doctor,这个契约可以直接接管。 |
Uh oh!
There was an error while loading. Please reload this page.
Hello,
A common friction point during local setup is troubleshooting runtime environments (e.g., missing local 'pnpm' binaries, Node version mismatches, or unconfigured PATH variables).
Adding a lightweight diagnostic command like 'dsh doctor' (or 'npx @deepseek-ai/dsh doctor' ) would make setup troubleshooting much smoother:
Proposed checks:
3080) is free before launching.This would allow users to quickly self-diagnose setup failures before opening issues.
thanks
All reactions