安装升级
git config --global core.autocrlf false
iex "& { $(irm https://hermes-agent.nousresearch.com/install.ps1) } -Tag v2026.7.7.2"
git config --global core.autocrlf true
# 完全重装:Remove-Item -Recurse -Force $env:LOCALAPPDATA\hermes
-Tag v2026.7.7.2 • 作用: 指定 release 版本,支持无损升级, 会重建venv python略慢,不如hermes update快
-Branch main • 作用: 指定分支(Tag 更高优先级,不设 Tag 时生效)
-Commit abc123 • 作用: 指定 commit SHA(优先级最高)
-HermesHome D:\hermes • 作用: 数据目录(默认 %LOCALAPPDATA%\hermes)
-InstallDir D:\hermes\hermes-agent • 作用: 源码目录(默认 $HermesHome\hermes-agent)
-NonInteractive • 作用: 跳过所有交互提示
-SkipSetup • 作用: 跳过 setup 配置向导
-NoVenv • 作用: 不创建 venv(已有系统 Python 时用)
-IncludeDesktop • 作用: 同时构建桌面版 Hermes.exe程序管理
启动 / 运行参数(仅本次生效,不写配置文件)
| 命令 | 说明 |
|---|---|
hermes | 启动交互式 CLI 对话 |
hermes dashboard --tui | 启动 CLI + Dashboard Web + TUI 三合一 |
hermes -m gpt-4o --provider openai | 临时指定模型+提供商(不写 config.yaml) |
hermes --yolo | 跳过危险命令确认(本次有效) |
hermes -p name | 使用指定 profile 启动,默认 default |
$env:HERMES_DASHBOARD=1; hermes | 临时开 Dashboard(仅本次 cmd 窗口) |
$env:HERMES_TUI=1; hermes | 临时开 TUI(仅本次 cmd 窗口) |
$env:HERMES_HOME="D:\hermes"; hermes | 临时指定数据目录 |
Gateway(后台消息服务)
| 命令 | 说明 |
|---|---|
hermes gateway run | 前台运行 gateway(调试用) |
hermes gateway start | 后台启动 gateway |
hermes gateway stop | 停止 gateway |
hermes gateway restart | 重启 gateway |
hermes gateway status | 查看 gateway 运行状态 |
hermes gateway install | 安装为 Windows 计划任务(开机自启) |
- gateway随机启动后,需要在.env加入一些变量开关才能自带dashboard等
其他操作
| 命令 | 说明 |
|---|---|
hermes update | 升级新版,不会重建venv |
hermes doctor | 检查依赖和配置健康 |
hermes uninstall | 卸载 |
.env 文件
位置:$HermesHome\.env(hermes config env-path 查看)。格式 KEY=value,编辑或命令改动后必须重启 gateway 才生效。
① 直接编写:可以手动写入的 KEY
| 变量名 | 说明 |
|---|---|
HTTP_PROXY=http://127.0.0.1:7890 | Hermes 内部网络代理(LLM API / MCP / update 走这个) |
HTTPS_PROXY=http://127.0.0.1:7890 | 同上 |
HERMES_DASHBOARD=1 | 全局开启 Dashboard Web |
HERMES_TUI=1 | 全局开启 TUI 模式 |
HERMES_DASHBOARD_PORT=9119 | Dashboard 端口 |
HERMES_DASHBOARD_INSECURE=1 | 信任上游 nginx 反代,跳过自身门禁 |
HERMES_YOLO_MODE=1 | 全局跳过危险命令确认 |
OPENROUTER_API_KEY | OpenRouter API Key |
ANTHROPIC_API_KEY | Anthropic API Key |
OPENAI_API_KEY | OpenAI API Key |
DEEPSEEK_API_KEY | DeepSeek API Key |
OPENCODE_GO_API_KEY | OpenCode Go API Key |
TELEGRAM_BOT_TOKEN | Telegram Bot Token |
DISCORD_BOT_TOKEN | Discord Bot Token |
② 命令改动:以下命令会写 .env
| 命令 | 写什么 |
|---|---|
hermes setup | 配置向导,按你的填写写入 API Key 等 |
hermes auth add | 交互式填入某个 provider 的 API key |
hermes login --provider nous | OAuth 登录成功后将 token 写入 .env |
config.yaml 配置
位置:hermes config path 查看。核心 YAML 结构如下。编辑或命令改动后必须重启 gateway 或重开 CLI 才生效。
① 直接编写:关键配置块说明
# ── 模型 / 提供商 ──
model:
default: deepseek-v4-flash # 默认模型
provider: opencode-go # 默认提供商
# ── 代理行为 ──
agent:
disabled_toolsets: [browser] # 禁用的工具集(web / browser / 等)
max_turns: 90 # 单轮最多工具调次数
gateway_timeout: 1800 # gateway 超时
# ── 权限审批 ──
approvals:
mode: smart # manual / smart / off
cron_mode: allow
# ── MCP 服务器 ──
mcp_servers:
trilium:
command: node
args: [mcp-server.js]
url: "" # 二选一:command 或 url
# ── 代理(HTTP/S 出站) ──
proxy: http://127.0.0.1:7890 # Hermes 自身 LLM API / MCP 调用的代理
# ── Session 自动重置 ──
session_reset:
mode: none # none / idle / scheduled / both
idle_minutes: 0
at_hour: 4② 命令改动:以下命令会改 config.yaml
| 命令 | 改什么 |
|---|---|
hermes config set section.key value | 改单个配置项,如 hermes config set model.default gpt-4o |
hermes config edit | 用编辑器打开 config.yaml,你想改什么改什么 |
hermes model | 交互式选 provider + model,改 model.default / model.provider |
hermes tools | 交互式开关工具集,改 agent.disabled_toolsets |
hermes setup | 完整配置向导,可以改写多项配置 |
hermes mcp add | 添加 MCP 服务器,改 mcp_servers |
hermes mcp remove | 移除 MCP 服务器 |
hermes config migrate | 将旧版配置更新为最新结构 |
hermes profile create | 新建 profile 时复制当前 config.yaml 到新目录 |
查看类命令(不改文件)
| 命令 | 说明 |
|---|---|
hermes config | 查看当前完整配置 |
hermes config path | 打印 config.yaml 路径 |
hermes config env-path | 打印 .env 路径 |
hermes config check | 检查缺失/过期项 |
Skills & MCP 管理
| 命令 | 说明 |
|---|---|
hermes skills list | 查看已安装 skill |
hermes skills search QUERY | 搜索 skill 中心 |
hermes skills install ID | 安装 skill |
hermes skills browse | 浏览所有可用 skill |
hermes skills config | 按平台启用/禁用 skill |
hermes mcp list | 列出已配置的 MCP 服务器 |
hermes mcp add NAME --url URL | 添加 MCP 服务器 |
hermes mcp test NAME | 测试 MCP 连接 |
Session 管理
| 命令 | 说明 |
|---|---|
hermes sessions list | 列出最近 session |
hermes sessions browse | 交互式选择 session |
hermes sessions rename ID 新名称 | 重命名 session |
hermes sessions delete ID | 删除 session |
hermes sessions export 文件名.jsonl | 导出 session |
hermes sessions prune --older-than 30 | 清理 30 天前的 session |
Profile 管理
| 命令 | 说明 |
|---|---|
hermes profile list | 列出所有 profile,默认工作在 default |
hermes profile create NAME | 创建 profile(默认=当前最小配置,--clone=+记忆,--clone-all=全量,--clone-from=来源) |
hermes profile use NAME | 设为默认 profile(后续不加 -p 也自动使用) |
hermes profile rename A B | 重命名 |
hermes profile alias NAME | 管理 wrapper 快捷脚本 |
hermes profile delete NAME | 删除 |
hermes profile show NAME | 查看详情 |
hermes profile export NAME | 导出为 tar.gz(搬家用)-o ~/.hermes/default |
hermes profile import 文件.tar.gz | 导入 profile |