📌 新手提示:本文结尾提供了一键部署脚本(Windows / macOS / Linux 通用),不想手动逐条敲命令的同学,可以直接拉到文末下载运行,脚本会自动检测网络环境并选择最快的下载源。

一、Hermes Agent 是什么

Hermes AgentNous Research 开发的自进化 AI agent——它不只是"能聊天的 AI",而是目前唯一内置学习闭环(learning loop)的 agent:它从经验中自创技能、在使用中改进技能、主动提醒自己持久化知识、能搜索自己过去的对话、并跨会话逐步加深对你的理解

用三个场景说人话:

  • 它是个能"成长"的助手:第一次你让它写了个数据清洗脚本,它会把这个流程存成"技能"。下次你说"再清洗一份",它直接调技能,不用从零教。技能用得越多它越熟,跟人积累经验一个道理。
  • 它不住在你电脑里:跑在云端 VPS 上,你从手机 Telegram 给它发消息就能指挥它干活——白天让它监控日志、晚上让它跑备份、每周生成周报。它闲时几乎不耗钱(Daytona/Modal 这类 serverless 后端空闲时自动休眠)。
  • 不绑任何一家模型:今天用 Claude,明天用 GPT,后天换 DeepSeek——hermes model 一条命令切换,代码不动、数据不丢。

核心能力(来自官方 README):

| 能力 | 说明 | |—| | 真·终端界面 | 全功能 TUI:多行编辑、slash 命令自动补全、历史回溯、中断重定向、流式工具输出 | | 住在你常驻的 IM 里 | Telegram / Discord / Slack / WhatsApp / Signal / 邮件,全从一个 gateway 进程接入 | | 闭环学习 | agent 自管的记忆 + 周期性自提醒;复杂任务后自动建技能;FTS5 全文检索跨会话召回 | | 定时任务 | 内置 cron 调度器,自然语言定义,投递到任意平台——每日报告、每晚备份、每周审计 | | 并行委派 | 派生隔离 subagent 并行干活;Python 脚本经 RPC 调工具,多步流水线压成一轮 | | 跑哪都行 | 七种终端后端:本地、Docker、SSH、Singularity、Modal、Daytona、Vercel Sandbox |

许可:MIT License,完全开源(GitHub 仓库)。

💡 国内用户读链接:GitHub 与 hermes-agent.nousresearch.com 在大陆可能无法直连。海外用户直连即可;国内用户可用 ghfast.top 代理 GitHub(URL 前缀 https://ghfast.top/),或直接用文末一键脚本(自动选源)。

二、它和 Claude Code / OpenClaw 什么关系

  • Claude Code终端编程助手——你坐在电脑前写代码时用它。它强,但它是"你开终端它才在"的被动工具,关了终端就没了。
  • Hermes Agent常驻 agent——跑在云端 7×24 不下线,你从 IM 随时找它,它有记忆、会自创技能、能定时干活。定位是"长在你数字生活里的私人 AI 助手"。
  • OpenClaw 用户:Hermes 是 OpenClaw 的精神继任者,官方内置迁移命令 hermes claw migrate,可一键导入你 OpenClaw 的 SOUL.md、记忆、技能、API keys、IM 配置。

三、安装 Hermes Agent

Hermes 官方提供一键安装脚本,会自动装好 uv、Python 3.11、Node.js、ripgrep、ffmpeg 等依赖。

Linux / macOS / WSL2 / Termux

curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash

国内若 curl 直连该域名超时,可用代理前缀:

# 国内用户:走 ghfast.top 代理(海外用户直连即可)
curl -fsSL https://ghfast.top/https://hermes-agent.nousresearch.com/install.sh | bash

装完 reload shell:

source ~/.bashrc    # 或 source ~/.zshrc
hermes              # 启动!

Windows(原生 PowerShell,无需 WSL)

iex (irm https://hermes-agent.nousresearch.com/install.ps1)

安装器会自带一个便携版 Git Bash(MinGit,装到 %LOCALAPPDATA%\hermes\git,不需要管理员权限,与你系统已有的 Git 完全隔离)。Hermes 用这个自带 Git Bash 跑 shell 命令。如果你系统已装 Git,安装器会检测到并直接用系统的。

🔒 关于杀毒软件报 uv.exe:Bitdefender、Windows Defender 等 ML 类杀毒引擎常把 Hermes bin 目录里的 uv.exe(Rust 写的 Python 包管理器)误报为恶意软件——这是误报uv 是 Astral 官方工具,Hermes 用它管理 Python 环境。官方提供了基于 GitHub attestation 的完整验证流程(见仓库 README Troubleshooting 节)。若要加白名单,加整个文件夹而非文件 hash——Hermes 每次更新 uv 的 hash 会变。Windows Defender 加白:管理员 PowerShell 执行 Add-MpPreference -ExclusionPath "$env:LOCALAPPDATA\hermes\bin"

四、配置 LLM Provider(接入你的模型)

Hermes 不绑死任何 provider,但第一次配置 provider 是国内用户的第一个坎——默认端点 api.anthropic.com / api.openai.com 在大陆要么不通要么慢得无法用。下面先看基本命令,再给一个国内能直连的替代方案。

Hermes 不绑死任何 provider。第一次跑 hermes 会进交互式 setup 向导;也可以手动配:

hermes setup        # 完整向导(推荐新手)
hermes model        # 选 provider 和模型(OpenRouter / OpenAI / Anthropic / 自建端点 等)
hermes tools        # 配置启用哪些工具
hermes config set   # 设单个配置值
hermes config get   # 读单个配置值

五、Telegram 网关接入(手机随时对话)

Hermes 最有魅力的能力之一:跑一个 gateway 进程,你的 agent 就活在 Telegram/Discord/Slack 等 IM 里。以 Telegram 为例:

hermes gateway setup    # 交互式配置:填 BotFather 给的 token、指定允许对话的用户
hermes gateway start    # 启动 gateway(前台跑或挂 tmux/screen/systemd)

配置完后,在 Telegram 里给你的 bot 发消息,就是跟 Hermes agent 对话——它带着云端那套记忆和技能。手机发一句"帮我看看今晚的日志有没有报错",它在 VPS 上跑命令、分析、把结论发回 Telegram。

安全设计:gateway 不是裸奔的——有命令审批(敏感操作要你确认)、DM pairing(只认你绑定的账号)、容器隔离(在沙箱里跑工具)。详细见官方 Security 文档

六、常用命令速查

命令作用
hermes启动交互式 CLI
/new/reset开新对话
/model [provider:model]切换模型
/personality [name]设人格
/retry /undo重试/撤销上一轮
/compress /usage压缩上下文 / 看用量
/skills/<skill-name>浏览/调用技能
hermes gateway start启动 IM 网关
hermes doctor诊断问题
hermes update升级到最新版
hermes claw migrate从 OpenClaw 迁移

七、常见问题

Q: 跑在 VPS 上要多少配置?
A: 一台 $5/月 的 1C1G VPS 即可(agent 本身是 Python 进程,不跑本地模型时几乎不吃资源;模型推理走你配的 API)。想要本地模型则按模型规模上 GPU。

Q: 闲时费钱吗?
A: 用 Daytona 或 Modal 后端,环境空闲时自动 hibernate、按需 wake,空闲期几乎零成本。本地/Docker 后端则常驻。

Q: 会丢记忆吗?
A: 不会。记忆持久化在 ~/.hermes/ 下(跨会话)。技能也存在那里。升级 Hermes 不会动你的数据和技能。

Q: 能不用中转站直接接官方 API 吗?
A: 能,Hermes 不锁 provider。hermes model 选官方 provider、填官方 Key 即可。只是国内网络直连官方端点可能不稳,中转站是更顺手的选择。

八、总结

Hermes Agent 把"一个会成长、常驻云端、从手机就能指挥"的 AI 助手变成了 $5 VPS 就能跑起来的现实。它不锁模型、不锁平台、MIT 开源,国内用户用云间 API 中转站接上模型、用 Telegram 网关把它放进口袋——整套链路不用翻墙、不用绑海外卡。

  • Hermes Agent 仓库:https://github.com/NousResearch/hermes-agent(国内镜像 https://ghfast.top/https://github.com/NousResearch/hermes-agent
  • 官方文档:https://hermes-agent.nousresearch.com/docs/
  • 模型中转(本文默认推荐):https://cloudzone-api.cyou/——GPT 低至 0.05x、DeepSeek 0.3x 起、Claude 全系列 0.5x 起、香港节点国模延迟 30ms、90+ 模型按量计费

不想手动配?下面的一键脚本会自动检测网络、选最快源安装 Hermes、引导你配好 Key 和网关。

一键部署脚本

不想逐条敲命令的同学,下面这个脚本会自动完成:检测网络环境 → 安装 Hermes Agent → 引导配置 CZ API Key → 提示启动网关,国内国外网络都能用。脚本公开完整源码,不放心可以先复制给任意 AI 审查。

系统下载
macOS / Linux / WSLinstall-hermes-agent.sh
Windowsinstall-hermes-agent.ps1

不方便下载的同学,可以直接复制文末的完整源码,新建文本文档粘贴后改后缀为 .sh.ps1 运行。

使用说明

macOS / Linux / WSL:

chmod +x install-hermes-agent.sh
./install-hermes-agent.sh

Windows:

Windows 默认会阻止运行未签名的 PowerShell 脚本(这是 Windows 的安全策略,不是杀毒软件拦截)。在 PowerShell 中执行以下命令临时放行当前会话的执行策略,再运行脚本:

Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force
.\install-hermes-agent.ps1

🔒 关于"为什么要放行执行策略":Windows 出于安全考虑,默认禁止运行未经数字签名(我们没有购买代码签名证书)的 .ps1 脚本。-Scope Process 表示仅在当前 PowerShell 窗口生效,关闭窗口后自动恢复原策略,不会永久改变你系统的安全设置。如果你仍不放心,可以先把脚本完整源码复制给任意 AI(包括 Claude、ChatGPT 等),让它帮你判断脚本是否安全,再决定是否运行。这就是我们公开全部源码的原因。

脚本完整源码

macOS / Linux / WSL 版(install-hermes-agent.sh)


#!/usr/bin/env bash
# ============================================================
#  Hermes Agent 一键安装脚本(macOS / Linux / WSL)
#  公开源码,欢迎审查 —— 不放心可先复制给 AI 判断
#  默认配置:云间 API 中转站(https://cloudzone-api.cyou/)
#  功能:检测网络 → 安装 Hermes Agent → 引导配置 CZ API Key → 提示启动网关
# ============================================================

set -u

CLOUDZONE_URL="https://cloudzone-api.cyou"
CLOUDZONE_API_BASE="https://cloudzone-api.cyou/v1"
HERMES_INSTALL_URL="https://hermes-agent.nousresearch.com/install.sh"
GHFAST_PREFIX="https://ghfast.top/"

GREEN='\033[0;32m'; YELLOW='\033[1;33m'; RED='\033[0;31m'; CYAN='\033[0;36m'; NC='\033[0m'
info()  { echo -e "${GREEN}[INFO]${NC} $1"; }
warn()  { echo -e "${YELLOW}[WARN]${NC} $1"; }
error() { echo -e "${RED}[ERROR]${NC} $1"; }
step()  { echo -e "${CYAN}[STEP]${NC} $1"; }
fail()  { error "$1"; error "脚本无法继续。请把以上报错复制给 AI 或到 https://github.com/NousResearch/hermes-agent/issues 求助。"; exit 1; }

# ---------- 第 0 步:检测网络环境(国内 / 国外)----------
detect_network() {
  step "检测网络环境(国内 / 国外)..."
  if curl -fsI --max-time 6 "https://hermes-agent.nousresearch.com" >/dev/null 2>&1; then
    info "可直连 hermes-agent.nousresearch.com,判定为海外网络"
    echo "overseas"
  else
    warn "无法直连,判定为国内网络环境,将用 ghfast.top 代理"
    echo "domestic"
  fi
}

# ---------- 第 1 步:安装 Hermes Agent ----------
install_hermes() {
  local net="$1"
  step "安装 Hermes Agent(官方一键脚本)..."
  local url="$HERMES_INSTALL_URL"
  if [ "$net" = "domestic" ]; then
    url="${GHFAST_PREFIX}${HERMES_INSTALL_URL}"
    info "国内网络:走 ghfast.top 代理拉安装脚本"
  fi
  if curl -fsSL "$url" -o /tmp/hermes_install.sh 2>/dev/null && [ -s /tmp/hermes_install.sh ]; then
    info "下载安装脚本完成,执行安装..."
    bash /tmp/hermes_install.sh || fail "Hermes 安装脚本执行失败"
  else
    fail "无法下载 Hermes 安装脚本($url 不通?)"
  fi
  rm -f /tmp/hermes_install.sh
  # reload PATH
  export PATH="$HOME/.local/bin:$HOME/.cargo/bin:$PATH"
  if command -v hermes >/dev/null 2>&1; then
    info "Hermes 安装成功:$(hermes --version 2>/dev/null || echo hermes)"
  else
    warn "hermes 命令尚未在当前 PATH。请执行:source ~/.bashrc(或 ~/.zshrc)后重试 hermes 命令"
  fi
}

# ---------- 第 2 步:引导配置 CZ API Key ----------
setup_api_key() {
  echo ""
  echo "----------------------------------------"
  echo "Hermes 需要一个 LLM API Key 才能跑起来。"
  echo "推荐用云间 API 中转站(国内直连、不用翻墙、价格低至官方两折):"
  echo "  · GPT 低至 0.05x、DeepSeek 0.3x、Claude 0.5x 起"
  echo "  · 支持 90+ 模型,香港节点国模延迟低至 30ms"
  echo ""
  echo "是否现在跳转注册并获取 API Key?"
  echo "  Y - 立即跳转至 ${CLOUDZONE_URL}"
  echo "  N - 我已有 Key,自行输入"
  read -r -p "请选择 [Y/N]: " choice

  local API_KEY=""
  if [ "${choice:-N}" = "Y" ] || [ "${choice:-N}" = "y" ]; then
    info "正在打开浏览器..."
    if command -v xdg-open >/dev/null 2>&1; then
      xdg-open "$CLOUDZONE_URL" >/dev/null 2>&1
    elif command -v open >/dev/null 2>&1; then
      open "$CLOUDZONE_URL" >/dev/null 2>&1
    else
      warn "无法自动打开浏览器,请手动访问:$CLOUDZONE_URL"
    fi
    echo "注册后在「我的 API Key」页面复制 Key(以 sk- 开头)。"
    read -r -p "粘贴你的 API Key: " API_KEY
  else
    # 关闭回显,避免 Key 明文留在终端滚动区
    read -r -s -p "请输入你的 API Key (sk-...): " API_KEY
    echo
  fi

  if [ -z "${API_KEY:-}" ]; then
    warn "未输入 API Key,跳过自动配置。稍后可手动执行:hermes setup"
    return 0
  fi

  # Hermes 用交互式 hermes model / hermes setup 配 provider,无法纯命令行写 Key
  # 这里把 Key 存到环境变量并提示用户在 setup 向导里粘贴
  info "你的 Key 已收到。下面运行 Hermes setup 向导,在选 provider 时:"
  echo "  · provider 选 OpenAI 兼容(或 Anthropic)"
  echo "  · base_url 填:$CLOUDZONE_API_BASE"
  echo "  · API Key 填:你的 Key"
  echo ""
  export ANTHROPIC_API_KEY="$API_KEY"
  export ANTHROPIC_BASE_URL="$CLOUDZONE_API_BASE"
  export OPENAI_API_KEY="$API_KEY"
  export OPENAI_BASE_URL="$CLOUDZONE_API_BASE"
  info "已临时设好环境变量(仅本会话)。如要永久生效,加到 ~/.bashrc 或 ~/.zshrc。"
}

# ---------- 第 3 步:提示启动网关 ----------
hint_gateway() {
  echo ""
  step "下一步:把 Hermes 接到 Telegram(可选但强烈推荐)"
  echo "  1. 在 Telegram 找 @BotFather,/newbot 创建一个 bot,拿到 token"
  echo "  2. 运行:hermes gateway setup   (交互式填 token、绑你的 Telegram 账号)"
  echo "  3. 运行:hermes gateway start   (启动网关,建议挂 tmux/screen)"
  echo "  之后在 Telegram 给你的 bot 发消息,就是在跟云端 Hermes agent 对话。"
  echo ""
  echo "完整文档:https://hermes-agent.nousresearch.com/docs/user-guide/messaging"
}

# ---------- 主流程 ----------
main() {
  echo "============================================"
  echo "  Hermes Agent 一键部署"
  echo "  macOS / Linux / WSL 版"
  echo "============================================"
  echo ""

  local NET
  NET=$(detect_network)

  install_hermes "$NET"
  setup_api_key
  hint_gateway

  echo ""
  info "全部完成!"
  echo "  · 启动 CLI:hermes"
  echo "  · 选模型:hermes model"
  echo "  · 启动网关:hermes gateway start"
  echo "  · 诊断:hermes doctor"
  echo ""
  echo "详细教程:https://cleanresolver.com/tutorials/hermes-agent-guide/"
  echo "完整脚本源码已在文末公开,也可从 /scripts/install-hermes-agent.sh 下载"
}

main "$@"

Windows 版(install-hermes-agent.ps1)


# ============================================================
#  Hermes Agent 一键安装脚本(Windows PowerShell)
#  公开源码,欢迎审查 —— 不放心可先复制给 AI 判断
#  默认配置:云间 API 中转站(https://cloudzone-api.cyou/)
#  功能:检测网络 → 安装 Hermes Agent → 引导配置 CZ API Key → 提示启动网关
# ============================================================

$ErrorActionPreference = "Stop"
$CLOUDZONE_URL = "https://cloudzone-api.cyou"
$CLOUDZONE_API_BASE = "https://cloudzone-api.cyou/v1"
$HERMES_INSTALL_URL = "https://hermes-agent.nousresearch.com/install.ps1"
$GHFAST_PREFIX = "https://ghfast.top/"

function Write-Info($m) { Write-Host "[INFO] $m" -ForegroundColor Green }
function Write-Warn($m) { Write-Host "[WARN] $m" -ForegroundColor Yellow }
function Write-Err($m)   { Write-Host "[ERROR] $m" -ForegroundColor Red }
function Write-Step($m)  { Write-Host "[STEP] $m" -ForegroundColor Cyan }
function Fail($m) { Write-Err $m; Write-Err "脚本无法继续。请把以上报错复制给 AI 或到 https://github.com/NousResearch/hermes-agent/issues 求助。"; exit 1 }

# ---------- 第 0 步:检测网络环境 ----------
function Detect-Network {
    Write-Step "检测网络环境(国内 / 国外)..."
    try {
        $r = Invoke-WebRequest -Uri "https://hermes-agent.nousresearch.com" -Method Head -TimeoutSec 6 -UseBasicParsing
        Write-Info "可直连 hermes-agent.nousresearch.com,判定为海外网络"
        return "overseas"
    } catch {
        Write-Warn "无法直连,判定为国内网络环境,将用 ghfast.top 代理"
        return "domestic"
    }
}

# ---------- 第 1 步:安装 Hermes Agent ----------
function Install-Hermes($net) {
    Write-Step "安装 Hermes Agent(官方一键脚本)..."
    $url = $HERMES_INSTALL_URL
    if ($net -eq "domestic") {
        $url = "${GHFAST_PREFIX}${HERMES_INSTALL_URL}"
        Write-Info "国内网络:走 ghfast.top 代理拉安装脚本"
    }
    try {
        Write-Info "执行官方安装器..."
        & powershell -Command "iex (irm '$url')"
        if (-not $?) { Fail "Hermes 安装脚本执行失败" }
    } catch {
        Fail "无法下载/执行 Hermes 安装脚本($url 不通?)"
    }
    $env:Path = "$env:LOCALAPPDATA\hermes\bin;$env:Path"
    $h = Get-Command hermes -ErrorAction SilentlyContinue
    if ($h) {
        Write-Info "Hermes 安装成功"
    } else {
        Write-Warn "hermes 命令尚未在 PATH。请新开 PowerShell 窗口后重试 hermes 命令"
    }
}

# ---------- 第 2 步:引导配置 CZ API Key ----------
function Setup-ApiKey {
    Write-Host ""
    Write-Host "----------------------------------------"
    Write-Host "Hermes 需要一个 LLM API Key 才能跑起来。"
    Write-Host "推荐用云间 API 中转站(国内直连、不用翻墙、价格低至官方两折):"
    Write-Host "  · GPT 低至 0.05x、DeepSeek 0.3x、Claude 0.5x 起"
    Write-Host "  · 支持 90+ 模型,香港节点国模延迟低至 30ms"
    Write-Host ""
    Write-Host "是否现在跳转注册并获取 API Key?"
    Write-Host "  Y - 立即跳转至 $CLOUDZONE_URL"
    Write-Host "  N - 我已有 Key,自行输入"
    $choice = Read-Host "请选择 [Y/N]"

    if ($choice -eq "Y" -or $choice -eq "y") {
        Write-Info "正在打开浏览器..."
        try { Start-Process $CLOUDZONE_URL } catch { Write-Warn "无法自动打开浏览器,请手动访问:$CLOUDZONE_URL" }
        Write-Host "注册后在「我的 API Key」页面复制 Key(以 sk- 开头)。"
        $sec = Read-Host "粘贴你的 API Key" -AsSecureString
        $bstr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($sec)
        $apiKey = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($bstr)
    } else {
        $sec = Read-Host "请输入你的 API Key (sk-...)" -AsSecureString
        $bstr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($sec)
        $apiKey = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($bstr)
    }

    if ([string]::IsNullOrWhiteSpace($apiKey)) {
        Write-Warn "未输入 API Key,跳过自动配置。稍后可手动执行:hermes setup"
        return
    }

    Write-Info "你的 Key 已收到。下面运行 Hermes setup 向导,在选 provider 时:"
    Write-Host "  · provider 选 OpenAI 兼容(或 Anthropic)"
    Write-Host "  · base_url 填:$CLOUDZONE_API_BASE"
    Write-Host "  · API Key 填:你的 Key"
    Write-Host ""
    $env:ANTHROPIC_API_KEY = $apiKey
    $env:ANTHROPIC_BASE_URL = $CLOUDZONE_API_BASE
    $env:OPENAI_API_KEY = $apiKey
    $env:OPENAI_BASE_URL = $CLOUDZONE_API_BASE
    Write-Info "已临时设好环境变量(仅本窗口)。永久生效请用 setx 或系统环境变量设置。"
}

# ---------- 第 3 步:提示启动网关 ----------
function Hint-Gateway {
    Write-Host ""
    Write-Step "下一步:把 Hermes 接到 Telegram(可选但强烈推荐)"
    Write-Host "  1. 在 Telegram 找 @BotFather,/newbot 创建一个 bot,拿到 token"
    Write-Host "  2. 运行:hermes gateway setup   (交互式填 token、绑你的 Telegram 账号)"
    Write-Host "  3. 运行:hermes gateway start   (启动网关)"
    Write-Host "  之后在 Telegram 给你的 bot 发消息,就是在跟云端 Hermes agent 对话。"
    Write-Host ""
    Write-Host "完整文档:https://hermes-agent.nousresearch.com/docs/user-guide/messaging"
}

# ---------- 主流程 ----------
Write-Host "============================================"
Write-Host "  Hermes Agent 一键部署"
Write-Host "  Windows PowerShell 版"
Write-Host "============================================"
Write-Host ""

$net = Detect-Network
Install-Hermes $net
Setup-ApiKey
Hint-Gateway

Write-Host ""
Write-Info "全部完成!"
Write-Host "  · 启动 CLI:hermes"
Write-Host "  · 选模型:hermes model"
Write-Host "  · 启动网关:hermes gateway start"
Write-Host "  · 诊断:hermes doctor"
Write-Host ""
Write-Host "详细教程:https://cleanresolver.com/tutorials/hermes-agent-guide/"
Write-Host "完整脚本源码已在文末公开,也可从 /scripts/install-hermes-agent.ps1 下载"