Skip to main content

安装

使用一键安装程序,两分钟内即可让 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)构建
  • 安装精选的 .[termux] 扩展包,包含 pip
  • 默认跳过未经测试的浏览器 / WhatsApp 启动流程

如需完整显式路径,请参考专用的 Termux 指南

Windows

原生 Windows 不支持。请安装 WSL2,并在其中运行 Hermes Agent。上述安装命令可在 WSL2 内正常工作。

安装程序做了什么

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

安装后操作

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

source ~/.bashrc   # or: source ~/.zshrc
hermes # Start chatting!

若日后需要重新配置个别设置,可使用专用命令:

hermes model          # Choose your LLM provider and model
hermes tools # Configure which tools are enabled
hermes gateway setup # Set up messaging platforms
hermes config set # Set individual config values
hermes setup # Or run the full setup wizard to configure everything at once

先决条件

唯一必需的是 Git。安装程序会自动处理其余一切:

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

无需手动安装 Python、Node.js、ripgrep 或 ffmpeg。安装程序会自动检测缺失项并为你安装。只需确保 git 可用(git --version)。

Nix 用户

如果你使用 Nix(在 NixOS、macOS 或 Linux 上),有专门的设置路径,包括 Nix flake、声明式 NixOS 模块以及可选容器模式。详见 Nix & NixOS 设置 指南。


手动安装

如果你希望对安装过程拥有完全控制,请按以下步骤操作。

第一步:克隆仓库

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

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

如果你已克隆但未使用 --recurse-submodules

git submodule update --init --recursive

第二步:安装 uv 并创建虚拟环境

# Install uv (if not already installed)
curl -LsSf https://astral.sh/uv/install.sh | sh

# Create venv with Python 3.11 (uv downloads it if not present — no sudo needed)
uv venv venv --python 3.11
tip

无需激活虚拟环境即可使用 hermes。入口点已硬编码指向虚拟环境中的 Python,一旦创建符号链接,即可全局使用。

第三步:安装 Python 依赖

# Tell uv which venv to install into
export VIRTUAL_ENV="$(pwd)/venv"

# Install with all extras
uv pip install -e ".[all]"

如果仅需核心代理(无 Telegram/Discord/cron 支持):

uv pip install -e "."
可选扩展说明
扩展添加内容安装命令
all下列全部功能uv pip install -e ".[all]"
messagingTelegram 与 Discord 网关uv pip install -e ".[messaging]"
cron支持定时任务的 cron 表达式解析uv pip install -e ".[cron]"
cli终端菜单 UI 用于设置向导uv 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]"
mcp模型上下文协议(MCP)支持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 轮子尚未发布 Android 版本。请使用 .[termux] 的经测试移动端安装路径,再根据需要逐个添加扩展。

第四步:安装可选子模块(如需)

# RL training backend (optional)
uv pip install -e "./tinker-atropos"

两者均为可选——若跳过,则对应工具集将不可用。

第五步:安装 Node.js 依赖(可选)

仅在需要 浏览器自动化(Browserbase 驱动)或 WhatsApp 桥接 时才需安装:

npm install

第六步:创建配置目录

# Create the directory structure
mkdir -p ~/.hermes/{cron,sessions,logs,memories,skills,pairing,hooks,image_cache,audio_cache,whatsapp/session}

# Copy the example config file
cp cli-config.yaml.example ~/.hermes/config.yaml

# Create an empty .env file for API keys
touch ~/.hermes/.env

第七步:添加你的 API 密钥

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

# Required — at least one LLM provider:
OPENROUTER_API_KEY=sk-or-v1-your-key-here

# Optional — enable additional tools:
FIRECRAWL_API_KEY=fc-your-key # Web search & scraping (or self-host, see docs)
FAL_KEY=your-fal-key # Image generation (FLUX)

或通过 CLI 设置:

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

第八步:将 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

第九步:配置你的提供方

hermes model       # Select your LLM provider and model

第十步:验证安装

hermes version    # Check that the command is available
hermes doctor # Run diagnostics to verify everything is working
hermes status # Check your configuration
hermes chat -q "Hello! What tools do you have available?"

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

适合只想获取命令的人:

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

# Clone & enter
git clone --recurse-submodules https://github.com/NousResearch/hermes-agent.git
cd hermes-agent

# Create venv with Python 3.11
uv venv venv --python 3.11
export VIRTUAL_ENV="$(pwd)/venv"

# Install everything
uv pip install -e ".[all]"
uv pip install -e "./tinker-atropos"
npm install # optional, for browser tools and WhatsApp

# Configure
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

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

# Verify
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 —— 它会明确告诉你缺少什么以及如何修复。