Introduction¶
The daily state of DeepSeek Harness (DSH) is scattered across $DSH_HOME: plugin manifests for each profile, local link: plugin source code, historical sessions, workspace lists, skills symlinks, market groupings, and deactivation records, among others. When switching computers or reinstalling the system, if you only copy specific directories or copy the entire ~/.dsh package, a common result is “it starts up but feels different from the old machine”: plugins fail to load, the session list is empty, or workspace paths don’t match.
The community plugin dsh-sync (Maintainer: huangfuren, Category: Workflow) addresses this by migrating the “Declarative Layer + State Layer” together and rewriting session and workspace records according to path mapping on the target machine. The export is a portable bundle accompanied by apply.ps1 / apply.sh; the recipient does not need to install dsh-sync and can restore the declarative layer by running the script once. If path remapping, session cwd rewriting, and consistency checks are required, the dshsync_apply / dshsync_verify tools provided by the plugin should be used on the target machine.
What is this?¶
dsh-sync packages the local dsh configuration and state into a dsh-sync-bundle: it includes settings (credentials optional), manifests and patches for each profile, vendored source code for link: plugins, as well as state layer content such as sessions, storages, and skills. The bundle includes a full-package sha256 checksum and self-installation scripts.
The current version of the plugin is 0.4.2 (see package.json in the repository), licensed under MIT. The implementation is original JavaScript, relying only on Node built-in modules at runtime. You can view the entry on the SkillHub Plugin Directory, and the source code is available at GitHub: huangfuren/dsh-sync.
Two Layers of State: “Consistent” Requires Both¶
The README divides the migration objects into two layers. Below is an introduction to what each layer contains and the consequences of missing it.
Declarative Layer: settings.yaml, optional credentials, home-level cordis.patch.yml, AGENTS.md, each profile’s package.json / cordis-related files / pnpm-workspace.yaml / .dsh-market/state.json, and the source code for each link: plugin. Missing these will cause dsh to fail to start, plugins not to load, deactivation and grouping to revert to defaults, or agent behavior to differ from the old machine.
State Layer: sessions/, storages/, skills/, attachments/, background/, dsh-market/, llm-deepseek/. If missing, dsh can still run, but historical sessions, workspace lists, skills, attachments, and background will be empty.
profiles/<n>/package.json determines both “what to install” (dependencies) and “what to load” (dsh.profile.bundles). During export, the absolute paths for link: within it are rewritten to link:../../plugins/<name>, pointing to the vendored source code within the bundle, allowing the $DSH_HOME location on the target machine to vary.
The following content is intentionally excluded: node_modules (including platform-dependent native modules), dsh-runtimes, cache, logs, .anonymous-user-id (machine identity).
Core Features¶
Export (Source Machine Read-Only)¶
Call dshsync_export on the source machine where the plugin is installed and enabled. The export process only copies and does not modify the source machine’s configuration.
Two Landing Paths¶
| Method | Target Machine Needs dsh-sync? | Capabilities |
|---|---|---|
Bundle with apply.ps1 / apply.sh |
No | Declarative layer landing, full-package verification, backup and rollback before overwrite |
dshsync_apply |
Yes | All of the above, plus path remapping, session cwd rewriting, workspace path rewriting, symlink reconstruction |
dshsync_verify |
Yes | Item-by-item verification of consistency between the target machine and the bundle |
Session rewriting relies on zstd multi-frame reading and writing (only replacing the cwd in the header of the first frame, keeping the event area byte-for-byte); PowerShell scripts cannot perform frame-level rewriting. Therefore, complete migration requires Node ≥22.15’s built-in zstd (the README states in known limitations that sessions will not be migrated and a warning will be issued for versions lower than this). dshsync_apply and the scripts share the mapping rules in lib/path-map.js.
Symlinks and Transport¶
Symlink entities are not directly packed into the bundle but are written into state/links.json and rebuilt upon landing. This avoids zip, cloud drives, or some transmission channels flattening symbolic links. The README mentions that when used in conjunction with localsend_smb_push from dsh-localsend, the packager skips symlinks, but the links manifest mechanism still applies.
Keys and Bundle Security¶
By default, .credentials.yaml is not exported; suspected plaintext keys in settings will be removed with a warning. It is recommended to set credentialPassphrase (≥6 characters) to perform AES-256-GCM encrypted transport for settings and credentials. Verify checksums before applying; backups are made to $DSH_HOME/.dsh-sync-backup-<timestamp>/ before overwriting.
Installation and Activation¶
The README does not provide a fixed one-line dsh plugin add … command. Please refer to the SkillHub Directory Page for community instructions to install the plugin on the source machine (and on the target machine if dshsync_apply / dshsync_verify are needed there).
It is recommended to review the GitHub repository source code and the MIT license yourself before installing. The plugin runs under the current dsh process privileges; export involves reading configurations and sessions under $DSH_HOME; credential-related options will touch key files, so please choose to encrypt or omit them according to the README’s key strategy.
Environment requirements (from package.json): Node ≥22.19; dsh version must satisfy its engines.dsh range. Peer dependencies include @deepseek-ai/dsh-tools and @deepseek-ai/cordis.
Typical Usage¶
1. Old Computer: Export Bundle¶
First, use preview to confirm the scan results, then remove preview for a formal export:
dshsync_export(profile="*", includeCredentials=true, credentialPassphrase="<a passphrase you remember>", preview=true)
After a formal export, you will get dsh-sync-bundle/ (default output directory name, adjustable via the outDir in the settings namespace sync), which includes manifest.json, checksums.json, rewritten profiles and plugins/, state/, as well as apply.ps1, apply.sh, and APPLY.md.
2. Copy the Bundle¶
Copy the entire folder to the new machine (USB drive, cloud drive, local network, etc. are all acceptable).
3. New Computer: Landing¶
If drive letters, usernames, or project root paths differ, mapping must be provided; it is recommended to use dryRun=true first:
dshsync_apply(bundleDir="D:/incoming/dsh-sync-bundle",
mappings=[{"from":"D:/deepseek","to":"E:/code"}],
dryRun=true)
Set dryRun=false to execute after confirming the dry run is correct. If the directory structure is exactly the same on both machines, mappings can be omitted. Mappings are applied in writing order; the first match returns immediately, and matches must occur at path segment boundaries (details are in the README; do not change this to “longest prefix first” on your own).
If you only need to restore the declarative layer and no path rewriting is needed, you can simply run apply.sh or apply.ps1 inside the bundle without installing dsh-sync on the target machine.
4. New Computer: Verification¶
dshsync_verify(bundleDir="D:/incoming/dsh-sync-bundle")
The tool provides PASS / FAIL / WARN for 10 invariants (I1–I10); the README has a table explaining each item. FAIL indicates that dsh cannot correctly see that part of the state, not a minor discrepancy.
Settings Namespace sync (Selection)¶
| Key | Default | Description |
|---|---|---|
dshHome |
$DSH_HOME or ~/.dsh |
Harness home |
profile |
web |
Default export profile; "*" for all |
outDir |
dsh-sync-bundle under temp directory |
Bundle output directory |
includeCredentials |
false |
Whether to include .credentials.yaml |
credentialPassphrase |
Empty | If set, encrypts settings and credentials |
includePlugins |
true |
Whether to vendor link: plugin source code |
includeState |
true |
Whether to include sessions / storages / skills etc. |
Applicable Scenarios and Notes¶
Suitable for: Switching machines or reinstalling and wanting the new machine’s dsh to have “the same set of plugins, sessions, workspace lists, and skills as the old machine”; migrating local link: plugins and profile states between a desktop and a laptop; needing to verify the completeness of migration on the target machine.
Points to Note:
- After landing, the target machine needs to run
pnpm installordsh plugin addto rebuildnode_modules. Verify’s I9 will remind with a WARN; it will not silently ignore it. - The workspace code that the session
cwdpoints to is outside$DSH_HOME; if only dsh state is migrated, the target machine will lack the corresponding directory, causing sessions to be listed but unopenable. I8 will list the missing paths. You need to sync the repository or usemappingsto point to existing directories. - When
includeState=false, you get a “usable empty environment” without historical sessions and workspace records. - The community directory SkillHub is an independent site with no official affiliation with DeepSeek / High-Flyer; plugin stars are based on the directory page display (current clue is 0).
Conclusion¶
dsh-sync solves the problem beyond “copying a folder”; it exports according to the actual DSH data structure, rewrites path dependencies, and allows scripted landing and verification on the target machine. The export side is read-only; the receiving side can restore the declarative layer solely with the bundle scripts, while complete session and workspace migration depends on the Node-side apply / verify tools.
- Plugin Directory: https://www.skillhub.cn/plugins/huangfuren/dsh-sync
- Source Code and Detailed Instructions: https://github.com/huangfuren/dsh-sync