macOS系统下安装与配置Hermes Agent的完整指南(收藏这一篇就够了)
大鹏AI教育
引言
Hermes Agent 支持 macOS,但安装过程有几个点需要注意。本文是 macOS 专属安装指南,覆盖从零配置到运行的全流程,以 MiniMax 为例演示 AI 提供商配置。
1. 安装 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
看到欢迎界面即为成功。
2. 配置 MiniMax API
2.1 MiniMax 提供商说明
Hermes Agent 支持多个 AI 提供商,MiniMax 有两个端点:
| 端点 | Provider 名 | API Key 环境变量 |
|---|---|---|
api.minimax.io | minimax | MINIMAX_API_KEY |
api.minimaxi.com | minimax-cn | MINIMAX_CN_API_KEY |
国内 Coding Plan 用户,应选择 minimax-cn。
2.2 获取 API Key
- 登录 MiniMax 控制台
- 进入「API Key」页面
- 复制已有 Key 或创建新 Key
2.3 配置方式
方式一:交互式配置(推荐新手)
hermes setup
向导引导完成:
- 选择推理提供商
- 输入 API Key
- 配置基础选项
方式二:命令行配置
# 设置 MiniMax CN API Key hermes config set MINIMAX_CN_API_KEY sk-xxxxxxxxxxxxxxxxxxxxxxxx # 设置使用 minimax-cn 提供商 hermes config set provider minimax-cn # 设置默认模型(可选) hermes config set model MiniMax-M2.7
方式三:环境变量
# 编辑 ~/.zshrc vim ~/.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
3. TUI 界面安装(可选)
TUI 模式需要 Node.js。
3.1 安装 Node.js
# 使用 Homebrew brew install node # 或使用 nvm brew install nvm nvm install --lts
3.2 安装依赖
cd hermes-agent/ui-tui npm install
3.3 启动 TUI
hermes --tui
或指定模型:
hermes --tui --model minimax-cn/MiniMax-M2.7
4. 国内加速(可选)
如果 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. 常见问题
Q1:安装失败,curl 报错
# 检查网络 curl --version # 使用代理 export https_proxy=http://127.0.0.1:7890 curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
Q2:command not found: hermes
# 重新加载 shell source ~/.zshrc # 检查安装 ls ~/.hermes/ # 手动添加路径 echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.zshrc source ~/.zshrc
Q3:MINIMAX_API_KEY 设置了但仍然报错
# 确认使用的是 MINIMAX_CN_API_KEY(国内版) hermes config get | grep MINIMAX # 检查 Key 是否有效 hermes doctor
Q4:Model not found
# 查看支持的模型 hermes model list # 使用确切的模型名称 hermes config set model MiniMax-M2.7
6. 快速参考
# 安装 curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash # 重启终端后配置 MiniMax hermes config set MINIMAX_CN_API_KEY your_key hermes config set provider minimax-cn hermes 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的完整指南(收藏这一篇就够了)的详细内容,更多关于Hermes Agent安装与配置的资料请关注脚本之家其它相关文章!
