最后核验: 2026年7月31日 · Hermes 0.16.0
Hermes 是开源、可自托管、自我进化的 AI agent(Python,MIT)。在 WSL2 上装法和 Linux 一致——官方安装器落在 ~/.hermes。本指南对照一台跑着 Hermes v0.16.0 的活 WSL2 实例核验过。
1. 安装(官方一键脚本)
curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash
安装器自带依赖:uv、Python 3.11、Node.js、ripgrep、ffmpeg。在 WSL2 上它会检测你已有的 Git 直接用(不需要捆绑 Git)。所有东西落在 ~/.hermes,和系统 Python 隔离。
确认命令在 PATH 上:
hermes --version
2. 跑 setup 向导
hermes setup
一次性走完配置——模型 provider、渠道、skills。想要网页向导:
hermes setup --portal
3. 启动网关 + 聊天
hermes gateway setup # 配消息渠道
hermes gateway start # 启动网关
然后在配好的渠道上给 bot 发条消息。这就是标准路径:安装 → setup → 启动网关 → 聊天。
4.(可选)用 systemd user 服务常驻
hermes gateway start 跑在你的终端里;关终端就停。想让 Hermes 跨登出常驻 + 开机自启,用 systemd user 服务。下面这个 unit 改自一台真实运行的实例(2026-07-31 核验)——存成 ~/.config/systemd/user/hermes-gateway.service:
[Unit]
Description=Hermes Agent Gateway - Messaging Platform Integration
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
ExecStart=%h/.hermes/hermes-agent/venv/bin/python -m hermes_cli.main gateway run
WorkingDirectory=%h/.hermes
Environment="HERMES_HOME=%h/.hermes"
Restart=always
RestartSec=5
[Install]
WantedBy=default.target
然后启用 + 启动,并开 linger 让 user 服务在没有活动登录会话时也跑:
systemctl --user daemon-reload
loginctl enable-linger $USER
systemctl --user enable --now hermes-gateway.service
systemctl --user status hermes-gateway.service
%h 会展开成你的 home 目录,所以这个 unit 对所有用标准 ~/.hermes 路径安装的用户都通用。
排坑
- 找不到
hermes—— 安装器把二进制放在~/.hermes/hermes-agent/venv/bin/hermes,软链到~/.local/bin。确保~/.local/bin在PATH里(WSL2 通常默认就有)。 - 服务起不来 —— 看
journalctl --user -u hermes-gateway.service -f。最常见原因是hermes setup没走完(缺模型 provider 或渠道配置)。 - WSL2 混进 Windows PATH —— 服务
PATH里可能带 WSL2 继承的 Windows 路径。纯外观问题;真正跑的是 venv 里的 python。
来源 + 时效
安装步骤来自 Hermes 官方文档(quickstart、install.sh)。systemd unit 和 ~/.local/bin 软链细节于 2026-07-31 对照活 WSL2 实例核验(Hermes v0.16.0)。Hermes 迭代快——部署前重新核对安装器 URL 和版本。