dsh 国内网络引导:探测 npm/npmmirror/GitHub/HuggingFace/Gitee 与本地代理,读取注册表配置,推荐镜像/代理并生成 PowerShell + bash 引导脚本。默认只读,apply 显式。含 CLI 与 agent 可调用 cn_boot 工具。
安装
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:zoahdev/dsh-cn-boot
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
China-network bootstrap for DeepSeek Harness (dsh): one command that tells you why installs are slow or broken and what to do about it.
It probes the endpoints that matter to a dsh user in mainland China — npm registry, npmmirror, GitHub, raw.githubusercontent, Hugging Face, Gitee — plus common local proxy ports (127.0.0.1:7897 / 10809), reads your current npm/pnpm registry config, and returns concrete recommendations plus a copy-paste bootstrap script. Read-only by default; apply is an explicit opt-in that only sets the npm/pnpm registry to npmmirror.
Install
dsh plugin add dsh-cn-boot
Or run standalone:
npx dsh-cn-boot
CLI
dsh-cn-boot [--apply] [--json] [--timeout <ms>]
- Prints probe results, recommendations and a PowerShell + bash bootstrap script.
--applyrunspnpm config set registry https://registry.npmmirror.com(and npm) when recommended — the only side effect.- Exit codes:
0connectivity looks fine,1recommendations,2usage error.
npx dsh-cn-boot
npx dsh-cn-boot --apply
npx dsh-cn-boot --json
In-harness usage (agent-callable)
Ask your dsh agent:
检查一下我的网络连 dsh 依赖源通不通,给个引导建议。 Run a China-network bootstrap check:
cn_boot.
The tool returns a dsh-cn-boot/v1 result: per-target probe results, current registry config, recommendations, a generated script, and (only with options.apply: true) what was applied.
Checks
| Probe | Why |
|---|---|
registry.npmjs.org/-/ping |
official npm registry reachability |
registry.npmmirror.com/-/ping |
the standard China mirror |
github.com |
dsh source installs / docs |
raw.githubusercontent.com |
raw file downloads |
huggingface.co |
model/asset downloads |
gitee.com |
domestic fallback |
127.0.0.1:7897 / 127.0.0.1:10809 |
common local proxy ports (Clash / V2Ray) |
Why it exists
- The most common first-hour failure for dsh users in China is a network one:
pnpm dlx @deepseek-ai/dshhangs or ERESOLVE, GitHub clones time out,raw.githubusercontent.comis unreachable. - Existing tools tell you something is broken; this one tells you what and what to run next — mirror registry, proxy env, or nothing at all.
- Zero runtime dependencies, read-only by default, and the apply path is a single, explicit, reversible registry setting.
Development
pnpm install
pnpm typecheck
pnpm build
pnpm test
pnpm test:integration
CI runs the dsh-plugin-doctor preflight, unit tests, packed-artifact integration (real cn_boot invocation), and a fresh-profile dsh web boot smoke on Windows.
License
MIT © 2026 zoahdev
dsh-cn-boot(中文)
DeepSeek Harness(dsh)的国内网络引导插件:一条命令告诉你安装为什么慢/坏,以及该怎么做。
它探测国内 dsh 用户最关心的端点——npm 官方源、npmmirror、GitHub、raw.githubusercontent、Hugging Face、Gitee——以及常见本地代理端口(127.0.0.1:7897 / 10809),读取当前 npm/pnpm 注册表配置,返回具体建议和一份可直接复制的引导脚本(PowerShell + bash)。默认只读;apply 是显式开关,唯一副作用是把 npm/pnpm 注册表设为 npmmirror。
安装
dsh plugin add dsh-cn-boot
独立使用:
npx dsh-cn-boot
CLI
dsh-cn-boot [--apply] [--json] [--timeout <ms>]
- 输出探测结果、建议和 PowerShell + bash 引导脚本。
--apply在推荐时执行pnpm config set registry https://registry.npmmirror.com(以及 npm)——唯一的副作用。- 退出码:
0网络正常,1有建议,2用法错误。
npx dsh-cn-boot
npx dsh-cn-boot --apply
npx dsh-cn-boot --json
在 harness 内使用(agent 可调用)
对 agent 说:
检查一下我的网络连 dsh 依赖源通不通,给个引导建议。
工具返回 dsh-cn-boot/v1 结果:各目标探测结果、当前注册表配置、建议、生成脚本,以及(仅当 options.apply: true 时)已执行的操作。
为什么需要它
- 国内 dsh 用户第一小时的失败大多是网络问题:
pnpm dlx @deepseek-ai/dsh卡住或 ERESOLVE、GitHub clone 超时、raw.githubusercontent 不通。 - 现有工具只告诉你“坏了”;这个插件告诉你“哪里坏、下一步跑什么”——换镜像、走代理,或者什么都不用动。
- 零运行时依赖、默认只读,apply 路径是单一、显式、可逆的注册表设置。
开发
pnpm install
pnpm typecheck
pnpm build
pnpm test
pnpm test:integration
CI 跑 dsh-plugin-doctor 预检、单元测试、打包集成(真实 cn_boot 调用)、Windows 全新 profile 的 dsh web 启动冒烟。
许可证
MIT © 2026 zoahdev
Related ecosystem tools
- dsh-dep-audit - dependency supply-chain hygiene
- dsh-quality-score - plugin quality scorecard + full-registry leaderboard
- dsh-ecosystem - health scan, impact, trend, live dashboard
- dsh-tutorials - bilingual plugin pipeline tutorials
FAQ
- How do I install? dsh plugin add dsh-cn-boot or run the CLI directly (see README).
- Does it need an API key? No.
- Is it read-only? Yes by default; any write/apply is an explicit flag.
Examples
See the README for full CLI usage. Quick start:
npx dsh-cn-boot --help
链接
同类插件
yjh051108/dsh-routing-suite★ 7000
一个仓库三件套:DSH 插件包的运行时注入器(注入、热重载、卸载、开发侧挂区一键转正、路由自愈,外带设置页插件管理:列出、卸载、拖入文件夹内化)、任务感知的思维模式路由 agent 预设(router-standard / router-spec / router-react)、以及分级两级任务协议(commit_star / lock_stage / revise_do / edit_plan / mark_task / redteam_verdict 六个工具,任务状态落盘)。注入器实现直接在库内,安装的是它自己的行为而不是一份依赖清单。
strukto-ai/mirage#dsh★ 3678
把文件系统与 bash 提供者换成 mirage 虚拟工作区:文件工具与 shell 命令作用于挂载的资源(RAM、S3、Redis、Slack、Gmail、Notion、Postgres)而非宿主磁盘,支持按挂载点设置读/写/执行模式、按命令选择沙箱(进程内 monty、pyodide、quickjs;远程 docker、e2b、daytona),并可在虚拟终端中安装 CLI(git、gh、slack、linear、ntn、gws,或自行注册的程序树)作为命令头词。
hust-open-atom-club/oh-dsh★ 324
社区发行版:TUI、桌面端与 Web UI 统一体验,分层安装、一步到位。
weijiafu14/pi2dsh★ 212
Pi Host ABI 兼容引擎:装一次之后,npm 上的 Pi 扩展原包经 `dsh plugin add <pi-package>` 直接作为 DSH 原生插件挂载。已在官方 DSH 上端到端验证 pi-mcp-adapter(完整 MCP 管理面:OAuth、resources、prompts、MCP Apps、elicitation、sampling)、@tintinweb/pi-subagents、pi-code、pi-hermes-memory、pi-background-tasks;`pi2dsh inspect` 在安装前报告一个包的兼容情况。
Fishquito7/dsh-skill-mcp-panel★ 175
在 DSH Web 设置中管理技能与 MCP 服务器:技能卡片热启停、工作区作用域、分组、批量迁移与拖拽导入,以及 stdio/HTTP MCP 增删改查、连接测试、密钥脱敏,并附带统一 dsh-panel 命令行。
lire1131/dsh-undo-savepoint★ 172
DSH 撤销/回退系统:配置变更自动存档,一键撤销/恢复/回退到任意版本,支持 WebUI 与离线 CLI/GUI 工具(DSH 启动失败也能救)。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。