Hermes 安装实战:WSL 代理配置、macOS proxychains 与多 Profile 克隆

一篇讲清 Hermes 实际可用路径的教程:WSL2 安装、hermes-gateway.service 代理配置、macOS proxychains 强制出网,以及 `hermes profile create agent2 --clone` / `--clone-all` / `--clone-from` 的用法。

Hermes 安装实战:WSL 代理配置、macOS proxychains 与多 Profile 克隆
目录

Hermes 安装实战:WSL 代理配置、macOS proxychains 与多 Profile 克隆

这篇只讲能直接照着做的可用路径,不讲铺垫。

适用场景:

  • 你想在 WSL2 里稳定跑 Hermes
  • Hermes 已经装上,但 Gateway / 模型请求超时
  • 你想再复制一个新助手,比如 agent2

如果你只想先跑通,最短路径就是这 4 步:

  1. 用官方脚本安装 Hermes
  2. 在 WSL2 里确认 systemd=true
  3. 给 hermes-gateway.service 注入代理环境变量
  4. 用 hermes profile create agent2 --clone 复制一个新 profile

1. 官方安装命令

Linux / macOS / WSL2 都可以先用官方安装脚本:

curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash

安装完成后,重新加载 shell:

source ~/.bashrc

然后做基础检查:

hermes
hermes doctor
hermes model

如果这里已经报缺依赖,就先按提示补齐;如果这里基本正常,但模型请求仍然超时,问题大概率在 Gateway 出网。


2. WSL2 先确认 systemd 已启用

因为后面要修改 hermes-gateway.service,所以 WSL2 最好先启用 systemd。

检查 /etc/wsl.conf:

[boot]
systemd=true

如果你刚改完,在 Windows 侧执行:

wsl --shutdown

然后重新进入 WSL。

可以用下面这条确认 systemd 是否已生效:

systemctl --user status

如果这一步都跑不通,后面的 service 代理配置就不用继续了,先把 WSL 的 systemd 打通。


3. WSL2 里最关键的一步:给 Hermes Gateway 配代理

这一步是最常见的卡点。

很多人碰到的问题不是“Hermes 装不上”,而是:

  • 命令本身能运行
  • 终端里 curl 也许能通
  • 但 hermes-gateway.service 作为 user service 启动时,没有继承到代理环境变量

结果就是模型请求、远程调用、Gateway 出网都不稳定。

3.1 编辑 service override

systemctl --user edit hermes-gateway.service

加入下面内容(按你自己的代理端口改):

[Service]
Environment="http_proxy=http://127.0.0.1:7890"
Environment="https_proxy=http://127.0.0.1:7890"
Environment="ALL_PROXY=http://127.0.0.1:7890"

3.2 重载并重启

systemctl --user daemon-reload
systemctl --user restart hermes-gateway.service
systemctl --user status hermes-gateway.service

3.3 看日志确认有没有真正起来

journalctl --user -u hermes-gateway.service -n 50 --no-pager

如果服务状态是正常的,但模型请求还是失败,优先检查两件事:

  1. WSL 能不能访问到这个代理地址
  2. 你的代理是否真的监听在这个端口

如果 WSL 里访问不到 127.0.0.1:7890,就把它换成 WSL 实际可访问到的宿主机地址,不要死写 127.0.0.1。


4. macOS 补充方案:用 proxychains-ng 强制 Gateway 走代理

如果你是在 macOS 上直接跑 Hermes,不想折腾 service 环境变量,比较直接的办法是:

用 proxychains-ng 强制 hermes gateway run 走代理。

4.1 安装 proxychains-ng

brew install proxychains-ng

4.2 修改配置

nano /opt/homebrew/etc/proxychains.conf

在配置里确认你的代理,例如:

socks5 127.0.0.1 7890

如果你用的是 http 代理,就按自己的实际类型改。

4.3 用 proxychains 启动 Gateway

proxychains4 -q hermes gateway run

如果你想临时验证 Hermes 的网络问题,这个方法通常比先改一堆全局环境变量更直接。


5. 创建新的 Hermes profile:agent2 --clone

这一段是昨天那版漏掉的关键内容,这里单独补全。

Hermes 的 profile 可以理解成:

  • 一套独立配置
  • 一套独立人格 / SOUL
  • 一套独立环境变量
  • 视命令不同,还可以带上独立的 skills、memories、sessions

5.1 从当前 profile 复制一份配置

如果你当前 profile 已经可用,最常见的做法就是:

hermes profile create agent2 --clone

这条命令会从当前 profile复制:

  • config.yaml
  • .env
  • SOUL.md

适合场景:

  • 你已经把模型、网关、代理都调好了
  • 现在只想快速分出一个新的助手角色

创建后切过去:

hermes profile use agent2

查看当前有哪些 profile:

hermes profile list

5.2 连 memories / sessions / skills / state 一起完整克隆

如果你不是只想复制配置,而是想把当前 profile 的大部分运行状态一起带过去,用:

hermes profile create agent2-backup --clone-all

--clone-all 适合:

  • 做完整备份
  • 做“当前助手的平行副本”
  • 迁移到另一套用途非常接近的 profile

但也要注意:

它会复制得更彻底,不只是配置。

如果你只是想新建一个干净角色,一般优先用 --clone,不要上来就 --clone-all。


5.3 从指定 profile 克隆,而不是从当前 profile 克隆

如果你现在人在 default,但你真正想复制的是 work,用:

hermes profile create agent2 --clone --clone-from work

如果要完整复制指定 profile:

hermes profile create work-backup --clone-all --clone-from work

这个场景很实用:

  • 当前 shell 不在目标 profile
  • 但你想基于某个稳定 profile 再分叉一个新助手

6. 几条最常用的 profile 命令

查看所有 profile

hermes profile list

切换默认 profile

hermes profile use agent2

回到默认:

hermes profile use default

查看某个 profile 详情

hermes profile show agent2

给 profile 重新生成 alias

hermes profile alias agent2

如果你经常在多个助手之间切换,这几个命令基本够用了。


7. 我建议的实际用法

如果你的目标是“先有一个稳定可用的 Hermes,再拆出多个角色”,顺序建议这样走:

路线 A:先跑通,再分身

  1. 在 WSL2 用官方脚本安装
  2. 确认 systemd=true
  3. 给 hermes-gateway.service 配代理
  4. 跑通 hermes doctor
  5. 再执行:
hermes profile create agent2 --clone
hermes profile use agent2

这是最稳的顺序。

路线 B:已经有一个稳定 profile,直接复制

hermes profile create research --clone
hermes profile create backup --clone-all

一个做新角色,一个做完整备份。


8. 常见问题

Q1:Hermes 命令能跑,但模型请求总超时,优先查什么?

先查这 3 项:

  1. hermes-gateway.service 是否真的在跑
  2. service 是否拿到了代理环境变量
  3. WSL / macOS 侧代理端口是否真的可达

最常见的问题,不是安装脚本本身,而是 Gateway 出网链路。

Q2:--clone 和 --clone-all 怎么选?

  • 只想复制配置:--clone
  • 想把 skills / memories / sessions / state 也一起复制:--clone-all

大多数情况下,先用 --clone 更干净。

Q3:为什么我不建议把教程写成一大堆概念说明?

因为 Hermes 这类工具最容易卡住的地方,不在概念,而在:

  • service 环境变量
  • 代理是否真正作用到 Gateway
  • profile 到底复制了什么

教程把这三件事讲清楚,实用价值就够了。


结论

如果你只记 3 句话:

  1. WSL2 跑 Hermes,先确认 systemd。
  2. 模型请求超时,优先检查 hermes-gateway.service 的代理环境变量。
  3. 要快速复制一个新助手,就用 hermes profile create agent2 --clone。

这基本就是现在这套最省时间的 Hermes 入门路径。

相关文章

AI 工具 · 2026-07-08CodexPro 使用方法:把本地项目接到 ChatGPT 的轻量 MCP 服务OpenClaw · 2026-04-14OpenClaw Proxy 设置,7890 端口为例工具分享 · 2026-05-13我整理了一份 9.9 元的 AI 提效包