Blog Entry

2026.04.10-hermes-agent

2026.04.10-hermes-agent

Created
2026/04/10
Updated
2026/04/10

环境

  • Windows11 (宿主机)
  • Ubuntu-24.04 (WSL)

chsrc

Terminal window
curl https://chsrc.run/posix | bash
chsrc set ubuntu
chsrc set uv
# 有可能随到很久不更新的源, 导致某些版本下载不到
chsrc set nvm
chsrc set nodejs
chsrc set npm #需要先安装node
chsrc set bun

uv

Terminal window
curl -LsSf https://astral.sh/uv/install.sh | sh

安装

nodejs (nvm)

Terminal window
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash
  • 重开UBuntu命令行
  • 安装nodejs
Terminal window
# 看下v24的LTS版本 (openclaw当前的推荐版本)
nvm ls-remote 22 --lts
# 安装 (当前hermes推荐的lts)
nvm install 22.22.2
nvm use 22.22.2
# 查看node版本
node -v

Hermes

安装

Terminal window
# 官网安装脚本
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
# 或者修改并执行
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | sed 's/npm install --silent 2>\/dev\/null || {/npm install || {/g' | bash
  • 或者先下载脚本,修改一点再运行
Terminal window
curl https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh -o install.sh
vim install.sh
  • 安装Node.js的依赖有可能会很久, 可以把运行输出打印处理
Terminal window
log_info "Installing Node.js dependencies (browser tools)..."
cd "$INSTALL_DIR"
npm install --silent 2>/dev/null || {
log_warn "npm install failed (browser tools may not work)"
}
  • 修改为:
Terminal window
log_info "Installing Node.js dependencies (browser tools)..."
cd "$INSTALL_DIR"
npm install || {
log_warn "npm install failed (browser tools may not work)"
}

profile-xkyii

Terminal window
# 创建xkyii
hermes profile create xkyii
# 使用xkyii作为默认profile
hermes profile use xkyii

profile-weche

Terminal window
# 创建xkyii
hermes profile create wechat
# 使用xkyii作为默认profile
hermes profile use wechat
mkdir -p ~/.hermes/profiles/wechat/skills/xky
# cp -r ~/.xky/skills/. ~/.hermes/profiles/wechat/skills/xky/
# .env不需要单独复制过来了
# cp -r ~/.xky/skills/.env ~/.hermes/profiles/wechat/skills/xky/
# 删除再复制
for dir in ~/.xky/skills/xky*/; do
target="$HOME/.hermes/profiles/wechat/skills/xky/$(basename "$dir")"
echo $target
rm -rf "$target"
cp -r "$dir" "$target"
done
mkdir -p ~/.hermes/profiles/wechat/skills/baoyu
cp -r ~/.agent/skills/. ~/.hermes/profiles/wechat/skills/baoyu/
# 删除再复制
for dir in ~/.agents/skills/baoyu*/; do
target="$HOME/.hermes/profiles/wechat/skills/baoyu/$(basename "$dir")"
rm -rf "$target"
cp -r "$dir" "$target"
done

配置

Terminal window
hermes setup

gateway

Terminal window
# 配置
hermes gateway setup
# 后台运行
hermes gateway start
# 前台运行
hermes gateway run
# 详细日志
hermes gateway run -v
Terminal window
$ hermes gateway setup
┌─────────────────────────────────────────────────────────┐
Gateway Setup
├─────────────────────────────────────────────────────────┤
Configure messaging platforms and the gateway service.
Press Ctrl+C at any time to exit.
└─────────────────────────────────────────────────────────┘
Gateway service is installed but not running.
Start it now? [Y/n]: y
User service started
Messaging Platforms
─── 📱 Telegram Setup ───
1. Open Telegram and message @BotFather
2. Send /newbot and follow the prompts to create your bot
3. Copy the bot token BotFather gives you
4. To find your user ID: message @userinfobot it replies with your numeric ID
Paste the token from @BotFather (step 3 above).
Bot token:
Saved TELEGRAM_BOT_TOKEN
Paste your user ID from step 4 above.
The gateway DENIES all users by default for security.
Enter user IDs to create an allowlist, or leave empty
and you'll be asked about open access next.
Allowed user IDs (comma-separated): xkyii
✓ Saved — only these users can interact with the bot.
For DMs, this is your user ID. You can set it later by typing /set-home in chat.
Home channel ID (for cron/notification delivery, or empty to set later with /set-home): xky05
✓ Saved TELEGRAM_HOME_CHANNEL
✓ 📱 Telegram configured!
◆ Messaging Platforms
Skipped (keeping current)
──────────────────────────────────────────────────────────
Restart the gateway to pick up changes? [Y/n]: y
✓ User service restarted

telegram

早上起来发现gateway的状态不对, telegram连不上:

Terminal window
$ hermes gateway status
hermes-gateway.service - Hermes Agent Gateway - Messaging Platform Integration
Loaded: loaded (/home/xkyii/.config/systemd/user/hermes-gateway.service; enabled; preset: enabled)
Active: active (running) since Sat 2026-04-11 12:21:05 CST; 8s ago
Main PID: 285 (python)
Tasks: 4 (limit: 18995)
Memory: 120.8M (peak: 121.5M)
CPU: 502ms
CGroup: /user.slice/user-1000.slice/user@1000.service/app.slice/hermes-gateway.service
└─285 /home/xkyii/.hermes/hermes-agent/venv/bin/python -m hermes_cli.main gateway run --replace
Apr 11 12:21:05 xky05 systemd[218]: Started hermes-gateway.service - Hermes Agent Gateway - Messaging Platform Integration.
Apr 11 12:21:11 xky05 python[285]: WARNING gateway.platforms.telegram_network: [Telegram] Primary api.telegram.org…4.167.220
Hint: Some lines were ellipsized, use -l to show in full.
User gateway service is running
Recent gateway health:
telegram: Telegram startup failed: Timed out
Systemd linger is enabled (service survives logout)

配置了一下代理, 给api.telegram.orgtelegram.org添加额外的代理规则就好

Skills

安装skill: https://skills.sh/anthropics/skills/docx
安装skill: https://skills.sh/anthropics/skills/xlsx
安装skill: https://skills.sh/d4vinci/scrapling/scrapling-official
安装skill: https://clawhub.ai/excalibur9527/mediacrawler-skill