跳到主要内容

安装

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

快速安装

Linux / macOS / WSL2

curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
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 "."
可选额外功能细分
额外功能添加的内容安装命令
all以下所有内容uv pip install -e ".[all]"
messagingTelegram 和 Discord 网关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]"
honchoAI 原生记忆(Honcho 集成)uv pip install -e ".[honcho]"
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]"

步骤 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

# 为 API 密钥创建一个空的 .env 文件
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 —— 它会准确告诉您缺少什么以及如何修复。