@cloudbase/dsh-plugin

中文文档
0.2.4发布于 2026/11/09MITTypeScriptES Module零依赖构建来源已验证近 30 天下载 1940

CloudBase backend for DeepSeek Harness — database, storage, authentication, and frontend/backend deployment

原始使用文档
文档目录12 节
  1. 安装
  2. 登录(device-code,无需 API Key)
  3. 功能
  4. 注意事项
  5. 来源与权限
  6. 开发
  7. License
  8. Install
  9. Login
  10. Notes
  11. Privacy
  12. License

@cloudbase/dsh-plugin

在 DeepSeek Harness 里,从一句话到可用的全栈应用。

你在 DSH 里 vibecoding 时,最烦的事是什么?模型很聪明,但写完代码没地方跑——数据库要开控制台建、文件要自己传、部署要切去另一个网站。一离开对话,心流就断了。

@cloudbase/dsh-plugin 把 CloudBase 后端搬进 DSH:

  • 数据库:文档库和 PostgreSQL,对话里建表和查询
  • 存储与认证:上传文件,配置登录
  • 前后端部署:前端托管和后端部署,拿到可访问地址

你的模型(DeepSeek / Claude / 随便换)、你的后端(自己的 CloudBase 环境)、你的数据(本地会话 + 自己数据库)。

CloudBase backend for DeepSeek Harness. Compatible with DSH >=0.1.0-rc.6 <0.3.0 (verified on 0.2.0-rc.2; declared as engines.dsh and enforced by DSH 0.2.1+) · Node >=18 · MCP tools follow @cloudbase/cloudbase-mcp@latest.

安装

Web UI(含工具卡片):

curl -fsSL https://raw.githubusercontent.com/TencentCloudBase/CloudBase-AI-Toolkit/main/dsh-plugin/scripts/install.sh | bash

或手动:

dsh plugin --profile web add @cloudbase/dsh-plugin
# pnpm ≥9 默认禁止依赖 install 脚本(protobufjs 会失败)
echo "enable-scripts=true" >> ~/.dsh/profiles/web/.npmrc
(cd ~/.dsh/profiles/web && pnpm install)
# UI 插件需要重建 DSH web 前端
pnpm --dir "$(dirname "$(dirname "$(command -v dsh)")")" run build:web || true
dsh --profile web

Headless(只要 MCP 工具,不要前端构建):

dsh plugin --profile headless add @cloudbase/dsh-plugin
dsh --profile headless "列出所有 mcp__cloudbase__ 工具"

登录(device-code,无需 API Key)

插件不传任何 CloudBase env、不传 API Key,登录走 cloudbase-mcp 自身的 device-code 流程(本机已有 tcb login 登录态时直接复用)。无登录态时,对模型说:

调用 mcp__cloudbase__auth,action=start_auth,authMode=device,把 verification URL 给我。

浏览器授权一次后登录态持久化。再用 mcp__cloudbase__auth(action=set_env)选择环境,后续工具自动使用该环境。

功能

能力说明
MCP 桥在对话里调用 CloudBase 工具(mcp__cloudbase__*)
DataTableCardqueryPgDatabase / queryMysqlDatabase / readNoSqlDatabaseContent 结果表格:分页、排序、复制 JSON、导出 CSV
DeployPreviewCardmanageHosting upload 后 iframe 预览真实域名 + 打开按钮
交付物行会话尾部展示产物路径 + 域名
Sites skilldownloadTemplate(react) → Vite → 建表 → manageHosting → 域名

写操作(SQL / 上传 / 删行)一律注入会话,由模型按 DSH approval 执行,插件 UI 不绕过权限模型。

注意事项

  1. pnpm v9+ 默认禁止依赖 install 脚本:必须 enable-scripts=true 后再 pnpm install(一键脚本已包含此步)。
  2. Web UI 插件要重建 DSH web 前端:装完看不到卡片时,从 DSH 安装目录执行 pnpm run build:web 再重启;Headless 不需要。
  3. 首次 npx 拉包可能 10–90s:headless 首轮工具列表可能为空,重试即可。
  4. 不要给插件配置 CLOUDBASE_API_KEY:无效 Key 会挡住 device-code 登录。登录与环境选择全部走 mcp__cloudbase__auth。
  5. 技能由插件注册,不拷进 ~/.dsh/skills。环境用 auth 的 set_env 绑定,用 action=status 查看。插件不会按会话自动改环境。

来源与权限

这个包由 TencentCloudBase 发布,源码在 CloudBase-AI-Toolkit,按 MIT 许可开放。

工具会在你的工作区里建文件、改代码、上传部署产物,并访问你自己的 CloudBase 环境。写操作回到会话里等你确认,界面不会绕过审批。插件会启动本机的 cloudbase-mcp 进程,但不会把 API Key 或代理设置传进去。

凭据只存本机:复用 tcb login 的登录态,或放在 ~/.dsh/.credentials.yaml(权限 600)。插件不上传密钥。

开发

cd dsh-plugin
npm install
npm test          # vitest 单测
npm run build     # dist/index.js(Host)+ dist/client.js(Web ModuleLoader factory)
npm run e2e:live     # 需要网络 + 本机 tcb 登录态
npm run verify:host  # 需要 DSH_BIN;在临时环境里装一次、看配置与工具、卸载,再试升级后用户配置还在

CI 每天会拿 DSH 的最新版再跑一遍 verify:host,结果记在 workflow 运行记录里。新版本超出声明范围时会直接报失败,提醒重新验一遍再决定要不要放宽范围。

除 peer(cordis / react)外运行时 0 依赖。

License

MIT


English

CloudBase backend for DeepSeek Harness. Database, storage, authentication, and frontend/backend deployment from chat, through the CloudBase MCP tools.

Install

Web UI:

curl -fsSL https://raw.githubusercontent.com/TencentCloudBase/CloudBase-AI-Toolkit/main/dsh-plugin/scripts/install.sh | bash

Headless (MCP bridge only, no frontend rebuild):

dsh plugin --profile headless add @cloudbase/dsh-plugin

Login

No env and no API key are forwarded — login goes through cloudbase-mcp's device-code flow (reuses local tcb login state). If unsigned, ask the model to call mcp__cloudbase__auth with action=start_auth, authMode=device, then pick an environment with action=set_env.

Notes

  1. pnpm v9+ blocks dependency install scripts — set enable-scripts=true first (the one-shot script handles this).
  2. Web UI plugins require rebuilding the DSH frontend: pnpm run build:web in the DSH install dir. Headless does not.
  3. First npx fetch can take 10–90s; retry the headless turn if tools are missing.
  4. Never configure CLOUDBASE_API_KEY — an invalid key blocks device-code login.
  5. The CloudBase skill is registered by the plugin and is not copied into ~/.dsh/skills. Bind an environment with auth set_env, and inspect it with action=status. The plugin does not rebind the environment when the chat session changes.

Privacy

Credentials stay local (tcb login state or ~/.dsh/.credentials.yaml, mode 600). The plugin does not upload secrets.

License

MIT

版本与发布记录

@cloudbase/dsh-plugin 共发布 9 个版本,首次发布于 2026/09/04;过去 12 个月发布了 9 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.2.4latest2026/11/091 天前
0.2.32026/09/301 个月前
0.2.22026/09/301 个月前
0.2.12026/09/301 个月前
0.2.02026/09/301 个月前
0.1.32026/09/291 个月前

关于 @cloudbase/dsh-plugin 的常见问题

@cloudbase/dsh-plugin 是什么?

CloudBase backend for DeepSeek Harness — database, storage, authentication, and frontend/backend deployment

如何安装 @cloudbase/dsh-plugin?

在项目目录运行 npm install @cloudbase/dsh-plugin,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 cloudbase-skills,可以用 npx cloudbase-skills 直接运行。

@cloudbase/dsh-plugin 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@cloudbase/dsh-plugin 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@cloudbase/dsh-plugin 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@cloudbase/dsh-plugin 可以商用吗?

@cloudbase/dsh-plugin 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@cloudbase/dsh-plugin 的下载量有多少?

根据 npm 官方下载统计,@cloudbase/dsh-plugin 在 2026/10/10 – 2026/11/08 这 30 天内被下载 1,940 次,日均约 65 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@cloudbase/dsh-plugin 还在维护吗?

最新版本 0.2.4 发布于 2026/11/09(1 天前);至今共发布 9 个版本,其中过去 12 个月发布了 9 个;首次发布于 2026/09/04。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。