乐于分享
好东西不私藏

macOS系统下安装与配置Hermes Agent的教程

macOS系统下安装与配置Hermes Agent的教程

Hermes Agent 完美适配 macOS 系统,但在实际安装、环境配置与接入 AI 模型的过程中,容易出现环境变量失效、命令找不到、API 配置异常等各类问题。本文专为 macOS 用户打造专属安装配置全流程指南,以 MiniMax 模型为例,从系统要求、一键安装、API 配置到国内加速、常见排错逐一讲解,零基础也能轻松部署。

一、安装 Hermes Agent

1.1 系统要求

  • macOS 10.x 或更高;
  • Python 3.11+;
  • Homebrew(可选)。

1.2 一键安装

打开终端,运行:

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

安装脚本自动处理:

  • Python 环境检查;
  • Node.js(TUI 界面依赖);
  • ripgrep(代码搜索);
  • ffmpeg(媒体处理);
  • Git 仓库 clone;
  • 虚拟环境配置;
  • hermes
     命令全局注册。

1.3 重新加载 Shell

source ~/.zshrc   # macOS 默认使用 zsh

建议重启终端窗口,确保环境变量生效。

1.4 验证安装

hermes --version
或直接启动:
hermes

看到欢迎界面即为成功。

二、配置 MiniMax API

2.1 MiniMax 提供商说明

Hermes Agent 支持多个 AI 提供商,MiniMax 有两个端点:

端点
Provider 名
API Key 环境变量
api.minimax.iominimaxMINIMAX_API_KEY
api.minimaxi.comminimax-cnMINIMAX_CN_API_KEY

国内 Coding Plan 用户,应选择 minimax-cn

2.2 获取 API Key

  1. 登录 MiniMax 控制台;
  2. 进入「API Key」页面;
  3. 复制已有 Key 或创建新 Key。

2.3 配置方式

方式一:交互式配置(推荐新手)

hermes setup

向导引导完成:

  • 选择推理提供商;
  • 输入 API Key;
  • 配置基础选项。

方式二:命令行配置

# 设置 MiniMax CN API Keyhermes config set MINIMAX_CN_API_KEY sk-xxxxxxxxxxxxxxxxxxxxxxxx# 设置使用 minimax-cn 提供商hermes config set provider minimax-cn# 设置默认模型(可选)hermes config set model MiniMax-M2.7
方式三:环境变量
# 编辑 ~/.zshrcvim ~/.zshrc# 添加以下内容export MINIMAX_CN_API_KEY="sk-xxxxxxxxxxxxxxxxxxxxxxxx"export HERMES_PROVIDER="minimax-cn"export HERMES_MODEL="MiniMax-M2.7"# 重新加载source ~/.zshrc

2.4 验证配置

# 查看当前配置hermes config get# 查看可用模型hermes model list# 诊断问题hermes doctor

三、TUI 界面安装(可选)

TUI 模式需要 Node.js。

3.1 安装 Node.js

# 使用 Homebrewbrew install node# 或使用 nvmbrew install nvmnvm install --lts

3.2 安装依赖

cd hermes-agent/ui-tuinpm install

3.3 启动 TUI

hermes --tui
或指定模型:
hermes --tui --model minimax-cn/MiniMax-M2.7

四、国内加速(可选)

如果 GitHub 访问较慢,使用镜像:

4.1 修改安装脚本

# 使用 Gitee 镜像curl -fsSL https://gitee.com/nousresearch/hermes-agent/raw/main/scripts/install.sh | bash

4.2 手动安装

# 1. 克隆仓库git clone https://github.com/NousResearch/hermes-agent.git# 2. 进入目录cd hermes-agent# 3. 安装依赖pip install -e .# 4. 创建符号链接ln -s /path/to/hermes-agent/hermes_cli/main.py /usr/local/bin/hermes

五、常见问题

5.1 安装失败,curl 报错

# 检查网络curl --version# 使用代理export https_proxy=http://127.0.0.1:7890curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash

5.2 command not found: hermes

# 重新加载 shellsource ~/.zshrc# 检查安装ls ~/.hermes/# 手动添加路径echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.zshrcsource ~/.zshrc

5.3 MINIMAX_API_KEY 设置了但仍然报错

# 确认使用的是 MINIMAX_CN_API_KEY(国内版)hermes config get | grep MINIMAX# 检查 Key 是否有效hermes doctor

5.4 Model not found

# 查看支持的模型hermes model list# 使用确切的模型名称hermes config set model MiniMax-M2.7

六、快速参考

# 安装curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash# 重启终端后配置 MiniMaxhermes config set MINIMAX_CN_API_KEY your_keyhermes config set provider minimax-cnhermes config set model MiniMax-M2.7# 启动hermes# 诊断hermes doctor

总结

步骤
命令
安装
curl ... | bash
配置 Key
hermes config set MINIMAX_CN_API_KEY xxx
设置 Provider
hermes config set provider minimax-cn
启动
hermes
诊断
hermes doctor

本文完整覆盖了 macOS 下 Hermes Agent 从环境准备、一键安装、MiniMax 模型配置,到 TUI 界面部署、国内镜像加速及常见故障排查的全部流程。只需按照步骤执行安装命令、配置接口密钥并校验环境,就能快速完成部署。遇到异常可对照常见问题逐一排查,轻松实现 Hermes Agent 在 macOS 上稳定运行。