DSH (DeepSeek Harness) adopts an “everything is a plugin” architecture, and configuration management (such as installed plugins and settings.yaml) is distributed across local files. Migrating configurations across multiple devices or regularly backing up the current work environment usually requires manually copying configuration files such as package.json.
The dsh-market-gist-autosync plugin solves this problem. It packages DSH’s current Profile configuration into a private GitHub Gist, supports scheduled backups and merge-based restoration, and its backup format is fully compatible with the plugin marketplace (dshmarket).
Core Features¶
- Backup and Storage: Backs up the current profile’s configuration as a private Gist. The plugin automatically detects the running environment (desktop or web), and the backup content strips machine-local dependencies (like
link:C:/Users/...) to ensure the backup remains portable. - Scheduled Backups: Supports scheduled tasks at minute/hour granularity. Note that scheduled backups run only while DSH is active; no backups are performed while the computer is in sleep mode, and missed backups are not made up later. Scheduled tasks and manual backups within the same process are mutually exclusive to prevent concurrency conflicts.
- Merge Restore: Restoration uses merge semantics, preserving installed plugins and not deleting existing configuration. After restoration,
pnpm installruns automatically; if dependency installation fails, the plugin rolls back automatically. - Startup Pre-check: After restoration completes, the plugin checks the resolvability of each bundle. Bundles that cannot be resolved locally (for example,
link:dependencies originating from another machine) are removed from the profile and reported, avoiding a failed startup that enters recovery mode after restoration. - Upload History: Records the most recent 20 uploads, stored in the dsh-storage domain, with one-click clearing. Records include status markers and error causes.
- Fault Tolerance and Security: Supports Gist URL fault tolerance; includes a request hang-prevention mechanism (AbortSignal double protection); tokens are stored in plaintext locally, with the environment variable
DSH_GITHUB_TOKENtaking priority.
Installation and Enabling¶
Use the official CLI to install:
dsh plugin --profile desktop add dsh-market-gist-autosync # 桌面端
dsh plugin --profile web add dsh-market-gist-autosync # 网页版(dsh web)
After installation, configure it in DSH’s Settings → Gist Backup page.
Configuration and Usage¶
1. Prepare a GitHub Token¶
Enter your GitHub Token on the settings page. The Token is used only to access your private Gist. For security, we recommend using the environment variable DSH_GITHUB_TOKEN instead of entering it directly in the interface. The Token is saved in the local configuration file.
2. Configure the Backup Target¶
- Gist ID: Enter an existing Gist ID or URL. If left blank, each manual backup will automatically create a new private Gist.
- Scheduled Backup: After checking to enable it, set the interval value and unit (
hourorminute). The configuration takes effect immediately after saving. - Include Lockfile: If you want to back up
pnpm-lock.yamlto accurately reproduce dependency versions, you can checkincludeLockin the settings.
3. Perform Restoration¶
Enter a Gist ID or URL in the “Restore” section of the settings page. After clicking restore, the plugin executes the following steps:
1. Download and validate the backup structure.
2. Atomically write back the configuration files.
3. Merge package.json dependencies with existing plugins.
4. Automatically install missing dependencies.
5. Run startup pre-checks and remove unresolvable bundles.
6. Restart DSH to apply changes.
Technical Details and Notes¶
- Multi-profile Detection: The plugin automatically detects whether the current profile is desktop or web. Note that desktop and web share the same local configuration file (
$DSH_HOME/gist-autosync/config.json). If both sides have scheduled backups enabled and both are running simultaneously, concurrent uploads may allow later writes to overwrite earlier writes. - Backup Content Restrictions: The backup content automatically excludes items such as
node_modules,.dsh-market,.git, and symbolic links. A single backup is limited to 256 files or 1MB. - Startup Pre-check Mechanism: DSH fails when it encounters the first unresolvable package name during startup. This plugin actively performs pre-checks after restoration, removes bundles that truly do not exist, and reports an error, preventing users from discovering a corrupted configuration only after restart.
- Data Security: The backup content is stored in a private Gist, and the Gist itself is private. Do not back up sensitive files containing API keys to a Gist, even though Gists are private by default.