概述
hermes 是 Hermes Agent 的主要入口。不指定任何子命令直接运行,会在你配置的界面(TUI 或经典 REPL)中启动交互式聊天会话——等同于 hermes chat。CLI 还提供了数十个子命令,用于配置、集成、技能、会话和维护。
hermes [选项] [命令]
全局选项
| 选项 | 说明 |
|---|---|
-h, --help |
显示帮助信息并退出。 |
--version, -V |
显示版本信息并退出。 |
-z PROMPT, --oneshot PROMPT |
单次问答模式:发送一个提示词,仅将最终回复打印到 stdout。无横幅、无加载动画、无 session ID 行——适合脚本和管道。 |
--usage-file PATH |
仅限单次问答模式:运行结束后将 JSON 用量报告(成本、token 数、模型、api_calls)写入 PATH。 |
-m MODEL, --model MODEL |
本次调用的模型覆盖(例如 anthropic/claude-sonnet-4.6)。适用于 --oneshot 和 --tui。 |
--provider PROVIDER |
本次调用的提供商覆盖(例如 openrouter、anthropic)。适用于 --oneshot 和 --tui。 |
--reasoning LEVEL |
本次调用的推理强度:none、minimal、low、medium、high、xhigh、max 或 ultra。 |
-t TOOLSETS, --toolsets TOOLSETS |
本次调用启用的工具集,逗号分隔。 |
--resume SESSION, -r SESSION |
按 ID 或标题恢复之前的会话。 |
--no-restore-cwd |
不进入被恢复会话记录的 working directory。 |
--continue [SESSION_NAME], -c [SESSION_NAME] |
按名称恢复会话;未指定名称时恢复最近的一次。 |
--worktree, -w |
在隔离的 git worktree 中运行(用于并行 agent)。 |
--accept-hooks |
自动批准 config.yaml 中未见过的新 shell hooks,无需 TTY 提示(适合 CI 和无头运行)。 |
--skills SKILLS, -s SKILLS |
为会话预加载一个或多个技能(可重复使用该标志或用逗号分隔)。 |
--yolo |
绕过所有危险命令的批准提示(风险自负)。 |
--pass-session-id |
将会话 ID 注入 agent 的 system prompt。 |
--ignore-user-config |
忽略 ~/.hermes/config.yaml,回退到内置默认值(.env 中的凭据仍会加载)。 |
--ignore-rules |
跳过 AGENTS.md、SOUL.md、.cursorrules、记忆和预加载技能的自动注入。 |
--safe-mode |
故障排查模式:禁用所有自定义项——用户配置、记忆注入、插件和 MCP 服务器(隐含 --ignore-user-config 和 --ignore-rules)。 |
--tui |
启动现代 TUI 而非经典 REPL。 |
--cli |
强制使用经典 prompt_toolkit REPL(覆盖 display.interface=tui)。 |
--dev |
配合 --tui:通过 tsx 运行 TypeScript 源码(跳过 dist 构建)。 |
--profile PROFILE, -p PROFILE |
在指定名称的 Hermes profile 下运行(设置 HERMES_HOME)。在参数解析之前被消费,因此适用于所有子命令。 |
子命令
hermes 自带六十多个子命令。主要分组如下:
| 分组 | 子命令 |
|---|---|
| 聊天与模型 | chat、model、moa、fallback、acp |
| 集成与消息 | gateway、whatsapp、whatsapp-cloud、slack、send、webhook、portal、proxy、mcp、lsp、computer-use |
| 配置与访问 | setup、config、profile、project、secrets、egress、skin、console、pairing、approvals、auth、login、logout |
| 会话、记忆与分析 | sessions、memory、journey(learning + memory-graph 的别名)、checkpoints、insights、prompt-size、logs |
| 技能与扩展 | skills、bundles、plugins、curator、pets、sync |
| 管理与维护 | status、doctor、security、cron、hooks、backup、import、import-agent、migrate、dump、debug、monitoring、version、update、uninstall、completion、dashboard、serve、desktop(别名 gui)、claw、kanban、tools |
运行 hermes <命令> --help 查看任意子命令的详细信息。
示例
hermes # 启动交互式聊天
hermes chat -q "Hello" # 单次查询模式
hermes -z "Summarize this repo" # 单次问答模式:只输出回复
hermes --tui # 启动现代 TUI
hermes --cli # 强制使用经典 REPL
hermes -c # 恢复最近一次会话
hermes -c "my project" # 按名称恢复会话
hermes --resume <session_id> # 按 ID 恢复指定会话
hermes -m anthropic/claude-sonnet-4.6 --reasoning high # 覆盖模型与推理强度
hermes -t web -s hermes-agent-dev,github-auth # 工具集 + 预加载技能
hermes --profile work # 在 'work' profile 下运行
hermes setup # 运行设置向导
hermes model # 选择默认模型
hermes config edit # 在 $EDITOR 中编辑配置
hermes gateway install # 安装 gateway 后台服务
hermes sessions list # 列出历史会话
hermes logs -f # 实时跟踪 agent.log
hermes dashboard # 启动 Web 仪表盘(端口 9119)
hermes update # 更新到最新版本
提示
- 不带参数的
hermes会启动交互式聊天——等同于hermes chat。 - 使用
--tui进入全屏界面,或在 config.yaml 中设置display.interface: tui将其设为默认。 -c/--continue恢复最近一次会话;-r/--resume定位到指定 session ID。-z/--oneshot专为脚本和管道设计;可搭配--usage-file跟踪成本。--safe-mode禁用所有自定义项——遇到问题时首先尝试它。--yolo会跳过所有批准提示;仅在可信、隔离的环境中使用。--profile/-p在参数解析之前被处理,因此可与任何子命令搭配使用。