ZhijiangTang/dsh-plugin-template ↗★ 0
dsh-plugin-template
DSH bundle-plugin template: scaffold a new tool plugin (the template itself is not published).
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:ZhijiangTang/dsh-plugin-template说明文档
阅读完整 README ↗dsh-plugin-template
DSH 组合包(bundle)插件模板:脚手架一个新工具插件的最小可用骨架。
本仓库本身不是可安装插件(package.json 里 private: true,keywords 是 dsh-plugin-template,不发布 npm)。
- 纯 ESM、零依赖、无构建步骤
- 一个
hello_world占位工具(含参数 / 输出 schema / render / execute) - mount 自检走
ctx.tools.execute真实管道(CallId 来自@deepseek-ai/dsh-llm)
开发前必读:
../notes/plugin-development.md(本 hub 的实测笔记,所有结论均已验证)。官方文档本地副本在../reference/,发布教程见 https://deepseek-harness.github.io/deepseek-harness/develop/basic/publish.html
使用步骤
以下示例以新包名
dsh-mytool为例。
1. 克隆 / 复制模板
# 方式 A:在本 hub 内用脚手架(推荐)
bash scripts/scaffold.sh dsh-mytool # 生成 ../dsh-mytool/ 并替换占位符
# 方式 B:作为 GitHub 模板仓库 clone 后手工改
git clone dsh-mytool && cd dsh-mytool
2. 改 package.json(哪些字段要改)
| 字段 | 模板值 | 要改成 |
|---|---|---|
name | dsh-plugin-template | 你的 npm 包名(如 dsh-mytool) |
private | true | 删除(要发布 npm) |
keywords | ["dsh-plugin-template"] | ["dsh-plugin", ""] |
description | 模板描述 | 你的插件一句话描述 |
version | 0.1.0 | 按语义化版本维护 |
用脚手架
scaffold.sh会自动完成前两项(删private+ 改写name/keywords)。
3. 改 cordis.patch.yml 的 id / name
cordis.patch.yml 里 id: 是稳定身份(不带 id 的行每次启动重新挂载);name: 按 npm 包名 引用代码。
4. 改 index.js 的工具
index.js 里所有「改这里」注释:插件名 export const name、工具名 name: 'hello_world'、参数 / 输出 schema / execute 逻辑。