跳转至

可移植性

换台电脑拉起 myopenclaw 需要哪些准备?本页列出所有外部依赖和已知限制。

依赖图

myopenclaw (本仓库)
│
├── [必须] Docker Desktop
│
├── [可选·硬依赖·build 时需要]
│   ├── ~/code/aisecretary/          ← build context for aisecretary 服务
│   ├── ~/code/git-contribution-stats/ ← build context for repo-scanner-mcp
│   ├── ~/code/yuque_mcp_server/     ← build context for 本机语雀 MCP 服务(无 tag,按 commit pin)
│   ├── ~/code/mylibrary/            ← 论文流水线代码(缺失时 build 从 GitHub clone)
│   └── ../zhixun-agent/             ← 仅本地调试 profile 的 MCP 镜像 build context
│
├── [可选·软依赖·运行时 graceful skip]
│   └── ~/code/dailyinfo/            ← Claude Code 的 dailyinfo skills 源(生产调度在 dailyinfo 自己的 compose 栈)
│
├── [配置文件·需要手动创建]
│   ├── .env          (从 .env.example)
│   └── .cloud.conf   (从 .cloud.conf.example)
│
└── [数据·可从云盘恢复]
    ├── ~/.hermes/
    ├── ~/.claude/
    ├── ~/.openclaw/
    ├── ~/.cc-connect/
    └── ~/.myagentdata/

硬依赖:build 时需要的仓库

这些仓库的 build context 在 myopenclaw 仓库外(docker-compose.yml / docker-compose.zhixun-bot.yml 里写的是 ../xxx)。docker compose build 时需要它们存在于指定路径:

仓库 期望路径 用途
aisecretary ~/code/aisecretary aisecretary MCP 服务镜像构建
git-contribution-stats ~/code/git-contribution-stats repo-scanner-mcp 镜像构建
yuque_mcp_server ~/code/yuque_mcp_server 本机语雀 MCP 服务(yuque-mcp)镜像构建。上游无 tag,镜像按 commit pin(守卫 tests/test_yuque_mcp_local.py);升级 = 审查 diff 后改 pin + 重建
mylibrary ~/code/mylibrary hermes / zotero-mcp 镜像里的论文流水线(hydrolitagent + skills)。start.sh 先 rsync 进 build context;本地没有时 Dockerfile 自动从 GitHub clone,不会 build 失败
zhixun-agent ../zhixun-agent 仅本地调试 profile 的 zhixun-water-mcp 镜像需要(additional_contexts.zhixun_src,可用 ZHIXUN_AGENT_PATH 覆盖)。默认部署连远程水文 MCP,不需要此仓库

不需要 build 的情况(./scripts/start.sh 不加 --build):使用已有的 Docker 镜像即可,aisecretary / git-contribution-stats / yuque_mcp_server 这些仓库不需要存在。

软依赖:运行时 graceful skip

这些仓库缺失不会导致启动失败,但对应功能不可用:

仓库 期望路径 缺失时的影响
dailyinfo ~/code/dailyinfo Claude Code 的 dailyinfo skills 不可用;不影响 dailyinfo 独立栈(调度/采集/MCP 在它自己的 compose 里)

一键克隆

./scripts/clone-deps.sh

此脚本克隆 aisecretary / git-contribution-stats / yuque_mcp_server / dailyinfo 四个仓库到正确路径。GitHub 私有仓库需要 gh auth login 先;yuque_mcp_server 在 GitCode 且公开,免认证。

mylibrary 与 zhixun-agent 不在这个脚本里:前者缺失时 build 会自动从 GitHub clone;后者只在 --with-local-mcp 调试时需要,按需手动 clone(见快速开始第 3 步)。默认部署连远程水文 MCP,不需要它。

配置文件的机器差异

以下文件每台机器不同,不能直接复制:

文件 原因
.env API Key 可能不同(虽然可以用同一组 key)
.cloud.conf 云盘本机同步路径因用户名和云盘服务而异
~/.hermes/.env 邮箱密码、飞书凭证等
~/.hermes/SOUL.md 人格描述,迁移时通过备份恢复
~/.hermes/config.yaml Hermes 网关配置,迁移时通过备份恢复

可以通过云盘备份恢复的数据见 备份系统。

另外,~/.hermes/mcp-tokens/(如千问办公 AI听记 MCP 的 OAuth token)不在备份清单:换机后需要重跑一次授权(见 千问办公 AI听记)。

macOS 特定

以下功能依赖 macOS launchd,在 Linux 上不可用:

功能 替代方案 (Linux)
git-contribution-stats 采集 systemd user timer
Healthchecks.io 心跳 systemd timer 或 cron
collect-agentops 采集 systemd timer 或 cron

注意:Hermes cron 任务(Daily Command Center、工作日晨间简报、daily-dev-report、yuque-daily-digest)运行在 Docker 容器内,不依赖 macOS launchd,Linux 上可直接使用。

所有 launchd 任务依赖 macOS launchd。Linux 上的替代方案见 调度系统 的 Linux 等价物说明。

Docker 路径

/var/run/docker.sock 在 macOS Docker Desktop 和 Linux 上路径相同,一般不需要修改。部分 Linux 发行版可能使用不同的 Docker socket 路径。

不在本仓库管理的内容

以下内容由各自的仓库独立管理,myopenclaw 只负责引用:

  • dailyinfo 的 secret、数据源、业务逻辑 → dailyinfo 仓
  • git-contribution-stats 的采集逻辑、SQLite schema → git-contribution-stats 仓
  • aisecretary 的 MCP tools 实现 → aisecretary 仓
  • yuque_mcp_server 的 MCP tools 实现、快照/变更报告逻辑 → yuque_mcp_server 仓(本仓库只做 compose 集成,按 commit pin)