Install
openclaw skills install @lyy4916/workbuddy-multi-device-syncSet up automatic configuration sync across multiple Macs using WorkBuddy. Use when the user wants to use WorkBuddy on two or more computers and keep identity, memory, skills, and settings synchronized. Triggers: 多台电脑同步, 双机同步, 两台 Mac 同步 WorkBuddy, sync WorkBuddy across devices, multi-device sync, 换电脑配置同步. Covers Git-based sync via GitHub, auto-sync daemon, and one-click setup for additional machines.
openclaw skills install @lyy4916/workbuddy-multi-device-syncEnable automatic synchronization of WorkBuddy configuration across multiple Macs using a private GitHub repository. After setup, all machines share the same identity (SOUL.md, IDENTITY.md, USER.md), memory (MEMORY.md), skills, and settings — with zero manual commands. A background daemon syncs every 5 minutes.
SOUL.md, IDENTITY.md, USER.mdMEMORY.md (user-level, NOT memory/ daily logs)skills/ directorymcp.json, settings.jsonauto-sync.sh, start-sync-daemon.sh, wb-setup-mac-b.shbinaries/ — 300MB+ platform-specific runtimes, each machine installs its ownworkbuddy.db — SQLite database (automations, runtime state), concurrent sync corrupts it.mcp.json — localhost port numbers differ per machinesessions/, logs/, traces/ — runtime data, machine-specificcredentials/ — each machine logs in independentlymemory/ — daily work logs, project-specificconnectors/, plugins/ — marketplace state, machine-specific~/.workbuddy/# Set git config if not already set
git config --global user.name "$(whoami)"
git config --global user.email "$(whoami)@workbuddy.local"
git config --global init.defaultBranch main
# Initialize repo
cd ~/.workbuddy
git init
.gitignoreCopy the template from references/gitignore-template to ~/.workbuddy/.gitignore.
This excludes all machine-specific files. Review and adjust as needed.
Key exclusions:
binaries/ — runtimesworkbuddy.db / workbuddy.db-* — SQLite.mcp.json — localhost portssessions/, logs/, traces/ — runtime datacredentials/ — auth tokensmemory/ — daily logs.auto-sync.log, .sync-daemon.pid — daemon stateTwo approaches:
Approach A: GitHub Device Flow (recommended, no SSH needed)
curl -s -X POST "https://github.com/login/device/code" \
-H "Accept: application/json" \
-d "client_id=178c6fc778ccc68e1d6a&scope=repo,admin:public_key"
Response contains device_code, user_code, and verification_uri.
Tell the user to open verification_uri and enter user_code.
Poll for authorization:
curl -s -X POST "https://github.com/login/oauth/access_token" \
-H "Accept: application/json" \
-d "client_id=178c6fc778ccc68e1d6a&device_code=<DEVICE_CODE>&grant_type=urn:ietf:params:oauth:grant-type:device_code"
Repeat every 5 seconds until access_token appears in response.
echo "https://<USERNAME>:<TOKEN>@github.com" > ~/.git-credentials
chmod 600 ~/.git-credentials
git config --global credential.helper store
curl -s -X POST -H "Authorization: token <TOKEN>" \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/user/repos" \
-d '{"name":"wb-sync","private":true,"description":"WorkBuddy config sync"}'
Approach B: Manual setup
wb-sync, private, no README)repo)cd ~/.workbuddy
git remote add origin https://github.com/<USERNAME>/wb-sync.git
git add -A
git commit -m "init: WorkBuddy config from $(hostname)"
git push -u origin main
scripts/auto-sync.sh to ~/.workbuddy/auto-sync.shscripts/start-sync-daemon.sh to ~/.workbuddy/start-sync-daemon.shchmod +x ~/.workbuddy/auto-sync.sh ~/.workbuddy/start-sync-daemon.sh# Must use dangerouslyDisableSandbox or osascript to escape sandbox
osascript -e 'do shell script "/bin/bash ~/.workbuddy/start-sync-daemon.sh"'
Append to ~/.bash_profile (or ~/.zshrc):
# WorkBuddy 双机同步快捷命令
alias wbsync='cd ~/.workbuddy && git add -A && git commit -m "sync $(date +%m%d-%H%M)" && git push origin main'
alias wbpull='cd ~/.workbuddy && git pull origin main'
# WorkBuddy 自动同步 — 守护进程保活 + 终端打开时即时同步
if [ -f ~/.workbuddy/start-sync-daemon.sh ]; then
bash ~/.workbuddy/start-sync-daemon.sh 2>/dev/null
fi
if [ -t 1 ] && [ -f ~/.workbuddy/auto-sync.sh ]; then
_wb_now=$(date +%s)
_wb_last=$(cat ~/.workbuddy/.last-auto-sync 2>/dev/null || echo 0)
if [ $((_wb_now - _wb_last)) -gt 300 ]; then
bash ~/.workbuddy/auto-sync.sh >/dev/null 2>&1 &
echo $_wb_now > ~/.workbuddy/.last-auto-sync
fi
unset _wb_now _wb_last
fi
cd ~/.workbuddy
git add -A
git commit -m "add: auto-sync scripts + terminal hook"
git push origin main
~/.workbuddy/ directory), then quitGenerate a Mac B setup script using scripts/setup-mac-b.sh.template:
<GITHUB_USERNAME>, <GITHUB_TOKEN>, <GITHUB_REPO> with actual valuescurl -sSL -H "Authorization: token <TOKEN>" \
"https://raw.githubusercontent.com/<USERNAME>/wb-sync/main/wb-setup-mac-b.sh" | bash
The script automatically:
~/.workbuddy/If both Macs are nearby:
wb-setup-mac-b.sh from Mac A to Mac Bbash ~/Downloads/wb-setup-mac-b.sh# Check daemon is running
cat ~/.workbuddy/.sync-daemon.pid # should show a PID
kill -0 $(cat ~/.workbuddy/.sync-daemon.pid) && echo "ALIVE" || echo "DEAD"
# Check sync log
tail -5 ~/.workbuddy/.auto-sync.log
# Check git status
cd ~/.workbuddy && git log --oneline -3 && git remote -v
launchctl load) often fails with "Input/output error" on macOS 12+
under sandbox. The Python subprocess daemon approach in start-sync-daemon.sh
is more reliable.workbuddy.db and do NOT sync.
Recreate them on each machine using the automation_update tool.<project>/.workbuddy/memory/) is NOT inside
~/.workbuddy/ and must be synced separately (via the project's own Git repo
or cloud storage).~/.git-credentials (chmod 600).
For shared machines, consider using a token with limited scope and expiration..bash_profile hook) or when WorkBuddy
runs any bash command.auto-sync.sh — Sync script called by the daemon every 5 minutes (pull → commit → push)start-sync-daemon.sh — Daemon launcher with PID dedup and Python auto-detectionsetup-mac-b.sh.template — Mac B one-click setup script template (replace placeholders before use)gitignore-template — The .gitignore file to place in ~/.workbuddy/sync-architecture.md — Detailed architecture explanation and troubleshooting