Featured image of post Hermes Agent 实战:自托管多通道 AI 网关与 OpenClaw 平滑迁移

Hermes Agent 实战:自托管多通道 AI 网关与 OpenClaw 平滑迁移

Hermes Agent(Nous Research)从安装到 Discord/钉钉/飞书配置全攻略,含 OpenClaw 一键迁移、hermes claw migrate 命令详解

时间锚点:2025-12——Hermes Agent v0.14.0(2026.5.16 发布)发布,“OpenClaw 精神继承者"定位

一、Hermes Agent 是什么

Hermes Agent 是 Nous Research 在 2025 年推出的自托管多通道 AI Agent 网关,定位是”OpenClaw 精神继承者 + 升级版"——核心代码重写,但保留 OpenClaw 用户的工作流、目录结构、SOUL.md 人格化机制。

与 OpenClaw 的核心差异:

维度OpenClawHermes Agent
出品方社区 / VoltAgent 生态Nous Research(Hermes 模型厂商)
核心差异首创 SOUL.md + Discord 路由OpenClaw 完全兼容 + 增量增强
迁移工具-hermes claw migrate 一键迁移
技能市场ClawHub兼容 ClawHub 技能 + 官方 Skills Hub
LLM 集成任意 providerHermes 系列模型深度优化(同时支持 OpenAI/Anthropic/OpenRouter)
鉴权简化配置文件手动交互式 hermes setup 向导

二、系统要求

  • Python 3.11+
  • Git
  • Node.js(部分工具依赖)
  • ripgrep(高速代码搜索)
  • ffmpeg(TTS 语音消息,可选

三、安装

3.1 Linux / macOS

1
2
3
4
5
sudo apt update && sudo apt install -y ffmpeg
ffmpeg -version

# 一键安装脚本
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash

安装日志示例:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
→ Creating virtual environment with Python 3.11...
Using CPython 3.11.15
Creating virtual environment at: venv
Activate it with: source venv/bin/activate
✓ Virtual environment ready (Python 3.11)

⚠ ffmpeg not installed (TTS voice messages will be limited)
apt update && sudo apt install ffmpeg

source ~/.zshrc

hermes -V
# Hermes Agent v0.14.0 (2026.5.16)
# Project: /home/<user>/.hermes/hermes-agent
# Python: 3.11.15
# OpenAI SDK: 2.24.0
# Up to date

3.2 升级

1
hermes update

3.3 卸载

1
2
3
4
5
6
7
hermes gateway stop
systemctl --user disable hermes-gateway
hermes uninstall
rm -f ~/.local/bin/hermes
rm -rf ~/.hermes

source ~/.zshrc

四、配置 API Key

~/.hermes/.env 配置文件:

1
2
# GitHub 集成
echo "GITHUB_TOKEN=<YOUR_GITHUB_TOKEN>" >> ~/.hermes/.env

主配置 ~/.hermes/config.yaml

1
2
3
approvals:
  mode: manual    # manual | smart | off
  timeout: 60     # seconds to wait for user response

mode: manual 下 Agent 执行命令前需要用户确认;mode: smart 自动识别风险等级;mode: off 关闭审核(慎用)。

五、工具能力自检

安装后跑 hermes tools 查看工具可用性:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
Tool Availability Summary
  6/10 tool categories available:

   ✓ Vision (image analysis)
   ✗ Mixture of Agents (missing OPENROUTER_API_KEY)
   ✗ Web Search & Extract (missing EXA_API_KEY, PARALLEL_API_KEY, FIRECRAWL_API_KEY, TAVILY_API_KEY, or SEARXNG_URL)
   ✓ Browser Automation (Local browser)
   ✗ Image Generation (missing FAL_KEY or OPENAI_API_KEY)
   ✓ Text-to-Speech (Edge TTS)
   ✗ Skills Hub (GitHub) (missing GITHUB_TOKEN)
   ✓ Terminal/Commands
   ✓ Task Planning (todo)
   ✓ Skills (view, create, edit)

可用, 缺环境变量或 API key。

六、常用命令

1
2
3
4
5
6
7
8
9
hermes              # Interactive CLI — 开启对话
hermes model        # 选择 LLM provider 和 model
hermes tools        # 配置工具开关
hermes config set   # 设置配置项
hermes gateway      # 启动消息网关(Telegram、Discord 等)
hermes setup        # 完整配置向导
hermes claw migrate # 从 OpenClaw 迁移
hermes update       # 升级
hermes doctor       # 诊断

七、从 OpenClaw 平滑迁移

Hermes 的杀手锏——hermes claw migrate 一键导入 OpenClaw 配置

7.1 首次安装时自动检测

1
2
hermes setup
# 向导会自动检测 ~/.openclaw 并询问是否迁移

7.2 手动迁移

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# 交互式(推荐)
hermes claw migrate

# 预览(不实际执行)
hermes claw migrate --dry-run

# 仅迁移用户数据(不包含 API 密钥)
hermes claw migrate --preset user-data

# 覆盖已有冲突
hermes claw migrate --overwrite

7.3 迁移内容清单

类别内容目标位置
人格SOUL.md~/.hermes/workspace/
记忆MEMORY.md / USER.md~/.hermes/workspace/
技能用户创建的 Skills~/.hermes/skills/openclaw-imports/
命令白名单approval patterns~/.hermes/config.yaml
消息设置平台配置 / 允许用户 / 工作目录~/.hermes/config.yaml
API 密钥允许列表内的密钥~/.hermes/.env(加密)
TTS 资源workspace 音频文件~/.hermes/workspace/
Workspace 指令AGENTS.md~/.hermes/workspace/AGENTS.md

可选 --workspace-target 把 AGENTS.md 写入特定 workspace。

八、通道接入

8.1 Discord(推荐开发自用)

Discord Developer Portal 创建 Bot:

  1. 创建 Application,勾选公共机器人
  2. Privileged Gateway Intents 全开:
    • Presence Intent
    • Server Members Intent
    • Message Content Intent(必须,否则收不到消息)
  3. OAuth2 URL Generator → scopes: bot + applications.commands,权限给管理员
  4. 邀请到服务器,复制服务器 ID 和频道 ID

~/.hermes/.env

1
2
3
DISCORD_BOT_TOKEN=<YOUR_BOT_TOKEN>
DISCORD_ALLOWED_USERS=<YOUR_DISCORD_USER_ID>
DISCORD_HOME_CHANNEL=<HOME_CHANNEL_ID>

~/.hermes/config.yaml

1
2
3
4
5
6
discord:
  require_mention: false          # 自用免 @
  free_response_channels: ''
  allowed_channels: '<HOME_CHANNEL_ID>'
  auto_thread: true               # 任务级隔离
  reactions: true

启动网关:

1
2
hermes gateway restart
hermes gateway status

8.2 钉钉

钉钉开放平台 注册应用。

~/.hermes/.env

1
2
3
DINGTALK_CLIENT_ID=<YOUR_CLIENT_ID>
DINGTALK_CLIENT_SECRET=<YOUR_CLIENT_SECRET>
DINGTALK_ALLOWED_USERS=manager3211   # 允许私聊的用户

~/.hermes/config.yaml

1
group_sessions_per_user: true

钉钉 CLI 工具(增强集成):

1
2
3
4
5
6
7
8
# 安装
curl -fsSL https://raw.githubusercontent.com/DingTalk-Real-AI/dingtalk-workspace-cli/main/scripts/install.sh | sh
# 或
npm install -g dingtalk-workspace-cli

# 登录
dws auth login
dws auth login --client-id <ID> --client-secret <SECRET>

注意:钉钉开放平台"CLI 访问管理"必须开启,并设置重定向 URL:

1
2
http://127.0.0.1
https://login.dingtalk.com

8.3 飞书

飞书 CLI 工具 安装:

1
2
npx @larksuite/cli@latest install
# 或打开链接:https://open.feishu.cn/page/cli

授权时 Hermes 会申请 161 个 Scopes(涉及邮件、文档、日历、消息、Wiki、Task、Sheets、Slides、Drive、Minutes、Mail、OKR、Contact 等)。某些高权限 scope(如 vc:meeting.bot.join:write)可能被拒,需手动重试。

首次启动会发配对码,需在 Hermes 端批准:

1
hermes pairing approve feishu <PAIRING_CODE>

绑定 Hermes 账号:

1
lark-cli config bind --source hermes --identity user-default

8.4 个人微信(Hermes 独有)

Hermes 内置 iLink 协议支持个人微信:

1
2
3
4
5
6
7
8
9
# Python 环境准备(一次性)
~/.hermes/hermes-agent/venv/bin/python -m ensurepip --upgrade
~/.hermes/hermes-agent/venv/bin/pip3 install --upgrade pip
~/.hermes/hermes-agent/venv/bin/pip install dingtalk-stream httpx aiohttp cryptography qrcode

# 启动网关
hermes gateway setup
# 输入:使用 Weixin user ID 作为 home channel? [Y/n]: y
# 显示:Home channel set to <YOUR_WECHAT_USER_ID>@im.wechat
1
2
3
✓ Weixin configured!
    Account ID: <YOUR_WECHAT_ACCOUNT_ID>@im.bot
    User ID: <YOUR_WECHAT_USER_ID>@im.wechat

首次使用需配对:

1
hermes pairing approve weixin 6XRAMJYQ

注意:电脑端看不到这个机器人(iLink 协议限制)

九、核心命令

1
2
3
4
5
6
7
8
9
hermes              # Interactive CLI
hermes model        # 选择 LLM provider / model
hermes tools        # 配置工具
hermes config set   # 单项设置
hermes gateway      # 消息网关
hermes setup        # 完整向导
hermes claw migrate # 从 OpenClaw 迁移
hermes update       # 升级
hermes doctor       # 诊断

输入使用外部编辑器:Ctrl+G(在 Hermes 提示符下)。

十、Web UI

hermes-web-ui 提供 Web 控制台。

十一、Hermes vs OpenClaw 选型建议

场景推荐
已重度使用 OpenClaw 1 年+Hermes(一键迁移 + 增量改进)
新项目从零搭建OpenClaw(生态更成熟)
需要 Discord 频道路由都行(OpenClaw 文档更详)
需要个人微信Hermes(OpenClaw 不支持)
需要 Hermes 系列模型深度优化Hermes
需要 ClawHub 技能市场都行(Hermes 完全兼容)
团队生产部署OpenClaw(更稳定,社区案例多)

十二、总结

Hermes Agent 是"OpenClaw 用户的理想升级路径"——保留熟悉的 SOUL.md、bindings、autoThread 模式,但核心代码重写更现代,与 Hermes 系列模型深度集成,又通过 hermes claw migrate 保证 OpenClaw 用户零成本迁移。

实战建议:

  1. OpenClaw 用户:先 hermes claw migrate --dry-run 预览,确认无误后 --overwrite 迁移
  2. 多通道场景:Discord 做开发自用,钉钉/飞书做团队沟通,个人微信用 Hermes 独有
  3. 鉴权简化hermes setup 向导比手动配 ~/.openclaw/openclaw.json 友好太多
  4. Hermes 模型:如果用 Hermes 系列模型,Hermes Agent 性能调优更好
  5. 配置备份~/.hermes/ 整个目录 git 版本控制,迁移/重装无忧

下一步:可参考 2025-09-15《OpenClaw 自托管 AI Agent》 看 OpenClaw 原版详细配置;2024-09-15《Cursor 实战》 对比 IDE 类 AI 工具的差异。

使用 Hugo 构建
主题 StackJimmy 设计