跳到主要内容

安装

使用一行安装程序在两分钟内启动并运行 Hermes Agent,或者按照手动步骤进行以获得完全控制。

快速安装

Linux / macOS / WSL2

curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash

Android / Termux

Hermes 现在也提供了一个 Termux 感知的安装路径:

curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash

安装程序自动检测 Termux 并切换到经过测试的 Android 流程:

  • 使用 Termux pkg 安装系统依赖(gitpythonnodejsripgrepffmpeg、构建工具)
  • 使用 python -m venv 创建虚拟环境
  • 自动导出 ANDROID_API_LEVEL 用于 Android wheel 构建
  • 使用 pip 安装精选的 .[termux] 额外组件
  • 默认跳过未经测试的浏览器 / WhatsApp 引导

如果你想要完全显式的路径,请参阅专门的 Termux 指南

Windows

原生 Windows 不受支持。请安装 WSL2 并从中运行 Hermes Agent。上述安装命令在 WSL2 内部运行。

安装程序做什么

安装程序自动处理一切——所有依赖(Python、Node.js、ripgrep、ffmpeg)、仓库克隆、虚拟环境、全局 hermes 命令设置以及 LLM 提供商配置。完成后,你就可以开始聊天了。

安装之后

重新加载你的 shell 并开始聊天:

source ~/.bashrc   # 或者:source ~/.zshrc
hermes # 开始聊天!

以后要重新配置单个设置,请使用专门的命令:

hermes model          # 选择你的 LLM 提供商和模型
hermes tools # 配置启用哪些工具
hermes gateway setup # 设置消息平台
hermes config set # 设置单个配置值
hermes setup # 或者运行完整的设置向导一次性配置一切

前置要求

唯一的前提条件是 Git。安装程序自动处理其他一切:

  • uv(快速的 Python 包管理器)
  • Python 3.11(通过 uv,无需 sudo)
  • Node.js v22(用于浏览器自动化和 WhatsApp 桥接)
  • ripgrep(快速文件搜索)
  • ffmpeg(TTS 的音频格式转换)
信息

不需要手动安装 Python、Node.js、ripgrep 或 ffmpeg。安装程序检测缺少的内容并为你安装。只要确保 git 可用(git --version)。

Nix 用户

如果你使用 Nix(在 NixOS、macOS 或 Linux 上),有一个专门的设置路径,包含 Nix flake、声明式 NixOS 模块和可选的容器模式。参阅 Nix 和 NixOS 设置 指南。


手动安装

如果你更喜欢完全控制安装过程,请按照这些步骤进行。

步骤 1:克隆仓库

使用 --recurse-submodules 克隆以拉取所需的子模块:

git clone --recurse-submodules https://github.com/NousResearch/hermes-agent.git
cd hermes-agent

如果你已经克隆但没有 --recurse-submodules

git submodule update --init --recursive

步骤 2:安装 uv 并创建虚拟环境

# 安装 uv(如果尚未安装)
curl -LsSf https://astral.sh/uv/install.sh | sh

# 使用 Python 3.11 创建 venv(uv 会下载它——无需 sudo)
uv venv venv --python 3.11
提示

不需要激活 venv 来使用 hermes。入口点有一个硬编码的 shebang 指向 venv Python,所以一旦符号链接,它就能全局工作。

步骤 3:安装 Python 依赖

# 告诉 uv 要安装到哪个 venv
export VIRTUAL_ENV="$(pwd)/venv"

# 安装所有额外组件
uv pip install -e ".[all]"

如果你只想要核心代理(无 Telegram/Discord/cron 支持):

uv pip install -e "."
可选额外组件详解
Extra内容安装命令
all以下所有uv pip install -e ".[all]"
messagingTelegram、Discord 和 Slack 网关uv pip install -e ".[messaging]"
cron定时任务的 Cron 表达式解析uv pip install -e ".[cron]"
cli设置向导的终端菜单 UIuv pip install -e ".[cli]"
modalModal 云执行后端uv pip install -e ".[modal]"
tts-premiumElevenLabs 高级语音uv pip install -e ".[tts-premium]"
voiceCLI 麦克风输入 + 音频播放uv pip install -e ".[voice]"
ptyPTY 终端支持uv pip install -e ".[pty]"
termux经过测试的 Android / Termux 捆绑包(croncliptymcphonchoacppython -m pip install -e ".[termux]" -c constraints-termux.txt
honchoAI 原生记忆(Honcho 集成)uv pip install -e ".[honcho]"
mcpModel Context Protocol 支持uv pip install -e ".[mcp]"
homeassistantHome Assistant 集成uv pip install -e ".[homeassistant]"
acpACP 编辑器集成支持uv pip install -e ".[acp]"
slackSlack 消息uv pip install -e ".[slack]"
devpytest 和测试工具uv pip install -e ".[dev]"

你可以组合额外组件:uv pip install -e ".[messaging,cron]"

Termux 用户

.[all] 目前在 Android 上不可用,因为 voice 额外组件拉取 faster-whisper,而后者依赖 ctranslate2 wheels,这些 wheels 未发布用于 Android。使用 .[termux] 作为经过测试的移动安装路径,然后根据需要添加单个额外组件。

步骤 4:安装可选子模块(如果需要)

# RL 训练后端(可选)
uv pip install -e "./tinker-atropos"

两者都是可选的——如果你跳过它们,相应的工具集只是不可用。

步骤 5:安装 Node.js 依赖(可选)

仅在需要浏览器自动化(Browserbase 驱动)和 WhatsApp 桥接时需要:

npm install

步骤 6:创建配置目录

# 创建目录结构
mkdir -p ~/.hermes/{cron,sessions,logs,memories,skills,pairing,hooks,image_cache,audio_cache,whatsapp/session}

# 复制示例配置文件
cp cli-config.yaml.example ~/.hermes/config.yaml

# 创建一个空的 .env 文件用于 API 密钥
touch ~/.hermes/.env

步骤 7:添加你的 API 密钥

打开 ~/.hermes/.env 并至少添加一个 LLM 提供商密钥:

# 必需——至少一个 LLM 提供商:
OPENROUTER_API_KEY=sk-or-v1-your-key-here

# 可选——启用其他工具:
FIRECRAWL_API_KEY=fc-your-key # 网络搜索和爬取(或自托管,参阅文档)
FAL_KEY=your-fal-key # 图像生成(FLUX)

或通过 CLI 设置:

hermes config set OPENROUTER_API_KEY sk-or-v1-your-key-here

步骤 8:将 hermes 添加到你的 PATH

mkdir -p ~/.local/bin
ln -sf "$(pwd)/venv/bin/hermes" ~/.local/bin/hermes

如果 ~/.local/bin 不在你的 PATH 上,将其添加到你的 shell 配置:

# Bash
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc

# Zsh
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc && source ~/.zshrc

# Fish
fish_add_path $HOME/.local/bin

步骤 9:配置你的提供商

hermes model       # 选择你的 LLM 提供商和模型

步骤 10:验证安装

hermes version    # 检查命令是否可用
hermes doctor # 运行诊断以验证一切正常
hermes status # 检查你的配置
hermes chat -q "Hello! What tools do you have available?"

快速参考:手动安装(精简版)

对于只想要命令的人:

# 安装 uv
curl -LsSf https://astral.sh/uv/install.sh | sh

# 克隆并进入
git clone --recurse-submodules https://github.com/NousResearch/hermes-agent.git
cd hermes-agent

# 使用 Python 3.11 创建 venv
uv venv venv --python 3.11
export VIRTUAL_ENV="$(pwd)/venv"

# 安装一切
uv pip install -e ".[all]"
uv pip install -e "./tinker-atropos"
npm install # 可选,用于浏览器工具和 WhatsApp

# 配置
mkdir -p ~/.hermes/{cron,sessions,logs,memories,skills,pairing,hooks,image_cache,audio_cache,whatsapp/session}
cp cli-config.yaml.example ~/.hermes/config.yaml
touch ~/.hermes/.env
echo 'OPENROUTER_API_KEY=sk-or-v1-your-key' >> ~/.hermes/.env

# 使 hermes 全局可用
mkdir -p ~/.local/bin
ln -sf "$(pwd)/venv/bin/hermes" ~/.local/bin/hermes

# 验证
hermes doctor
hermes

故障排除

问题解决方案
hermes: command not found重新加载你的 shell(source ~/.bashrc)或检查 PATH
API key not set运行 hermes model 配置你的提供商,或 hermes config set OPENROUTER_API_KEY your_key
更新后配置丢失运行 hermes config check 然后 hermes config migrate

要获取更多诊断信息,运行 hermes doctor——它会准确告诉你缺少什么以及如何修复。