1. 启动容器
1
| export IMAGE=nousresearch/hermes-agent:v2026.4.16
|
1
2
| mkdir -p hermes-agent-home
chmod -R 777 hermes-agent-home
|
1
2
3
| cat <<EOF > hermes-agent-home/.env
GATEWAY_ALLOW_ALL_USERS=true
EOF
|
1
| nerdctl network create hermes-net
|
1
2
3
4
5
6
7
8
| nerdctl run -d \
--name hermes-agent \
--restart always \
--network hermes-net \
-v $(pwd)/hermes-agent-home:/opt/data \
-v $(pwd)/openclaw-home/.openclaw:/root/.openclaw \
-p 8642:8642 \
$IMAGE gateway run
|
- 启动 hermes-agent dashboard
1
2
3
4
5
6
7
8
| nerdctl run -d \
--name hermes-dashboard \
--restart always \
--network hermes-net \
-p 9119:9119 \
-v $(pwd)/hermes-agent-home:/opt/data \
-e GATEWAY_HEALTH_URL=http://hermes-net:8642 \
$IMAGE dashboard --host 0.0.0.0 --insecure
|
1
| nerdctl rm hermes-agent hermes-dashboard --force
|
2. 基本使用
1
| nerdctl exec -it hermes-agent bash
|
1
| /opt/hermes/.venv/bin/hermes model
|
这里我选择的是自定义模型 (○) 26. Custom endpoint (enter URL manually)
1
| /opt/hermes/.venv/bin/hermes chat -q "hi"
|
1
| /opt/hermes/.venv/bin/hermes claw migrate
|
1
2
3
4
5
6
7
8
9
10
11
| ┌─────────────────────────────────────────────────────────┐
│ ⚕ Hermes — OpenClaw Migration │
└─────────────────────────────────────────────────────────┘
◆ Migration Settings
Source: /root/.openclaw
Target: /opt/data
Preset: full
Overwrite: no (skip conflicts)
Secrets: yes (allowlisted only)
|
1
| /opt/hermes/.venv/bin/hermes doctor
|
1
| /opt/hermes/.venv/bin/hermes
|
1
2
| echo "TELEGRAM_BOT_TOKEN=xxx
TELEGRAM_ALLOWED_USERS=xxx" >> /opt/data/.env
|
添加用户白名单限制。
1
| /opt/hermes/.venv/bin/hermes gateway restart
|
3. 远程调用集成
在部署机器上部署 server 提供 API ,参考 https://github.com/shaowenchen/demo/tree/master/hermes-agent-call 。server 接受到请求之后,在主机上执行如下命令:
1
| nerdctl exec -it hermes-agent /opt/hermes/.venv/bin/hermes chat --yolo -c -q "巡检一下集群"
|
这里的 -c 保持一个回话,便于 Hermes Agent 的自我进化。
1
| pm2 start "python3 hermes-agent-call.py" --name hermes-agent
|
1
| curl -X POST http://127.0.0.1:3011/call -H "Content-Type: application/json" -d '{"message":"hi"}'
|
1
| {"ok": true, "sessionid": "", "message": "hi", "command": "nerdctl exec hermes-agent /opt/hermes/.venv/bin/hermes chat --yolo -c -q \"hi\"", "exitCode": 0, "stdout": "Hey chenshaowen! 👋\nWhat can I help you with today?", "stderr": ""}
|
4. 查看面板

Hermes Agent 的面板,目前不能直接对话,主要用来配置和检查状态。