| name | ai-sync |
| description | AI Tools 端到端同步工作流,同步 Hermes 配置、记忆、技能和 Python 文件到 GitHub。 |
| category | devops |
AI Tools 端到端同步工作流
触发条件
- 用户需要同步配置和技能到 GitHub
- 用户切换设备后需要同步 Hermes/Antigravity 配置
- 用户需要备份或恢复技能
- 用户想推送本地更改到远程仓库
同步架构
┌─────────────────────────────────────────────────────────────┐
│ GitHub (远程仓库) │
│ │
│ ┌─────────────────┐ ┌─────────────────┐ │
│ │ ai-sync │ │ Zero-Tools │ │
│ │ (配置 + 记忆) │ │ (技能 + 脚本) │ │
│ └─────────────────┘ └─────────────────┘ │
└─────────────────────────────────────────────────────────────┘
▲ ▲
│ │
~/Desktop/ai-sync/ D:/Zero Tools/
│ │
└────────┬───────────────┘
│
symlink │
│
~/AppData/Local/hermes/skills/
仓库结构
1. ai-sync 仓库
- 路径:
~/Desktop/ai-sync/
- 远程:
crimsonblazezero/ai-sync
- 用途: 同步 Hermes 配置和记忆数据
- 内容:
hermes/config.yaml - Hermes 配置
hermes/SOUL.md - Hermes 人格定义
MEMORY.md - 持久记忆
USER.md - 用户信息
sync-config.sh - 配置同步脚本
sync-skills.sh - 技能同步脚本
sync-all.sh - 一键同步脚本
2. Zero-Tools 仓库
- 路径:
D:/Zero Tools/
- 远程:
crimsonblazezero/Zero-Tools
- 用途: 同步技能和 Python 脚本
- 内容:
skills/ - 126 个 Hermes 技能
src/ - Python 脚本
docs/ - 文档
- symlink:
~/AppData/Local/hermes/skills/ → D:/Zero Tools/skills/
3. workbuddy-config 仓库
- 路径:
/d/AgentSystem/workbuddy-config/
- 远程: 无(本地使用)
- 用途: WorkBuddy 配置源
- symlink:
.workbuddy/ → workbuddy-config/
使用方法
快速开始
bash ~/Desktop/ai-sync/sync-all.sh status
bash ~/Desktop/ai-sync/sync-config.sh pull
bash ~/Desktop/ai-sync/sync-config.sh push
bash ~/Desktop/ai-sync/sync-skills.sh pull
bash ~/Desktop/ai-sync/sync-skills.sh push
bash ~/Desktop/ai-sync/sync-all.sh pull
bash ~/Desktop/ai-sync/sync-all.sh push
详细操作
1. 同步配置和记忆
cd ~/Desktop/ai-sync
bash sync-config.sh pull
bash sync-config.sh push
覆盖范围:
~/AppData/Local/hermes/config.yaml
~/AppData/Local/hermes/SOUL.md
MEMORY.md
USER.md
2. 同步技能
cd ~/Desktop/ai-sync
bash sync-skills.sh pull
bash sync-skills.sh push
覆盖范围:
D:/Zero Tools/skills/
D:/Zero Tools/src/
D:/Zero Tools/docs/
3. 一键同步
bash ~/Desktop/ai-sync/sync-all.sh pull
bash ~/Desktop/ai-sync/sync-all.sh push
bash ~/Desktop/ai-sync/sync-all.sh status
注意事项
路径兼容
脚本已适配 Windows/MSYS2 环境,使用 cygpath 转换路径。
冲突处理
- 推送前会检查本地是否有未提交的更改
- 如果有本地更改,会先 commit 再 push
- 拉取前会检查是否有本地未提交的更改
备份策略
- 每次推送前会自动创建备份
- 备份保存在
backups/ 目录
- 备份命名格式:
backup-YYYYMMDD-HHMMSS
权限要求
- 需要 SSH 访问 GitHub 的权限
- 需要写入
~/AppData/Local/hermes/ 的权限
- 需要写入
D:/Zero Tools/ 的权限
故障排查
问题 1: SSH 连接失败
gh auth status
gh auth login
问题 2: 路径转换错误
脚本已内置 cygpath 转换,如果仍有问题,检查:
- Git Bash 是否安装
- MSYS2 路径是否正确
问题 3: 权限不足
ls -la ~/AppData/Local/hermes/
ls -la "D:/Zero Tools/"
问题 4: 技能数不一致
ls ~/AppData/Local/hermes/skills/ | wc -l
cd ~/Desktop/ai-sync && bash sync-skills.sh status
相关命令
手动同步
cd ~/Desktop/ai-sync && git pull && bash sync-config.sh pull
cd "D:/Zero Tools" && git pull
cd ~/Desktop/ai-sync && bash sync-config.sh push && git push
cd "D:/Zero Tools" && git add -A && git commit -m "sync skills" && git push
查看日志
cat ~/Desktop/ai-sync/logs/sync-$(date +%Y%m%d).log
cd ~/Desktop/ai-sync && git log --oneline -5
cd "D:/Zero Tools" && git log --oneline -5
更新记录
- 2026-08-02: 初始版本,创建同步脚本
- 2026-08-02: 修复 Windows/MSYS2 路径问题