把 Claude 风格的插件加载进 DeepSeek Harness(dsh):扫描 Claude 插件目录,接入 skills、commands 与可选的 SessionStart hooks,支持命令热更新与卸载清理。
安装
# npm 包(预构建)
dsh plugin --profile web add dsh-claude-plugin-loader
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:patrick1099/dsh-claude-plugin-loader
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。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
dsh 运行时装载器的最小原型:让 dsh 直接发现并加载 Claude 式组合体插件(目录含 .claude-plugin/plugin.json)。
完整使用说明见 GUIDE.md:安装、扫描目录、配置、验证、常见问题。
当前已实现:
- 扫描插件源:默认扫
~/.claude/plugins/cache(Claude 插件缓存),可用pluginRoots配置额外根目录。 - 按插件名去重,活源优先,缓存内保留最高版本。
- 支持
enabledPlugins配置:只暴露本机[plugins.dsh].enabled且 manifest 声明dsh的插件 skill。 - skills 通道:把每个插件的
skills/注册成 dsh skill provider,模型可以用 dsh 原生skill/skill_search按名发现和加载插件里的 SKILL.md。 - 状态工具
claude_plugin_status:只读列出已发现插件及通道(skills/hooks/mcp/commands/agents)。 - SessionStart hook 桥(最小,默认关闭):解析
hooks.json里的SessionStartcommand hook,在agent/session-start时执行并把 stdout 注入会话上下文。需要在配置里显式开sessionStartHooks: true,避免自动执行有副作用的 hook。 - commands 通道(注册 + 程序化执行已验证):把 Claude plugin
commands/*.md注册成 dsh 斜杠命令(ctx.commands.register),执行时把命令模板注入 agent。已通过claude_plugin_commands确认命令进入ctx.commands,并用claude_plugin_run_command程序化执行/hello Alice成功。Web 侧已验证:loader 已装进webprofile,命令列表commands/list能看到hello,commands/execute /hello Alice返回kind=success。交互式 TUI 斜杠命令:loader 已装进cc-tuiprofile,本机 cache 里有tmp-loader-test测试插件;自动化 PTY 输入尚未稳定复现,请人工在dsh --profile cc-tui敲/hello Alice做最终确认。 - commands 热更新 + 卸载清理:loader 定时重扫插件根目录(默认 1500ms,可用
reloadIntervalMs调),插件命令被新增/修改/移除时自动注册/更新/注销;插件从磁盘删除或从enabledPlugins消失后,对应斜杠命令也会被清理。
尚未实现(下一迭代):
- PreToolUse 拒绝 / tool-rewrite 等其它 hook 意图,以及外部脚本协议桥的完整形态。
- MCP 配置生成(
mcpServers→@deepseek-ai/dsh-mcp-client配置行)。 - agents 通道。
- 第三方插件兼容边界记录。
测试
node --test dsh-claude-plugin-loader/test.mjs
覆盖:插件命令注册、插件移除后命令注销、命令模板变更后热更新。
安装(推荐:npm / dsh plugin)
# 装进 web 界面
dsh plugin --profile web add dsh-claude-plugin-loader
# 或装进 CLI/TUI profile
dsh plugin --profile cc-tui add dsh-claude-plugin-loader
# 或装进一次性 headless profile
dsh plugin --profile headless add dsh-claude-plugin-loader
重启对应 dsh 后生效。也可在 dshmarket 的 Settings → Plugin Market 里搜索安装(需要先收录到 awesome-dsh-plugin 仓库)。
默认扫描:
~/.claude/plugins/cache
也就是 Claude Code 自己的插件缓存。没有配置 pluginRoots 时自动使用它;要额外扫别的目录,在 profile 的 cordis.patch.yml 里加配置即可:
- id: claude-plugin-loader
name: dsh-claude-plugin-loader
config:
pluginRoots:
- "C:/path/to/shared/plugins"
- "C:/Users/<you>/.claude/plugins/cache"
# enabledPlugins:
# - "cjt"
# - "note-workflow"
# reloadIntervalMs: 1500 # optional; 0 disables the background reload loop
手动安装(开发调试用)
把 dsh-claude-plugin-loader.mjs 放进目标 profile 目录(例如 ~/.dsh/profiles/headless/),
然后在 cordis.patch.yml 插入:
- insert:
- id: claude-plugin-loader
name: ./dsh-claude-plugin-loader.mjs
config:
pluginRoots:
- "C:/path/to/shared/plugins"
- "C:/Users/<you>/.claude/plugins/cache"
enabledPlugins:
- "cjt"
- "note-workflow"
- "repo-keeper"
- "superpowers-manual"
- "vibe-flow"
- "projx-csb-skills"
- "xu-skills"
# reloadIntervalMs: 1500 # optional; 0 disables the background reload loop
验证:
dsh --profile headless --dump-config
dsh --profile headless "Call claude_plugin_status and repeat its output."
dsh --profile headless "Load the cjt skill."
链接
同类插件
yjh051108/dsh-routing-suite★ 7014
一个仓库三件套:DSH 插件包的运行时注入器(注入、热重载、卸载、开发侧挂区一键转正、路由自愈,外带设置页插件管理:列出、卸载、拖入文件夹内化)、任务感知的思维模式路由 agent 预设(router-standard / router-spec / router-react)、以及分级两级任务协议(commit_star / lock_stage / revise_do / edit_plan / mark_task / redteam_verdict 六个工具,任务状态落盘)。注入器实现直接在库内,安装的是它自己的行为而不是一份依赖清单。
strukto-ai/mirage#dsh★ 3682
把文件系统与 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★ 322
社区发行版: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★ 193
在 DSH Web 设置中管理技能与 MCP 服务器:技能卡片热启停、工作区作用域、分组、批量迁移与拖拽导入,以及 stdio/HTTP MCP 增删改查、连接测试、密钥脱敏,并附带统一 dsh-panel 命令行。
lire1131/dsh-undo-savepoint★ 179
DSH 撤销/回退系统:配置变更自动存档,一键撤销/恢复/回退到任意版本,支持 WebUI 与离线 CLI/GUI 工具(DSH 启动失败也能救)。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。