安装指南

在 Linux、macOS 或 WSL2 上安装 Hermes Agent

快速安装

推荐使用官方一键安装脚本。支持 LinuxmacOSWSL2(Windows Subsystem for Linux 2)。

bash
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
Windows 用户注意:原生 Windows 不受支持。请先安装 WSL2,然后在 WSL2 终端中运行上述命令。

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

source ~/.bashrc    # 如果用 zsh:source ~/.zshrc

系统要求

项目 要求
操作系统 Linux、macOS、WSL2(不支持原生 Windows)
前置依赖 Git(安装程序会自动处理 Python、Node.js 等依赖)
网络 需要访问 GitHub 和模型 API 端点
推荐硬件 $5/月 VPS 即可运行,也支持 GPU 集群和 Serverless

验证安装

安装完成后,运行以下命令验证:

hermes --version

如果看到版本号输出,说明安装成功。你也可以运行诊断工具:

hermes doctor

配置

Hermes Agent 需要至少配置一个 LLM 提供商。运行设置向导:

hermes setup

设置向导会引导你完成:

  1. 选择模型提供商 — 支持 OpenRouter(200+ 模型)、OpenAI、Anthropic、Nous Portal、Google Gemini 等
  2. 输入 API Key — 至少需要一个提供商的密钥
  3. 配置消息平台(可选) — Telegram、Discord、Slack 等
  4. 启用工具 — 选择需要启用的工具集

也可以单独配置各部分:

hermes model        # 选择模型
hermes tools        # 配置工具
hermes config set   # 设置单个配置项

常用命令

命令 说明
hermes 启动交互式 CLI 对话
hermes setup 运行完整设置向导
hermes model 切换模型提供商和模型
hermes tools 配置启用的工具
hermes gateway 启动消息网关(Telegram 等)
hermes update 更新到最新版本
hermes doctor 诊断问题

常见问题

问题:curl 命令执行失败

可能原因和解决方案:

  • 网络问题:确保可以访问 GitHub。中国大陆用户可能需要设置代理:export https_proxy=http://your-proxy:port
  • curl 未安装:运行 sudo apt install curl(Ubuntu/Debian)或 brew install curl(macOS)

问题:hermes 命令未找到

  • 确保已运行 source ~/.bashrcsource ~/.zshrc
  • 检查 ~/.local/bin 是否在 PATH 中
  • 尝试重新打开终端

问题:Python 相关错误

  • Hermes 需要 Python 3.10+。安装脚本会自动处理,但如果手动安装,请确保 Python 版本正确
  • 尝试运行 hermes doctor 自动诊断

问题:WSL2 安装问题

  • 确保 WSL2 版本足够新:wsl --update
  • 推荐使用 Ubuntu 22.04+ 发行版
  • 在 WSL2 中运行 sudo apt update && sudo apt install -y curl git 后再执行安装脚本

问题:模型 API 连接失败

  • 确认 API Key 是否正确:hermes config get provider.api_key
  • 检查网络是否能访问对应的 API 端点
  • 尝试使用 OpenRouter 作为统一入口(支持 200+ 模型)

获取更多帮助