One Pack: Bundle Your DSH Environment into a Private Repo for One-Click Restoration on a New Machine

Introduction

The philosophy behind DSH is “everything is a plugin.” As your collection of plugins, configurations, and sessions grows, switching machines or reinstalling the OS becomes tedious—installing plugins one by one, digging through settings, and tracking down lost sessions. The One Pack plugin bundles your current DSH environment into a private GitHub repository. When restoring on another machine, all you need to do is install the plugin, enter your token once, and hit Pull.

What sets it apart from manually backing up a folder: it automatically creates or reuses a private repository after you enter your token once; it previews the change plan before pushing; it backs up local data before pulling; sync runs in the background without blocking the UI; sessions are automatically mounted to their corresponding workspaces upon restoration; and multiple devices can share a single repository without overwriting each other.

What It Is

One Pack is a DSH plugin developed by maintainer wzvx, categorized as a networking tool. It packages and syncs a DSH environment to a private GitHub repository, including installed plugins, DSH and plugin settings, skills, sessions, and explicitly registered workspace directories. After switching machines, switching profiles, or reinstalling DSH, you just need to install One Pack, enter your token once, and hit Pull to restore everything—no more installing plugins one by one, digging through settings, or hunting for lost sessions.

Core Features

Sync to a Private Repository

One Pack packages your DSH environment into a private GitHub repository. After saving, it automatically creates or reuses the private repository dsh-one-pack-sync—no need to create the repo first and then fill in owner/repo. Before pushing, it provides a read-only preview of added/updated/skipped/diverged items, and only writes after you confirm. Before pulling, it backs up any data that would be overwritten locally, so you can roll back if something goes wrong.

Background Sync & Auto Push

Sync runs in the background—confirm and it returns immediately without blocking the UI; upon completion it logs history and shows the result. You can enable daily auto-push (disabled by default). Once enabled, it automatically Pushes once per day at 18:00 (local time, configurable).

Automatic Session Mounting

Sessions truly come back to their workspaces. It’s not just downloading files—they are mounted to the corresponding workspace (sessions that already exist but aren’t mounted will also be attached).

Multi-Device Backup

Multiple devices share one repository. Each device backs up to its own devices/<device>/ namespace, so they don’t overwrite each other. When pulling, you can choose the source (this device / latest backup / specific device).

Security Design

Sensitive values are left untouched by default. Fields like api_key / token / secret / password in settings are written as ***; key files (.env, .key, .pem, .npmrc, etc.) are hard-excluded; and the token is only stored locally on the Host. Sync never produces empty commits—content is compared via sha256, and if nothing has changed, it simply reports “No changes to push.”

Installation & Activation

Prerequisites:

  • Node.js >= 22
  • DSH >= 0.2.1-rc.5
  • GitHub: one account; a private repository to store the environment snapshot
  • Token: classic token with repo scope checked; the panel’s “Generate Token ↗” is pre-filled

Install:

dsh plugin --profile desktop add dsh-one-pack

After installation, the One Pack icon appears in the sidebar.

Initial Setup

  1. Open One Pack in the sidebar, click Generate Token ↗ → GitHub opens the classic token page (with repo pre-filled) → Generate token → paste the token back into the panel → Save & Create Repository.
  2. After saving, it automatically creates/reuses the private repository and displays Connected <owner>/dsh-one-pack-sync.
  3. Enable the sections you want to sync (default: “Plugins + Settings”). To use your own repository, specify it with one_pack_setup { repo: "owner/repo" }.

Typical Usage

Restoring on a New Machine

Install One Pack → enter the token for the same account (same-named repositories are reused automatically) → click Pull → review the plan → confirm. Once sessions land, they will automatically appear in the corresponding workspaces; plugin install/update may trigger a restart prompt. The same repository can store backups for multiple devices without overwriting each other; on a new machine where this device has no backup yet, select Latest Backup (or a specific device) in the “Pull Source” field of the preview dialog to restore.

In-Session Tools

In addition to the panel, you can let the Agent operate directly within a session:

Tool Purpose
one_pack_status Read-only status: repository, token, device, section toggles, and last sync
one_pack_setup Write local config: repository (owner/repo or URL), branch, token, section toggles
one_pack_sync Push/pull, two-phase (preview → execute); with direction=pull, use sourceDevice to select the backup source (self / latest / specific device id); execute automatically inherits the choice made during preview

Verification

curl -s http://127.0.0.1:<dsh-port>/one-pack/api/status

Or call one_pack_status in a session: you should see device info, repository, hasToken: true, section toggles, and last sync. A 401 response when no token is set is expected (the Host only accepts requests with browser authentication).

Design Trade-offs

  • Link-installed plugins don’t transfer across machines: Plugins installed via local directories (link: / file:) don’t exist on other machines and can’t be restored after pulling, so One Pack proactively skips them and shows a notice; to transfer across machines, publish to npm or switch to git-based installation.
  • Pull doesn’t blindly overwrite: Backs up before writing; skips if session content is identical, preserves local version when local is newer, and on a true divergence keeps local while saving the remote version separately.
  • Sync never produces empty commits: Content is compared via sha256; if nothing changed, it simply reports “No changes to push.”
  • Sensitive values are untouched by default: Sensitive fields in settings are masked, skills/files have hard-exclusions for key files, and the token never enters the repository.
  • No silent repository overwrites: Auto-creation only triggers when no repository is configured; if a same-named repository exists, it’s reused—never deleted or reset.
  • Some changes require a restart: Plugin install/update, plugin enable/disable—these changes require a plugin reload; when Pull detects such changes, a prompt will appear.
  • Workspace files section is temporarily hidden: The panel entry is hidden, the functionality is retained, and it will be reopened with a new interaction design later.

Uninstall & Rollback

dsh plugin --profile desktop remove dsh-one-pack
  • Uninstalling does not delete local data: $DSH_HOME/one-pack/ (state, history, backups) can be manually kept or removed.
  • The remote repository is untouched; if you need to clean up, delete the dsh-one-pack-sync repository on GitHub yourself.
  • To roll back a specific Pull: copy files from $DSH_HOME/one-pack/backups/<timestamp>/ back to their original locations.

FAQ

What permissions does the token need? A classic token with repo scope is sufficient; One Pack’s “Generate Token ↗” is pre-filled.

Why wasn’t a certain plugin synced? It may have been installed via a local directory (link: / file: / workspace:), which can’t be restored on another machine. One Pack proactively skips it and shows a notice; publish to npm or switch to git-based installation before syncing.

Why is a restart required? Plugin install/update, plugin enable/disable—these changes require a plugin reload; a prompt will appear when Pull results include such changes.

Will secrets be synced? No. Sensitive fields in settings are masked, skills/files have hard-exclusions for key files, and the token never enters the repository.

Why didn’t sessions appear in workspaces after pulling? Check the warnings in the Pull result: when the target machine doesn’t have the original workspace directory, sessions will land in the first available workspace; you can find them there.

Why does the README on the npm package page differ from GitHub? npm displays the README bundled at publish time; updates on GitHub won’t reflect on the npm page until the next npm publish.

Use Cases

Ideal for users who frequently switch machines, switch profiles, or reinstall DSH. Plugins run with the current DSH process permissions—review the source code and license before installing.

Summary

One Pack syncs DSH environment plugins, settings, skills, and sessions via a private GitHub repository, enabling one-click restoration when switching machines or profiles. It provides change plan preview, local backup, background sync, auto push, multi-device backup, and security masking—suited for users who need to maintain a consistent development environment across devices.

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

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

Xiaoye