dsh-cjbf: Backup DSH plugin and configuration to a folder

Introduction

The philosophy of DSH is “everything is a plugin.” Plugins are installed in a certain profile, and configuration files are also located within that profile. The problem arises when switching machines: the new DSH requires reinstalling plugins one by one, followed by reconfiguring them. Manual migration is prone to missing changes like cordis.yml, or missing a link: dependency path, which can cause the next startup to fail directly.

The dsh-cjbf introduced below is a plugin targeting this specific stage: it packs all plugins installed in the local profile and their configurations into a regular folder, allowing for recovery on a new machine from this folder.

What is it

dsh-cjbf is maintained by CheapGodMs, GitHub repository CheapGodMs/dsh-cjbf, current version 1.0.0, license MIT, repository language JavaScript, and GitHub stars 0. It declares a runtime environment of dsh >= 0.2.1-rc.5.

One-sentence positioning: DSH plugin backup and restore tool. The backup package contains not only the plugins themselves and their dependencies, but also the profile configuration files. Therefore, after recovery on a new machine, the plugin collection and configurations come back together, rather than just the plugins.

The repository topic is only dsh-plugin. The community directory page places it under the plugin category; that directory is an independent site with no official affiliation with DeepSeek / Huanfang.

Backup Artifacts

Backups are written to <folder>/DSH插件备份-<YYYYMMDD-HHMMSS>/, and the directory contains five parts:

  1. profile/: package.json, cordis.patch.yml, pnpm-workspace.yaml, pnpm-lock.yaml, cordis.yml.
  2. packages/: The profile’s node_modules, i.e., the plugins themselves and their dependencies; .bin and .pnpm caches are excluded.
  3. tool/: A copy of the plugin itself, so that it can be reinstalled on a new machine even without a network.
  4. manifest.json: Timestamp, bundle list, precise version of each dependency, number of files, byte count, platform.
  5. README.txt: Recovery instructions written in Chinese, kept together with the data.

The backup path is specified by you on the page, not hardcoded in the plugin.

Restoration Behavior

Restoration writes packages/ back to the profile’s node_modules and writes configuration files back to the profile, while ensuring the currently running plugin itself is not overwritten. Specifically, there are five points:

  1. cordis.yml will not be overwritten, as it is the composition root for each individual machine.
  2. The restored package.json will definitely retain this plugin and keep it selected.
  3. Dependencies originally installed from local paths (link: / file:) but which do not exist on the new machine will be removed and listed in the result to avoid breaking the next startup.
  4. Packages declared in package.json but missing in the backup will be cleaned up and reported.
  5. Before overwriting anything, the current profile files will first be copied to profile/.plugin-backup-restore-<timestamp>/, which serves as the rollback path.

Installation and Enablement

The installation command comes from the README and requires a profile parameter:

dsh plugin --profile <profile> add dsh-cjbf

Once installed, you can see the backup entry on the “Plugins” page. The plugin comes with a built-in web client (client.js) that declares "immediately": true and injects @deepseek-ai/dsh-client-ui-plugin-manager, so you can operate within the plugin page immediately after installation without additional configuration.

Typical Usage

The following four steps constitute the complete process given in the README; simply follow them in order.

  1. Install the plugin on the local machine:
dsh plugin --profile <profile> add dsh-cjbf
  1. Open “Plugins → Backup / Backup”, select a folder, and click “Back up now”.

  2. On the new machine, install DSH and then install this plugin (from npm, or using the tool/ directory in the backup package), open the same tab, select the backup folder, click “Find backups”, select a snapshot, and click “Restore this backup”.

  3. Restart DSH.

In addition to page operations, the plugin exposes an agent tool named plugin_backup, covering read-only and backup-side commands: status, scan, backup, find. The restoration side is deliberately restricted to being triggered only by the user on the page, because restoration overwrites local plugin configurations, and the page always requires explicit confirmation.

Applicable Scenarios and Notes

Suitable scenarios: DSH uses multiple profiles, a large number of plugins, extensive configuration changes, and requires cross-machine migration. The backup size is roughly equal to the profile’s node_modules; a few hundred MB is normal, so reserve enough space when selecting the directory.

Two points to note:

  1. The backup does not contain session records; ~/.dsh/sessions will not be included. The semantics are “plugin collection plus configuration,” not a complete environment snapshot.
  2. The plugin runs with the permissions of the current dsh process. Before installation, you should open the source code to verify the implementation and confirm the license; this plugin is MIT. Its client communicates with the Host only via the fenced loopback route /dsh-cjbf/api, without credentials and without accessing the external network.

If someone else is installing it for you, it is recommended to keep the README.txt in the backup package and follow it on the new machine; you don’t need to consult the documentation again.

  • Directory Page: https://www.skillhub.cn/plugins/CheapGodMs/dsh-cjbf
  • GitHub: https://github.com/CheapGodMs/dsh-cjbf
羽毛球分组比赛记分
小程序二维码

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

Xiaoye