Syncing DSH sessions across machines
What it actually moves
Session files are treated as opaque bytes: session*.jsonl.zstd is hashed, split into fixed chunks, and shipped. It never parses zstd or JSONL, so a change in the session format cannot corrupt the sync.
Two index files are different. workspace.json and session_projcache.json are merged semantically, because a whole-file last-write-wins would drop sessions and make them vanish from the list.
Run it in six commands
There is nothing to install: clone the repository, start the hub on one machine, pair the other one, then sync. Node 20 or newer, no third-party packages.
git clone https://github.com/FindSomeSkills/Skills.git dsh-skills
cd dsh-skills/dsh-tools/dsh-sync-hub
node src/hub/server.mjs # listens on 7788 by default
node src/agent/cli.mjs code --hub http://127.0.0.1:7788
# on the other machine:
node src/agent/cli.mjs pair --hub http://<first machine>:7788 --code <code> --name my-laptop
node src/agent/cli.mjs sync --hub http://<first machine>:7788 --home ~/.dshConflicts keep both copies
Nothing is overwritten silently. When both sides changed, the hub stores a conflict copy and leaves the local file untouched. You decide what to keep; the tool does not guess.
Credentials are refused by name before any upload: .credentials*, *.pem, *.key, id_rsa and paths under profiles/**/cred* are on a hard blacklist.
What is not there yet
The web console and a PWA are not built. Neither is version history with one-click restore, nor live push over SSE. What works today is the sync path itself: pair, first transfer, pull, incremental, conflict.
An incremental run compares whole-chunk prefixes only; the trailing partial chunk changes on every append, so it is excluded. In a measured append of 10 KB, 28,928 bytes moved — an 81.9% saving.
Paste this instead of typing
If you would rather have DSH run it, paste this and it will report each step back:
帮我把 DSH Sync Hub 跑起来,按顺序做,哪一步失败就停下把原文报给我:
1. git clone https://github.com/FindSomeSkills/Skills.git dsh-skills
2. cd dsh-skills/dsh-tools/dsh-sync-hub
3. node src/hub/server.mjs (记下监听的地址,默认 7788)
4. 生成一次性配对码:node src/agent/cli.mjs code --hub http://127.0.0.1:7788
5. 另一台设备配对:node src/agent/cli.mjs pair --hub http://<第一台地址>:7788 --code <码> --name <设备名>
6. 同步:node src/agent/cli.mjs sync --hub http://<第一台地址>:7788 --home ~/.dsh
先把第 3 步的输出和第 4 步的码贴给我,再继续。不要改 ~/.dsh 里的任何文件。Updating
There is no version number to check. Pull the repository and restart the server:
Pairing failures and stuck syncs belong in GitHub Discussions: https://github.com/FindSomeSkills/Skills/discussions/2 — include the output of code, the hub log, and the state.json under ~/.dshsync/ with the token removed.
git -C dsh-skills pull
cd dsh-skills/dsh-tools/dsh-sync-hub
node src/hub/server.mjs