Integrations

workbuddy-icloud-sync

Try it

Set up automatic WorkBuddy config sync across multiple Macs using iCloud Drive. No GitHub account, no token, no SSH key needed — just log into the same iCloud account on all machines. Triggers: iCloud 同步, iCloud 版同步, 不用 GitHub 同步, 苹果云同步 WorkBuddy, iCloud sync WorkBuddy, sync without GitHub. Uses a bare git repo inside iCloud Drive with a background daemon syncing every 5 minutes.

What it does

Set up automatic WorkBuddy config sync across multiple Macs using iCloud Drive. No GitHub account, no token, no SSH key needed — just log into the same iCloud account on all machines. Triggers: iCloud 同步, iCloud 版同步, 不用 GitHub 同步, 苹果云同步 WorkBuddy, iCloud sync WorkBuddy, sync without GitHub. Uses a bare git repo inside iCloud Drive with a background daemon syncing every 5 minutes.

The skill document

WorkBuddy iCloud Sync

Overview

Synchronize WorkBuddy configuration across multiple Macs using a bare Git repository stored in iCloud Drive. No external service required — just log into the same iCloud account on every machine. After setup, identity, memory, skills, and settings stay in sync automatically via a background daemon.

When to Use This vs GitHub Sync

FactoriCloud SyncGitHub Sync
Account needediCloud (Apple ID)GitHub account
NetworkApple iCloud (may be slow in China)GitHub (may need proxy in China)
Token/SSHNot neededPersonal Access Token or SSH key
Setup complexityVery simpleMedium
Version historyYes (git log)Yes (git log)
Best forSame Apple ID on all MacsDifferent accounts or cross-platform

What Syncs vs What Doesn't

Syncs (via Git)

  • Identity files: SOUL.md, IDENTITY.md, USER.md
  • Memory: MEMORY.md (user-level, NOT memory/ daily logs)
  • Skills: skills/ directory
  • Config: mcp.json, settings.json
  • Setup scripts stored in repo

Does NOT Sync (machine-specific)

  • binaries/ — 300MB+ platform-specific runtimes
  • workbuddy.db — SQLite database (automations, runtime state)
  • .mcp.json — localhost port numbers differ per machine
  • sessions/, logs/, traces/ — runtime data
  • credentials/ — each machine logs in independently
  • memory/ — daily work logs, project-specific

Already Synced (server-side)

  • Conversation history
  • Cloud user profile (auto-injected at session start)

Workflow

Phase 1: Set Up Mac A (Primary Machine)

Step 1: Verify iCloud Drive

# Check iCloud Drive is available
ls -d ~/Library/Mobile\ Documents/com~apple~CloudDocs && echo "ICLOUD_OK" || echo "NO_ICLOUD"

If NO_ICLOUD: System Preferences → Apple ID → iCloud → enable iCloud Drive.

Step 2: Initialize Git in ~/.workbuddy/

git config --global user.name "$(whoami)"
git config --global user.email "$(whoami)@workbuddy.local"
git config --global init.defaultBranch main

cd ~/.workbuddy
git init

Step 3: Create .gitignore

Copy references/gitignore-template to ~/.workbuddy/.gitignore. This excludes all machine-specific files (binaries, workbuddy.db, .mcp.json, sessions, logs, traces, credentials, memory, daemon state files).

Step 4: Create iCloud Bare Repo and Push

ICLOUD_DIR="$HOME/Library/Mobile Documents/com~apple~CloudDocs"

# Create bare repo in iCloud
git clone --bare ~/.workbuddy "$ICLOUD_DIR/WorkBuddy-sync.git"

# Add as remote and push
cd ~/.workbuddy
git remote add icloud "$ICLOUD_DIR/WorkBuddy-sync.git"
git add -A
git commit -m "init: WorkBuddy config from $(hostname)"
git push -u icloud main

Step 5: Install Auto-Sync

  1. Copy scripts/auto-sync-icloud.sh to ~/.workbuddy/auto-sync.sh
  2. Copy scripts/start-sync-daemon.sh to ~/.workbuddy/start-sync-daemon.sh
  3. Make both executable:
chmod +x ~/.workbuddy/auto-sync.sh ~/.workbuddy/start-sync-daemon.sh
  1. Start the daemon:
osascript -e 'do shell script "/bin/bash ~/.workbuddy/start-sync-daemon.sh"'

Step 6: Add Terminal Hook

Append to ~/.bash_profile (or ~/.zshrc):

# WorkBuddy iCloud 同步快捷命令
alias wbsync='cd ~/.workbuddy && git add -A && git commit -m "sync $(date +%m%d-%H%M)" && git push icloud main'
alias wbpull='cd ~/.workbuddy && git pull icloud 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

Step 7: Commit and Push Everything

cd ~/.workbuddy
git add -A
git commit -m "add: auto-sync scripts + terminal hook"
git push icloud main

Phase 2: Set Up Mac B (Additional Machines)

Prerequisites

  • WorkBuddy installed and launched once (creates ~/.workbuddy/), then quit
  • Same iCloud account logged in, iCloud Drive enabled
  • Wait for iCloud to sync the WorkBuddy-sync.git folder (check with ls ~/Library/Mobile\ Documents/com~apple~CloudDocs/WorkBuddy-sync.git)

Setup

Run scripts/setup-mac-b-icloud.sh on Mac B. Or manually:

WB_DIR="$HOME/.workbuddy"
ICLOUD_DIR="$HOME/Library/Mobile Documents/com~apple~CloudDocs"

# Backup existing config
if [ -f "$WB_DIR/SOUL.md" ]; then
  cp -r "$WB_DIR" "$WB_DIR.backup.$(date +%Y%m%d%H%M%S)"
fi

# Configure git
git config --global user.name "$(whoami)"
git config --global user.email "$(whoami)@workbuddy.local"
git config --global init.defaultBranch main

# Clone from iCloud
cd "$WB_DIR"
if [ -d ".git" ]; then
  git remote remove icloud 2>/dev/null
  git remote add icloud "$ICLOUD_DIR/WorkBuddy-sync.git"
  git fetch icloud
  git reset --hard icloud/main
else
  git init
  git remote add icloud "$ICLOUD_DIR/WorkBuddy-sync.git"
  git fetch icloud
  git checkout -f -B main icloud/main
fi

# Make scripts executable
chmod +x "$WB_DIR/auto-sync.sh" "$WB_DIR/start-sync-daemon.sh" 2>/dev/null

# Start daemon
bash "$WB_DIR/start-sync-daemon.sh"

Then add the terminal hook from Step 6 to Mac B's ~/.bash_profile.

Phase 3: Verification

# Check daemon
cat ~/.workbuddy/.sync-daemon.pid
kill -0 $(cat ~/.workbuddy/.sync-daemon.pid) && echo "ALIVE" || echo "DEAD"

# Check sync log
tail -5 ~/.workbuddy/.auto-sync.log

# Check git
cd ~/.workbuddy && git log --oneline -3 && git remote -v

Important Notes

  • iCloud sync latency: iCloud Drive may take 30-60 seconds to propagate changes between machines. The 5-minute daemon interval is sufficient.
  • First-time iCloud download: Mac B must wait for iCloud to fully download the WorkBuddy-sync.git folder before cloning. Check with ls.
  • LaunchAgent (launchctl load) often fails with "Input/output error" on macOS 12+ under sandbox. The Python subprocess daemon approach is more reliable.
  • Automations (scheduled tasks) are stored in workbuddy.db and do NOT sync. Recreate them on each machine using the automation_update tool.
  • Project workspace memory (/.workbuddy/memory/) is NOT inside ~/.workbuddy/ and must be synced separately.
  • Daemon recovery: After reboot, the daemon restarts when the user opens a terminal or when WorkBuddy runs any bash command.
  • iCloud storage: The bare repo is typically < 5 MB. No storage concerns.

Resources

scripts/

  • auto-sync-icloud.sh — Sync script using icloud remote (pull → commit → push)
  • start-sync-daemon.sh — Daemon launcher with PID dedup and Python auto-detection
  • setup-mac-b-icloud.sh — Mac B one-click setup (clones from iCloud Drive)

references/

  • gitignore-template — The .gitignore file for ~/.workbuddy/
  • sync-architecture-icloud.md — Architecture, troubleshooting, and comparison with GitHub

Related skills

Set up WorkBuddy config sync across 3+ Macs with machine naming, conflict resolution, and status tracking. Supports GitHub or iCloud as backend. Triggers: 多机同步, 三台电脑同步, 多台 Mac 同步 WorkBuddy, multi-machine sync, 3+ devices sync, 多台电脑配置同步, team sync WorkBuddy. Includes machine registry, per-machine commit tagging, stale lock detection, and a status command to see which machines are active.

Set 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.

当用户要换电脑、切换设备或在另一台机器继续开发时,帮助把当前 WorkBuddy 项目和工作现场(未提交改动、Git、项目内配置、Agent 规则/Skill 与交接上下文)安全打包成加密工作包,或恢复已有 .wbpack 并接着上次工作。适用于“跨设备项目迁移/接力”“工作现场打包/恢复”“把项目和 Agent 上下文一起带走”等请求;不把单纯云同步、实时多人协作、普通 Git 同步或部署作为主要场景。

WorkBuddy 每日积分自动签到。自动解密本地登录令牌,调用官方签到 API 完成每日积分领取(100 积分/天,连续第 7 天 1000 积分),并支持配置定时任务。触发词:WorkBuddy 签到、每日积分、check-in、credits。

1 installs

WorkBuddy 安全稳定运行专家团(WB-SAFE)——凭据、积分、连通、配置、加密、健康、风险、恢复八条防线一个团,守护 AI 工作台既安全又不掉线。对齐 NIST CSF 2.0 六职能与 ISO/IEC 27001。触发词:安全体检、凭据安全、Token 安全、积分省钱、连接器掉线、配置漂移、加密、密钥、系统卡死、OOM、灾备恢复、离线兜底、黄金包、备份。

PURE LOCAL file backup of this Mac's workspace: mirrors ~/playground, ~/experiment and ~/WorkBuddy into BOTH a fixed local folder and an external drive, incremental and verified, so an interrupted run resumes. Use-when: '备份一下工作区', 'back up my workspace to the external drive', 'what is not backed up yet / 备份状态', 'the drive is plugged in, catch up the backup', '$workspace-backup'. Do-NOT use for: Time Machine repair or restore; git push to a remote; iCloud or cloud sync; database dumps; deleting node_modules to free space (this skill never deletes from the source); or a single-file .bak.