dp419936514/dsh-plugin-updater ↗★ 1

dsh-plugin-updater

提供DSH插件的更新与卸载管理,支持自动备份、组合校验、冒烟测试与回滚。 适合需要安全管理DSH插件更新与卸载,并要求失败自动回滚的系统管理员。

套件
dsh-plugin-updater
相容性
待驗證
版本
0.3.0
授權
MIT
最近更新
2026年9月14日

同名套件的其他儲存庫

安裝

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:dp419936514/dsh-plugin-updater

使用

设置页

  1. 打开分区时会自动读一次清单,也可以点右上角「刷新清单」;
  2. 勾选要更新的插件(精确锁定的默认不勾,标了 已锁定),选模式;
  3. 点「一键更新所选」,点一次是确认,再点一次开始执行。进度日志里能看到 pnpm 输出、组合校验和启动冒烟;
  4. 成功后点「重启 dsh」生效。失败会自动回滚,原因写在日志里;
  5. 卸载在插件行右侧,同样是点两次确认,进度日志和更新共用一套;
  6. 需要时在回滚区挑一个备份回滚。

命令行

dsh 起不来时用这条通道:

cd ~/.dsh/plugins/dsh-plugin-updater   # 或者 clone 目录
node bin/dpu.mjs check                  # 清单与可更新项,profile 自动检测
node bin/dpu.mjs update --yes           # 更新所有可更新项,精确锁定的跳过
node bin/dpu.mjs update --targets dsh-cost-meter --yes     # 只更新一个,含锁定插件
node bin/dpu.mjs uninstall --targets dsh-cost-meter --yes  # 卸载,加 --force 才能卸更新器自身
node bin/dpu.mjs rollback               # 回滚到最新备份
node bin/dpu.mjs backups                # 备份列表与操作历史
node bin/dpu.mjs restart [--unit dsh-web.service] --yes    # 重启 systemd 用户服务

行内配置(可选)

在 profile 的 cordis.patch.yml 里覆盖:

- id: plugin-updater
  config:
    profile: web         # 管理哪个 profile,默认自动检测本插件所在的 profile
    bootVerify: true     # 改完是否真启动一次,关掉就只做组合校验

环境变量 DPU_RESTART_MODE=self|systemd 和 DPU_RESTART_UNIT= 可以强制重启方式。