macOS 安装教程
系统要求
| 项目 | 要求 |
|---|---|
| 操作系统 | macOS 13 (Ventura) 或更高版本,仅支持 Apple Silicon(Intel 机型官方已列为不受支持) |
| 处理器 | Apple Silicon (M1/M2/M3) |
| 内存 | 至少 2GB RAM |
| Python | 3.11 ~ 3.13(安装脚本会自动处理,无需手动安装) |
| Git | 需要预装(用于克隆源码) |
| 网络 | 需要互联网连接 |
第一步:安装 Homebrew(如果未安装)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
验证安装:
brew --version # 应显示 4.x+
第二步:安装基础工具
brew install git curl
验证安装:
git --version # 应显示 2.x+
curl --version # 应显示 7.x+
第三步:一键安装 Hermes
官方源(默认,国际用户推荐):
curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash
国内镜像(官方源慢时再用):
curl -fsSL https://ghproxy.net/https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
【注意】 镜像只代理「下载脚本」这一步,代理不了脚本内部的 uv / Node.js 下载。2026-09 实测:官方源
hermes-agent.nousresearch.com在国内 0.4 秒即可拿到脚本,反而旧文推荐的ghfast.top已返回403 Forbidden by black list;且curl | bash管道下即使下载失败也会返回 0,让人误以为装好了。建议先curl -o install.sh落盘、肉眼确认是 shell 脚本再执行。
安装器会自动处理所有依赖(Python 3.11、Node.js、ripgrep、ffmpeg)。
第四步:验证安装
hermes --version
应显示版本号,如 hermes v0.21.5(版本迭代较快,以你实际看到的为准)。
如果提示 command not found:手动配置 PATH 后重试:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
使用 Bash 的用户将 ~/.zshrc 替换为 ~/.bashrc。
第五步:配置 AI 模型
hermes model
按向导提示:
- 选择模型提供商(如 MiMo、DeepSeek、minimax 等)
- 输入对应的 API Key
如果后续需要更换模型,再次执行 hermes model 即可。
第六步:配置飞书消息通道
方式一:扫码配对(推荐)
hermes gateway setup
在向导中选择 飞书 / Lark,然后选择 扫码创建(推荐),用手机飞书扫码授权即可。Hermes 会自动创建机器人应用并配置好所有权限。
【提示】 飞书 SDK(
lark-oapi)不需要手动安装:官方安装器建的虚拟环境里没有 pip,手动装必然失败;依赖由 gateway 首次启动时自动装上(日志会出现Platform 'Feishu / Lark' dependencies missing — attempting install...,随后完成: feishu connected)。
方式二:手动配置(备选)
如果扫码失败(如无管理员权限),改为手动模式:
- 在飞书开放平台创建应用,获取 App ID 和 App Secret
- 执行网关配置向导:
hermes gateway setup
- 在平台列表里选择 Feishu / Lark,再选手动输入,依次粘贴 App ID、App Secret
- 连接方式选 WebSocket(推荐,无需公网地址);域选
feishu(国内版) - DM 授权方式选 配对审批(推荐),群聊策略选 仅 @ 机器人时响应(推荐)
第七步:安装并启动 Gateway 服务
hermes gateway install
这一条命令会同时完成:写入 ~/Library/LaunchAgents/ai.hermes.gateway.plist、设置登录时自启、并立即启动网关。
查看运行状态:
hermes gateway status
【注意】 不要用
launchctl load手动加载 plist:文件名是ai.hermes.gateway.plist(不是com.hermes.gateway.plist),且launchctl load已是废弃写法,由hermes gateway install托管即可。日常管理用
hermes gateway start/stop/restart/status。
第八步:测试飞书机器人
- 打开飞书 App,搜索你的机器人名称
- 发送一条消息(如 你好)
如果使用扫码方式,授权即完成身份绑定,机器人应直接回复。
如果使用手动配置方式,第一次发消息时需要批准配对码:
hermes pairing list # 查看待批准的配对请求(不带平台参数)
hermes pairing approve feishu <配对码> # 批准
【提示】 批准立即生效、无需重启 gateway,下一条消息就会被正常受理(实测:批准后 2 秒内发出的消息即被响应)。
运行诊断(可选)
hermes doctor
检查安装和配置是否完整。
Windows 安装教程
系统要求
| 项目 | 要求 |
|---|---|
| 操作系统 | Windows 10 (1903+) 或 Windows 11 |
| 处理器 | x64 架构 CPU |
| 内存 | 至少 2GB RAM |
| Python | 3.11 ~ 3.13(安装脚本会自动处理,无需手动安装) |
| Git | 需要预装(用于克隆源码) |
| 网络 | 需要互联网连接 |
第一步:安装 Git
以管理员身份打开 PowerShell,安装 Git:
winget install Git.Git
安装完成后关闭并重新打开 PowerShell,验证:
git --version # 应显示 2.x+
第二步:安装 Hermes
以管理员身份打开 PowerShell,执行官方安装脚本:
官方源(默认,国际用户推荐):
iex (irm https://hermes-agent.nousresearch.com/install.ps1)
国内镜像(官方源慢时再用):
iex (irm https://ghproxy.net/https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.ps1)
【注意】 镜像只代理「下载脚本」这一步。2026-09 实测
ghfast.top已返回 403,改用ghproxy.net;irm | iex管道下即使下载失败也可能不报错,建议先irm -OutFile install.ps1落盘确认再执行。
安装器会自动处理所有依赖(Python 3.11、Node.js、ripgrep、ffmpeg)。
第三步:验证安装
hermes --version
应显示版本号,如 hermes v0.21.5(版本迭代较快,以你实际看到的为准)。
如果提示 command not found:重启 PowerShell 终端,或手动添加 PATH:
# 将 %USERPROFILE%\.local\bin 添加到用户 PATH
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";$env:USERPROFILE\.local\bin", "User")
# 重启终端后生效
第四步:配置 AI 模型
hermes model
按向导提示:
- 选择模型提供商(如 MiMo、DeepSeek、minimax 等)
- 输入对应的 API Key
如果后续需要更换模型,再次执行 hermes model 即可。
第五步:配置飞书消息通道
方式一:扫码配对(推荐)
hermes gateway setup
在向导中选择 飞书 / Lark,然后选择 扫码创建(推荐),用手机飞书扫码授权即可。Hermes 会自动创建机器人应用并配置好所有权限。
【提示】 飞书 SDK 不需要手动安装,由 gateway 首次启动时自动装好。
方式二:手动配置(备选)
如果扫码失败(如无管理员权限),改为手动模式:
- 在飞书开放平台创建应用,获取 App ID 和 App Secret
- 执行网关配置向导:
hermes gateway setup
- 在平台列表里选择 Feishu / Lark,再选手动输入,依次粘贴 App ID、App Secret
- 连接方式选 WebSocket(推荐);域选
feishu - DM 授权方式选 配对审批(推荐),群聊策略选 仅 @ 机器人时响应(推荐)
第六步:安装并启动 Gateway 服务
hermes gateway install
这一条命令会同时完成:注册计划任务、设置开机自启、并立即启动网关。
查看运行状态:
hermes gateway status # 应显示 Gateway process running (PID: xxxx)
【注意】 不能跳过
install直接hermes gateway start:没装服务时它会以退出码 1 结束并提示未完成: Gateway service is not installed。日常管理用
hermes gateway start/stop/restart/status。
第七步:测试飞书机器人
- 打开飞书 App,搜索你的机器人名称
- 发送一条消息(如 你好)
如果使用扫码方式,授权即完成身份绑定,机器人应直接回复。
如果使用手动配置方式,第一次发消息时需要批准配对码:
hermes pairing list # 查看待批准的配对请求(不带平台参数)
hermes pairing approve feishu <配对码> # 批准
【提示】 批准立即生效、无需重启 gateway。
运行诊断(可选)
hermes doctor
检查安装和配置是否完整。
Linux 安装教程(Ubuntu / Debian)
系统要求
| 项目 | 要求 |
|---|---|
| 操作系统 | Ubuntu 20.04+、Debian 11+ 或其他 Debian 系发行版 |
| 处理器 | x64 或 ARM64 |
| 内存 | 至少 2GB RAM |
| Python | 3.11 ~ 3.13(安装脚本会自动处理,无需手动安装) |
| Git / curl / xz-utils | 需要预装(Node.js 以 .tar.xz 分发,缺 xz 解不开) |
| C++ 编译器 | Debian/Ubuntu 需 build-essential(缺了安装会静默失败,见下文) |
| 网络 | 需要互联网连接 |
第一步:安装基础工具
sudo apt update
sudo apt install -y git curl xz-utils build-essential
验证安装:
git --version # 应显示 2.x+
curl --version # 应显示 7.x+
xz --version # 应显示 5.x+
g++ --version # 应显示 11 或更高
【注意】
build-essential不要省。实测在一台没装编译器的干净 Ubuntu 上,官方安装器只打印几行【注意】 Could not install a C++ compiler automatically就继续走,然后在编译node-pty时报not found: make直接退出——整个过程没有任何一句「安装失败」,最后hermes命令也不存在。装上build-essential是唯一解。
第二步:一键安装 Hermes
官方源(默认,国际用户推荐):
curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash
国内镜像(官方源慢时再用):
curl -fsSL https://ghproxy.net/https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
【注意】 镜像只代理「下载脚本」这一步,代理不了脚本内部的 uv / Node.js 下载。2026-09 实测:官方源
hermes-agent.nousresearch.com在国内 0.4 秒即可拿到脚本,反而旧文推荐的ghfast.top已返回403 Forbidden by black list;且curl | bash管道下即使下载失败也会返回 0,让人误以为装好了。建议先curl -o install.sh落盘、肉眼确认是 shell 脚本再执行。
安装器会自动处理所有依赖(Python 3.11、Node.js、ripgrep、ffmpeg)。
第三步:验证安装
hermes --version
应显示版本号,如 hermes v0.21.5(版本迭代较快,以你实际看到的为准)。
如果提示 command not found:手动配置 PATH 后重试:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
使用 Zsh 的用户将 ~/.bashrc 替换为 ~/.zshrc。
第四步:配置 AI 模型
hermes model
按向导提示:
- 选择模型提供商(如 MiMo、DeepSeek、minimax 等)
- 输入对应的 API Key
如果后续需要更换模型,再次执行 hermes model 即可。
第五步:配置飞书消息通道
方式一:扫码配对(推荐)
hermes gateway setup
在向导中选择 飞书 / Lark,然后选择 扫码创建(推荐),用手机飞书扫码授权即可。Hermes 会自动创建机器人应用并配置好所有权限。
【提示】 飞书 SDK(
lark-oapi)不需要手动安装:官方安装器建的虚拟环境里没有 pip,手动装必然失败;依赖由 gateway 首次启动时自动装上(日志会出现Platform 'Feishu / Lark' dependencies missing — attempting install...,随后完成: feishu connected)。
方式二:手动配置(备选)
如果扫码失败(如无管理员权限),改为手动模式:
- 在飞书开放平台创建应用,获取 App ID 和 App Secret
- 执行网关配置向导:
hermes gateway setup
- 在平台列表里选择 Feishu / Lark,再选手动输入,依次粘贴 App ID、App Secret
- 连接方式选 WebSocket(推荐,无需公网地址);域选
feishu(国内版) - DM 授权方式选 配对审批(推荐),群聊策略选 仅 @ 机器人时响应(推荐)
第六步:安装并启动 Gateway 服务
hermes gateway install
这一条命令会同时完成:写入 ~/.config/systemd/user/hermes-gateway.service、systemctl --user enable、自动开启 linger(注销后仍运行、开机自启)、并立即启动网关。
查看运行状态:
hermes gateway status
systemctl --user status hermes-gateway
【注意】 不能跳过
install直接hermes gateway start:没装服务时会以退出码 1 结束并提示未完成: Gateway service is not installed。只写
systemctl --user enable hermes-gateway不能实现开机自启——还需要sudo loginctl enable-linger $USER,而hermes gateway install已经替你做了(日志有完成: Linger enabled — gateway will persist after logout)。查日志:
journalctl --user -u hermes-gateway -f
第七步:测试飞书机器人
- 打开飞书 App,搜索你的机器人名称
- 发送一条消息(如 你好)
如果使用扫码方式,授权即完成身份绑定,机器人应直接回复。
如果使用手动配置方式,第一次发消息时需要批准配对码:
hermes pairing list # 查看待批准的配对请求(不带平台参数)
hermes pairing approve feishu <配对码> # 批准
【提示】 批准立即生效、无需重启 gateway,下一条消息就会被正常受理(实测:批准后 2 秒内发出的消息即被响应)。
运行诊断(可选)
hermes doctor
检查安装和配置是否完整。
国内网络安装的五个坑(2026-09 实测)
下面三条都在国内出口的机器上真实复现过(海南联通,1 核 2G Ubuntu 24.04),不看这篇直接 curl | bash 大概率装不上,而且失败了还不知道为什么。
坑 1:uv 下载会无限期卡住,且不报错
安装器要从 astral.sh / github.com 下载约 20MB 的 uv。实测直连速度只有 546 B/s(要 8.8 小时),换 github.com 直连甚至停滞在 0 B/s;而安装器没有设超时、没有进度条、也不报错,屏幕就停在一行 → Installing managed uv into ~/.hermes/bin ...。
解法:提前用镜像把 uv 放到位,安装器检测到 ~/.hermes/bin/uv 就会直接复用、跳过下载:
mkdir -p ~/.hermes/bin
# 从镜像下载(实测 400 KB/s 左右;断流了就多重试几次,-C - 是断点续传)
for i in 1 2 3 4 5; do
curl -sSL --http1.1 -C - -o /tmp/uv.tar.gz \
https://ghproxy.net/https://github.com/astral-sh/uv/releases/download/0.12.18/uv-x86_64-unknown-linux-gnu.tar.gz
[ "$(stat -c%s /tmp/uv.tar.gz)" = "19798687" ] && break
done
tar -xzf /tmp/uv.tar.gz -C /tmp
cp /tmp/uv-x86_64-unknown-linux-gnu/uv /tmp/uv-x86_64-unknown-linux-gnu/uvx ~/.hermes/bin/
chmod +x ~/.hermes/bin/uv*
uv --version # 应显示 uv 0.12.18
坑 2:缺 C++ 编译器会导致「静默失败」
安装器要编译 node-pty,需要 make + g++。干净系统上没有时,它只打印几行警告就继续:
【注意】 No C++ compiler found
【注意】 Could not install a C++ compiler automatically.
【注意】 Node steps that compile native modules (e.g. node-pty) will fail below until one is installed.
→ Install it manually, then re-run this installer:
→ sudo apt install build-essential
然后安装器以退出码 1 结束——没有任何一句「安装失败」,最后 hermes 命令不存在、~/.local/bin 也没建。npm 日志里的真实原因是 gyp ERR! stack Error: not found: make。
解法:安装前先装好(见第一步),装完用下面这条判断成功与否:
hermes --version # 能打印版本号才算真装好
坑 3:Node.js 26 下载可能失败,会自动降级到 24
实测出现过:
【注意】 Node.js unreadable from https://nodejs.org/dist/latest-v26.x/ cannot build native modules — trying an older release line...
→ Downloading node-v24.21.0-linux-x64.tar.xz...
完成: Node.js v24.21.0 installed to ~/.hermes/node/
这是安装器的自动降级逻辑,不是错误,Node 24.11+ / 26+ 都在支持范围内,无需干预。
坑 4:托管 Python 3.14 的下载同样会卡死
安装器通过 uv 从 GitHub 拉取约 34MB 的 Python 3.14(python-build-standalone)。2026-09 实测直连只有 4KB/s(34MB 要下 2 个多小时),屏幕停在 Downloading cpython-3.14.7-linux-x86_64-gnu (34.3MiB) 那一行——不超时、不报错,和坑 1 一个毛病;坑 1 的备胎(预置 uv)管不到这里,因为这是 uv 再去拉 Python。
解法:用镜像把 Python 拉下来、搭个本地小镜像让 uv 从本地取,再跑安装器:
# 1) 从镜像下载(实测约 460KB/s;断流就多重试,-C - 是断点续传)
URL="https://ghproxy.net/https://github.com/astral-sh/python-build-standalone/releases/download/20260807/cpython-3.14.7%2B20260807-x86_64-unknown-linux-gnu-install_only_stripped.tar.gz"
for i in 1 2 3 4 5 6 7 8; do
curl -sSL --http1.1 -C - -o /tmp/py314.tar.gz "$URL" && break
done
# 2) 搭本地镜像(uv 按 <mirror>/<发布日期>/<文件名> 取文件)
mkdir -p /tmp/pymirror/20260807
mv /tmp/py314.tar.gz "/tmp/pymirror/20260807/cpython-3.14.7+20260807-x86_64-unknown-linux-gnu-install_only_stripped.tar.gz"
cd /tmp/pymirror && nohup python3 -m http.server 18989 --bind 127.0.0.1 >/dev/null 2>&1 &
# 3) 先用镜像装好 Python,再重跑安装器(会直接复用,秒过)
export UV_PYTHON_INSTALL_MIRROR="http://127.0.0.1:18989"
~/.hermes/tools/uv-0.12.3-linux-x64/uv python install 3.14
bash install.sh
版本号以安装器实际请求的为准:跑一次安装器,看到
Downloading cpython-3.x.y-...那行就是它要的版本,把上面的 URL、日期、文件名换成对应的即可。
坑 5:Chromium 167MB 从 Google 存储 0 速卡死
agent-browser(浏览器工具)依赖的 Chromium for Testing 从 cdn.playwright.dev 下载,会 302 跳转到 storage.googleapis.com——国内直连实测 30 秒 0 字节。安装器照样不超时不报错,进度条卡在 agent-browser: 85% 143.6 MiB / 167.3 MiB 装死。
解法:npmmirror 有 chrome-for-testing 镜像(实测 7.9MB/s,一分钟完事),下好按 pm 的缓存布局预置,安装器直接复用:
# 1) 从 npmmirror 镜像下载
curl -sSL --http1.1 -o /tmp/chrome-linux64.zip \
"https://registry.npmmirror.com/-/binary/chrome-for-testing/145.0.7632.6/linux64/chrome-linux64.zip"
# 2) 校验哈希(应与 ~/.hermes/hermes-agent/pm/lock.json 里 chromium 那项的 sha256 一致)
sha256sum /tmp/chrome-linux64.zip
# 3) 按 pm 缓存布局放好(<完整哈希> 换成上一步的输出)
mkdir -p ~/.hermes/tools/fetch-<完整哈希>
mv /tmp/chrome-linux64.zip ~/.hermes/tools/fetch-<完整哈希>/
# 4) 重跑安装器
bash install.sh
版本号和哈希都以你机器上
~/.hermes/hermes-agent/pm/lock.json里 chromium 那项为准(安装器跑到那一步时,日志里也能看到cdn.playwright.dev/builds/cft/<版本>/linux64/chrome-linux64.zip)。
顺带一提:安装器自己也会「失败但返回 0」
2026-09 实测:Python 下载重试 4 次全部失败后,安装器照样继续跑完、退出码还是 0,但 hermes 命令根本不存在。curl | bash 会掩盖下载失败,安装器自己的容错也会。所以更稳的写法是先落盘、确认内容是 shell 脚本再执行:
curl -fsSL https://hermes-agent.nousresearch.com/install.sh -o install.sh
head -3 install.sh # 应看到 #!/bin/bash
bash install.sh
判断装没装上只有一条金标准:
hermes --version # 能打印版本号才算真装好
装不上时,对照上面五个坑逐一排查;安装器可重复执行,已装好的步骤会自动复用。
另外:hermes model 和 hermes gateway setup 两个向导必须在真实终端里运行,通过管道或非交互方式调用会被直接拒绝(报 requires an interactive terminal)——写自动化脚本的话,改用 hermes config set 和编辑 ~/.hermes/.env 的等价方式。
常用管理命令速查
| 场景 | 命令 |
|---|---|
| 安装(Linux/macOS/WSL2) | curl -fsSL https://hermes-agent.nousresearch.com/install.sh \| bash |
| 安装(Windows 原生) | iex (irm https://hermes-agent.nousresearch.com/install.ps1) |
| 配置模型 | hermes model |
| 配置飞书 | hermes gateway setup |
| 安装网关服务(含开机自启) | hermes gateway install |
| 启动网关 | hermes gateway start |
| 停止网关 | hermes gateway stop |
| 重启网关 | hermes gateway restart |
| 查看网关状态 | hermes gateway status |
| 查看待批准配对 | hermes pairing list |
| 批准配对 | hermes pairing approve feishu <配对码> |
| 撤销某用户权限 | hermes pairing revoke feishu <用户 open_id> |
| 运行诊断 | hermes doctor |
| 查看总状态 | hermes status |
| 查看单个配置项 | hermes config get <键名> |
| 更新到最新版 | hermes update |
| 卸载 | hermes uninstall |
配置命令补充
| 作用 | 命令 |
|---|---|
| 运行完整配置向导(会覆盖所有配置) | hermes setup |
| 只修改模型/提供商 | hermes setup model |
| 配置消息平台(飞书) | hermes setup gateway |
| 直接设置某个配置项 | hermes config set |
评论 (0)