dsh-plugin-backup: Backing up DSH plugin manifests outside `.dsh`

Introduction

DeepSeek Harness (DSH) records installed plugins in the profile directory. A Harness update may wipe plugins in the profile, silently change versions, or disable bundles and individual plugin rows. If backups are also stored inside .dsh, they disappear along with the plugins when an update resets the entire directory. The following introduces the community plugin dsh-plugin-backup (maintainer Kirin-9000, category admin-security): it persists the manifest to a configurable local directory, compares differences after an update, and restores after confirmation in the UI.

What This Is

dsh-plugin-backup is a plugin backup and restore tool for DSH. It collects the package names, exact versions, installation source specs, and enabled states of plugins currently installed in the profile, writes them as readable JSON, and stores it outside the profile and .dsh. After a Harness update, it compares “backup vs current” and, upon selection, restores item by item through the Harness official plugin installation interface. Restoration only uses pluginManager.installBundle / removeBundle / setBundleEnabled / setPluginEnabled; installation must be confirmed by you in the UI. The plugin does not run installation scripts on your behalf, nor does it guess installation sources based on version numbers. Manifests and logs are only written to local disk.

See the source code and documentation at GitHub repository; community directory page: skillhub.cn/plugins/Kirin-9000/dsh-plugin-backup. MIT license, package version 1.0.0. The plugin runs with the permissions of the current dsh process; please review the source code and license yourself before installing.

Three Things It Solves

  1. Backup: Writes currently installed plugins to JSON; the default directory is $DSH_HOME/plugin-backup/, but it is recommended to move it outside .dsh. It performs an automatic backup about 5 seconds after startup, skipping if the manifest is unchanged and the latest snapshot is less than a day old. Manual “Back up now” is available anytime, retaining at most 20 snapshots by timestamp.
  2. Detection: Compares the backup with the current installation; differences fall into five categories: missing (in backup, not currently installed), version-mismatch, disabled (entire bundle disabled), row-disabled (individual plugin row disabled), row-missing (plugin row does not exist).
  3. Restore: One-click restore after selection in the UI, with a second confirmation; executes item by item and shows progress. Failures are logged and the process continues without interrupting the batch. The idempotent design means steps whose state is already satisfied are skipped.

Installation and Entry Point

Method 1: dsh command line (profiles managed by the CLI, such as web):

dsh plugin --profile web add git+https://github.com/Kirin-9000/dsh-plugin-backup.git

If the profile is not named web, replace the name accordingly. After restarting or refreshing, open Settings → Plugins → “Backup and Restore”.

Method 2: DSH Desktop
Desktop profiles are managed by the in-app plugin manager and cannot be modified by the command line during runtime. Please install via the app’s Settings → Plugins, or link the repository into the profile’s node_modules in a development manner (see the README’s “Method 3”).

Typical Usage

After installation, use each block from top to bottom:

Block Purpose
Top Last backup time, plugin count, current installed count, backup directory; “Back up now” and “Refresh” buttons
Backup storage location View and switch the backup directory
Restore from a specified JSON file Enter a path or click “Choose file…” to restore from any manifest
Backed-up plugins Complete manifest in the snapshot, plus current state and whether it can be automatically restored
Detected differences Lists only abnormal items; after selection, click “Restore selected”
Restore progress / log Real-time progress and recent records from log.jsonl

Move the backup outside .dsh (recommended)

  1. In the UI: Backup storage location → Change location → enter a directory (e.g., D:\dsh-backups) → Save location (a probe file is written before saving to verify writability).
  2. Environment variable: Set DSH_PLUGIN_BACKUP_DIR and restart DSH; it has the highest priority.

Priority order: DSH_PLUGIN_BACKUP_DIR > settings.json inside .dsh > home directory mirror ~/.dsh-plugin-backup-location.json > default $DSH_HOME/plugin-backup/. After .dsh is reset, the directory can be recovered via the home directory mirror; the UI will show “Custom (recovered via home directory mirror)”, and clicking Save location once will restore the official record.

Restore from any JSON
Not limited to latest.json. Supports standard snapshot { "bundles": [ ... ] } or minimal array [{"name": "...", "version": "..."}]. Entries missing source are marked “No installation source, manual installation required”; during restoration, it will not construct npm package names from version numbers for installation.

See the README for example snapshot fields: schemaVersion, createdAt, dshVersion, profile, bundles (including name, version, source, enabled, rows).

Other Capabilities

  • Agent tool plugin_backup: Read-only status, triggers backup; optional file to read a specified manifest. Restore is only performed in the user interface; the tool does not install any packages.
  • Native system file dialog (Windows + PowerShell): filters .json; other environments fall back to the built-in .json browser.
  • Exact version restore: Reinstalls based on the backup’s package-name@version; git / tarball / local directories are handled according to the original source.
  • Zero dependencies: Only uses Node built-in modules and host pluginManager / webServer / tools; does not require Harness Client packages.

The HTTP side consists of same-origin POST requests: status, backup, restore, settings, load-file, pick-file, list-files, log (see the README for details).

Applicable Scenarios and Notes

Suitable for users who maintain many DSH plugins long-term and worry about Harness updates wiping or tampering with profiles. The plugin does not record bundles that ship with the DSH installation (availability: 'installation'). If pendingBuilds is encountered, it prompts you to go to Settings → Plugins to approve installation scripts yourself. Versions incompatible with the current DSH require waiting for a plugin update or granting a version exemption. If any restoration item fails, it is only logged and the process continues; a success/failure summary is shown at the end.

For troubleshooting, refer to the README: entries without an installation source need to be manually installed and then re-backed-up; if the panel shows the default directory after an update, check the home directory mirror; “Effective after restart” after restoration is a normal restart-required prompt.

Conclusion

dsh-plugin-backup decouples the plugin manifest from .dsh, using diff detection and UI-confirmed restoration workflows to reduce the cost of re-finding plugins one by one after updates. Directory page: https://www.skillhub.cn/plugins/Kirin-9000/dsh-plugin-backup; source code and issues: https://github.com/Kirin-9000/dsh-plugin-backup.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye