名称: clawdbot-sync
版本: 1.0.0
描述: "在多个 Clawdbot 实例之间同步记忆、偏好设置与技能。支持通过 Tailscale 上的 SSH/rsync 进行双向同步。当被要求与另一个 Clawdbot 同步、在实例间共享记忆或保持多个智能体同步时使用。触发词:/sync, 'sync with mac', 'update other clawdbot', 'share this with my other bot'。"
作者: clawdbot
许可证: MIT
元数据:
clawdbot:
emoji: "🔄"
triggers: ["/sync"]
requires:
bins: ["rsync", "ssh", "jq"]
tags: ["sync", "multi-agent", "collaboration", "backup"]
通过 Tailscale/SSH 在多个 Clawdbot 实例之间同步记忆、偏好设置和技能。
| 命令 | 功能说明 |
|---|---|
/sync |
显示同步状态与已配置的对等节点 |
/sync status |
检查与所有对等节点的连接状态 |
/sync now [peer] |
与指定节点(或全部节点)立即同步 |
/sync push [peer] |
将本地变更推送到指定节点 |
/sync pull [peer] |
从指定节点拉取变更 |
/sync add <name> <host> [user] [path] |
添加一个新的对等节点 |
/sync remove <name> |
移除一个对等节点 |
/sync diff [peer] |
显示与指定节点的差异 |
/sync history |
查看同步历史记录 |
handler.sh add mac-mini 100.95.193.55 clawdbot /Users/clawdbot/clawd $WORKSPACE
handler.sh add server 100.89.48.26 clawdbot /home/clawdbot/clawd $WORKSPACE
所有机器均需配置 SSH 密钥认证:
ssh-copy-id clawdbot@100.95.193.55
handler.sh status $WORKSPACE
| 项目 | 默认同步 | 备注 |
|---|---|---|
memory/ |
✅ 是 | 所有记忆文件与技能数据 |
MEMORY.md |
✅ 是 | 主记忆文件 |
USER.md |
✅ 是 | 用户配置文件 |
IDENTITY.md |
❌ 否 | 每个实例拥有独立身份 |
skills/ |
⚙️ 可选 | 已安装的技能 |
config/ |
❌ 否 | 实例特定的配置 |
handler.sh status $WORKSPACE # 检查对等节点与连接状态
handler.sh sync <peer> $WORKSPACE # 与指定节点双向同步
handler.sh push <peer> $WORKSPACE # 推送本地变更到指定节点
handler.sh pull <peer> $WORKSPACE # 从指定节点拉取变更
handler.sh diff <peer> $WORKSPACE # 显示与指定节点的差异
handler.sh add <name> <host> <user> <path> $WS # 添加对等节点
handler.sh remove <name> $WORKSPACE # 移除对等节点
handler.sh history $WORKSPACE # 查看同步历史记录
handler.sh auto <on|off> $WORKSPACE # 开启/关闭心跳自动同步
存储在 $WORKSPACE/memory/clawdbot-sync/ 目录下:
| 文件 | 用途 |
|---|---|
peers.json |
已配置的对等节点信息 |
history.json |
同步历史日志 |
config.json |
同步偏好设置 |
conflicts/ |
存放待审查的冲突文件 |
用户: /sync now mac-mini
机器人: 🔄 正在与 mac-mini (100.95.193.55) 同步...
📤 推送: 3 个文件已变更
• memory/streaming-buddy/preferences.json
• memory/2026-01-26.md
• MEMORY.md
📥 拉取: 1 个文件已变更
• memory/2026-01-25.md
✅ 同步完成!已同步 4 个文件。
rsync(用于高效文件同步)ssh(用于安全传输)