返回命令列表
配置管理hermes config

hermes config 命令 — 完整参考与示例

hermes config 完整参考:显示、编辑、获取、设置、取消设置、检查路径、验证和迁移 ~/.hermes/config.yaml。

2026年7月27日

概述

hermes config 管理主配置文件 ~/.hermes/config.yaml。该文件控制 Hermes Agent 的每个行为方面 — 模型、提供商、工具、终端后端、压缩、审批等。

hermes config <show|edit|get|set|unset|path|env-path|check|migrate>

重要:API 密钥和其他机密存储在 ~/.hermes/.env 中,而不是 config.yaml 中。

子命令

show — 显示当前配置

hermes config show

打印解析后的 ~/.hermes/config.yaml

edit — 在编辑器中打开配置文件

hermes config edit

$EDITOR 中打开 ~/.hermes/config.yaml

get — 打印解析后的配置值

hermes config get model
hermes config get terminal.backend
hermes config get approvals.mode --json
选项 说明
key(位置参数) 配置键,嵌套值使用点号表示法。
--json 以 JSON 格式输出值。

set — 设置配置值

hermes config set terminal.backend docker
hermes config set model claude-sonnet-4-20250514
hermes config set approvals.deny "rm -rf *,curl *" --force
选项 说明
key(位置参数) 配置键,例如 modelterminal.backend
value(位置参数) 要设置的值。
--force 跳过未知键提示(值仍会保存)。

unset — 移除配置值

hermes config unset display.interface

config.yaml 中删除指定键。

path — 打印配置文件路径

hermes config path

输出 ~/.hermes/config.yaml 的完整路径。

env-path — 打印 .env 文件路径

hermes config env-path

输出机密 .env 文件的完整路径。

check — 检查缺失/过时的配置

hermes config check

验证配置并报告缺失或过时的选项。

migrate — 使用新选项更新配置

hermes config migrate

重写配置以添加新的默认选项并更新废弃键。

常见场景

读取默认模型

hermes config get model

更改终端后端

hermes config set terminal.backend docker

移除某个设置

hermes config unset display.interface

手动编辑后验证

hermes config edit
hermes config check

为新版本 Hermes 更新配置

hermes config migrate

查看配置和机密文件位置

hermes config path
hermes config env-path

技巧

  • 嵌套键使用点号表示法:terminal.backendapprovals.modeauxiliary.approval.model
  • hermes config set 立即写入且幂等。
  • 手动编辑后运行 hermes config check 可捕获拼写错误和模式漂移。
  • 升级前运行 hermes config migrate 是安全的;如果配置在版本控制下,请检查 diff。
  • 对于 CI/无头环境,优先使用 hermes config set,而非交互式编辑器。

Explore All Commands

Browse the full command reference with search and category filters.

返回命令列表