CLI 命令参考
本页介绍的是你在 shell 中直接运行的终端命令。
会话内 slash command 请参见 Slash Commands Reference。
全局入口
hermes [global-options] <command> [subcommand/options]
全局选项
| Option | Description |
|---|---|
--version, -V | 显示版本并退出 |
--profile <name>, -p <name> | 选择本次调用使用的 Hermes profile,会覆盖 hermes profile use 设定的默认 profile |
--resume <session>, -r <session> | 按 ID 或标题恢复历史会话 |
--continue [name], -c [name] | 恢复最近一次会话,或恢复最近一次匹配指定标题的会话 |
--worktree, -w | 在隔离的 git worktree 中启动,适合并行 agent 工作流 |
--yolo | 跳过危险命令审批提示 |
--pass-session-id | 把 session ID 注入 agent 的 system prompt |
--ignore-user-config | 忽略 ~/.hermes/config.yaml,仅使用内置默认值;.env 中凭证仍会加载 |
--ignore-rules | 跳过自动注入 AGENTS.md、SOUL.md、.cursorrules、记忆和预加载技能 |
--tui | 启动 TUI,而不是经典 CLI;等价于 HERMES_TUI=1 |
--dev | 与 --tui 一起使用时,直接通过 tsx 运行 TypeScript 源码 |
顶层命令
| Command | Purpose |
|---|---|
hermes chat | 与 agent 进行交互式或一次性聊天 |
hermes model | 交互式选择默认 provider 和模型 |
hermes gateway | 运行或管理消息网关服务 |
hermes setup | 全量或局部配置的交互式安装向导 |
hermes whatsapp | 配置并配对 WhatsApp bridge |
hermes auth | 管理凭证,支持添加、列出、删除、重置和策略设置 |
hermes login / logout | 已废弃,请改用 hermes auth |
hermes status | 显示 agent、认证与平台状态 |
hermes cron | 检查并驱动 cron 调度器 |
hermes webhook | 管理事件驱动激活用的动态 webhook 订阅 |
hermes doctor | 诊断配置和依赖问题 |
hermes dump | 输出便于复制粘贴的环境摘要,用于支持/排障 |
hermes debug | 调试工具,包括上传日志和系统信息 |
hermes backup | 将 Hermes home 目录备份为 zip |
hermes import | 从 zip 恢复 Hermes 备份 |
hermes logs | 查看、跟随和过滤日志文件 |
hermes config | 显示、编辑、迁移和查询配置文件 |
hermes pairing | 批准或撤销消息平台 pairing code |
hermes skills | 浏览、安装、发布、审计和配置技能 |
hermes honcho | 管理 Honcho 跨会话记忆集成 |
hermes memory | 配置外部 memory provider |
hermes acp | 以 ACP server 方式运行 Hermes,用于编辑器集成 |
hermes mcp | 管理 MCP server 配置,并以 MCP server 方式运行 Hermes |
hermes plugins | 管理 Hermes Agent 插件 |
hermes tools | 按平台配置启用工具 |
hermes sessions | 浏览、导出、清理、重命名和删除会话 |
hermes insights | 显示 token/成本/活动分析 |
hermes claw | OpenClaw 迁移辅助命令 |
hermes dashboard | 启动用于配置、API key 和会话管理的 Web 仪表盘 |
hermes profile | 管理 profile,即多个隔离的 Hermes 实例 |
hermes completion | 输出 shell 补全脚本(bash/zsh) |
hermes version | 显示版本信息 |
hermes update | 拉取最新代码并重装依赖 |
hermes uninstall | 从系统中移除 Hermes |
hermes chat
hermes chat [options]
常用选项:
| Option | Description |
|---|---|
-q, --query "..." | 一次性、非交互式 prompt |
-m, --model <model> | 本次运行临时覆盖模型 |
-t, --toolsets <csv> | 启用逗号分隔的 toolset 集合 |
--provider <provider> | 强制指定 provider |
-s, --skills <name> | 为会话预加载一个或多个技能 |
-v, --verbose | 详细输出 |
-Q, --quiet | 程序化模式,隐藏 banner/spinner/工具预览 |
--image <path> | 给一次性查询附加本地图片 |
--resume <session> / --continue [name] | 直接从 chat 恢复会话 |
--worktree | 为本次运行创建隔离 git worktree |
--checkpoints | 在破坏性文件变更前启用文件系统 checkpoint |
--yolo | 跳过审批提示 |
--pass-session-id | 把 session ID 传入 system prompt |
--ignore-user-config | 忽略 ~/.hermes/config.yaml,仅用内置默认值 |
--ignore-rules | 跳过自动注入规则、记忆和预加载技能 |
--source <tag> | 会话来源标签,默认 cli |
--max-turns <N> | 每轮对话最大工具调用迭代次数 |
示例:
hermes
hermes chat -q "Summarize the latest PRs"
hermes chat --provider openrouter --model anthropic/claude-sonnet-4.6
hermes chat --toolsets web,terminal,skills
hermes chat --quiet -q "Return only JSON"
hermes chat --worktree -q "Review this repo and open a PR"
hermes chat --ignore-user-config --ignore-rules -q "Repro without my personal setup"
hermes model
交互式 provider + model 选择器。这是新增 provider、设置 API key、执行 OAuth 流程的标准命令。 它必须在终端中运行,而不是在已进入的 Hermes 聊天会话里执行。
hermes model
适用场景:
- 新增 provider(OpenRouter、Anthropic、Copilot、DeepSeek、自定义端点等)
- 登录 OAuth 类型 provider
- 输入或更新 API key
- 从 provider 模型列表中选择模型
- 配置自定义/自托管端点
- 将新的默认值保存到配置中
hermes model 与 /model 的区别hermes model(终端命令)是完整的大模型提供商(provider)安装向导,可以新增 provider、执行 OAuth、录入 API key 和配置端点。
/model(会话内 slash command)只能在已经配置过的 provider 与模型之间切换,不能新增 provider,也不能执行 OAuth 或提示录入 API key。
/model slash command(会话中)
/model
/model claude-sonnet-4
/model zai:glm-5
/model custom:qwen-2.5
/model custom
/model custom:local:qwen-2.5
/model openrouter:anthropic/claude-sonnet-4
默认情况下,/model 的变更只作用于当前会话。加上 --global 会持久化到 config.yaml:
/model claude-sonnet-4 --global
切换 provider 或 base URL 时,Hermes 会自动更新 config.yaml;当你离开 custom endpoint 时,旧 base URL 也会被清理,避免污染其他 provider。
hermes gateway
hermes gateway <subcommand>
| Subcommand | Description |
|---|---|
run | 在前台运行网关。推荐用于 WSL、Docker 和 Termux |
start | 启动已安装的 systemd/launchd 后台服务 |
stop | 停止服务(或前台进程) |
restart | 重启服务 |
status | 显示服务状态 |
install | 安装为 systemd(Linux)或 launchd(macOS)后台服务 |
uninstall | 移除已安装的服务 |
setup | 交互式消息平台配置向导 |
WSL 下更推荐 hermes gateway run,而不是 hermes gateway start。如需常驻,建议用 tmux new -s hermes 'hermes gateway run'。
hermes setup
hermes setup [model|tts|terminal|gateway|tools|agent] [--non-interactive] [--reset]
| Section | Description |
|---|---|
model | provider 与模型设置 |
terminal | 终端后端与沙箱设置 |
gateway | 消息平台设置 |
tools | 按平台启用/禁用工具 |
agent | agent 行为设置 |
| Option | Description |
|---|---|
--non-interactive | 使用默认值/环境值,不进行提示 |
--reset | 在 setup 前先重置为默认配置 |
hermes whatsapp
hermes whatsapp
运行 WhatsApp 配对/设置流程,包括模式选择和二维码配对。
hermes login / hermes logout (已废弃)
hermes login 已移除。请使用 hermes auth 管理 OAuth 凭证,用 hermes model 选择 provider,或用 hermes setup 进行完整交互式配置。
hermes auth
管理同 provider 多 key 轮换的凭证池。
hermes auth
hermes auth list
hermes auth list openrouter
hermes auth add openrouter --api-key sk-or-v1-xxx
hermes auth add anthropic --type oauth
hermes auth remove openrouter 2
hermes auth reset openrouter
子命令:add、list、remove、reset。不带子命令时进入交互式管理向导。
hermes status
hermes status [--all] [--deep]
| Option | Description |
|---|---|
--all | 以便于分享的脱敏格式显示全部细节 |
--deep | 运行更深入、耗时更长的检查 |
hermes cron
hermes cron <list|create|edit|pause|resume|run|remove|status|tick>
| Subcommand | Description |
|---|---|
list | 显示定时任务 |
create / add | 基于 prompt 创建定时任务,可重复传 --skill 绑定多个技能 |
edit | 更新任务的调度、prompt、名称、投递方式、重复次数或绑定技能 |
pause | 暂停任务但不删除 |
resume | 恢复已暂停任务,并重新计算下次运行时间 |
run | 在下一次 scheduler tick 时触发任务 |
remove | 删除任务 |
status | 检查 cron scheduler 是否在运行 |
tick | 只运行一次到期任务后退出 |
hermes webhook
hermes webhook <subscribe|list|remove|test>
| Subcommand | Description |
|---|---|
subscribe / add | 创建 webhook 路由,返回要配置到外部服务上的 URL 与 HMAC secret |
list / ls | 显示全部 agent 创建的订阅 |
remove / rm | 删除动态订阅;不会影响 config.yaml 中的静态路由 |
test | 发送测试 POST,验证订阅是否工作正常 |
hermes webhook subscribe
hermes webhook subscribe <name> [options]
| Option | Description |
|---|---|
--prompt | 带 {dot.notation} payload 引用的 prompt 模板 |
--events | 可接受的事件类型,逗号分隔 |
--description | 人类可读描述 |
--skills | 要为本次 agent 运行加载的技能,逗号分隔 |
--deliver | 投递目标:log、telegram、discord、slack、github_comment |
--deliver-chat-id | 跨平台投递时的目标 chat/channel ID |
--secret | 自定义 HMAC secret;省略则自动生成 |
订阅会持久化到 ~/.hermes/webhook_subscriptions.json,且 webhook adapter 会热加载,无需重启网关。
hermes doctor
hermes doctor [--fix]
| Option | Description |
|---|---|
--fix | 在可能时自动修复问题 |
hermes dump
hermes dump [--show-keys]
输出你的 Hermes 环境摘要,适合复制到 Discord、GitHub issue 或 Telegram 中求助。
| Option | Description |
|---|---|
--show-keys | 用 API key 的前后 4 位替代简单的 set/not set |
包含内容
| Section | Details |
|---|---|
| Header | Hermes 版本、发布日期、git commit |
| Environment | OS、Python 版本、OpenAI SDK 版本 |
| Identity | 当前 profile 名称与 HERMES_HOME |
| Model | 默认模型与 provider |
| Terminal | 终端后端类型 |
| API keys | 各 provider/工具 API key 的存在性检查 |
| Features | 启用的 toolset、MCP server 数量、memory provider |
| Services | 网关状态与已配置消息平台 |
| Workload | cron 任务数量、已安装技能数量 |
| Config overrides | 与默认值不同的配置项 |
示例输出
--- hermes dump ---
version: 0.8.0 (2026.4.8) [af4abd2f]
os: Linux 6.14.0-37-generic x86_64
python: 3.11.14
openai_sdk: 2.24.0
profile: default
hermes_home: ~/.hermes
model: anthropic/claude-opus-4.6
provider: openrouter
terminal: local
...
--- end dump ---
hermes debug
hermes debug share [options]
上传调试报告(系统信息 + 最近日志)到 paste 服务,并返回可分享 URL。
| Option | Description |
|---|---|
--lines <N> | 每个日志文件包含多少行 |
--expire <days> | paste 过期时间(天) |
--local | 不上传,直接在本地打印报告 |
hermes backup
hermes backup [options]
创建 Hermes 配置、技能、会话和数据的 zip 备份,不包含 hermes-agent 代码库本身。
| Option | Description |
|---|---|
-o, --output <path> | 备份 zip 输出路径 |
-q, --quick | 快速快照,只保存关键状态文件 |
-l, --label <name> | 快照标签(仅对 --quick 有效) |
hermes import
hermes import <zipfile> [options]
把历史备份恢复到 Hermes home 目录。
| Option | Description |
|---|---|
-f, --force | 不经确认直接覆盖现有文件 |
hermes logs
hermes logs [log_name] [options]
查看、跟随与过滤 Hermes 日志文件。默认日志位于 ~/.hermes/logs/(非默认 profile 则在 <profile>/logs/)。
日志文件
| Name | File | What it captures |
|---|---|---|
agent(默认) | agent.log | 全部 agent 活动,包括 API 调用、工具分发和会话生命周期 |
errors | errors.log | 仅警告与错误,是 agent.log 的过滤子集 |
gateway | gateway.log | 消息网关活动,如平台连接、消息分发和 webhook 事件 |
选项
| Option | Description |
|---|---|
log_name | 要查看的日志:agent、errors、gateway,或 list |
-n, --lines <N> | 显示的行数 |
-f, --follow | 实时跟随,类似 tail -f |
--level <LEVEL> | 最低日志级别 |
--session <ID> | 仅显示包含某 session ID 的行 |
--since <TIME> | 仅显示某个相对时间之后的日志 |
--component <NAME> | 按组件过滤,如 gateway、agent、tools、cli、cron |
hermes config
hermes config <subcommand>
| Subcommand | Description |
|---|---|
show | 显示当前配置值 |
edit | 在编辑器中打开 config.yaml |
set <key> <value> | 设置配置值 |
path | 输出配置文件路径 |
env-path | 输出 .env 文件路径 |
check | 检查配置是否缺失或过期 |
migrate | 交互式补充新引入的配置项 |
hermes pairing
hermes pairing <list|approve|revoke|clear-pending>
| Subcommand | Description |
|---|---|
list | 显示待审批和已批准用户 |
approve <platform> <code> | 批准一个 pairing code |
revoke <platform> <user-id> | 撤销某个用户访问权限 |
clear-pending | 清空待处理 pairing code |
hermes skills
hermes skills <subcommand>
| Subcommand | Description |
|---|---|
browse | 分页浏览技能注册表 |
search | 搜索技能注册表 |
install | 安装技能 |
inspect | 安装前预览技能 |
list | 列出已安装技能 |
check | 检查已安装 hub 技能是否有上游更新 |
update | 重新安装有更新的 hub 技能 |
audit | 重新扫描已安装 hub 技能 |
uninstall | 卸载通过 hub 安装的技能 |
publish | 发布技能到注册表 |
snapshot | 导出/导入技能配置 |
tap | 管理自定义技能源 |
config | 按平台交互式启用/禁用技能 |
hermes honcho
hermes honcho [--target-profile NAME] <subcommand>
用于管理 Honcho 跨会话记忆集成,仅当 memory.provider 设为 honcho 时可用。
| Subcommand | Description |
|---|---|
setup | 重定向到 hermes memory setup |
status [--all] | 显示当前 Honcho 配置与连接状态 |
peers | 显示所有 profile 中的 peer 身份 |
sessions | 列出已知 Honcho session 映射 |
map [name] | 将当前目录映射到某个 Honcho session 名称 |
peer | 显示或更新 peer 名称与 dialectic reasoning 级别 |
mode [mode] | 显示或设置 recall 模式 |
tokens | 显示或设置 context/dialectic token 预算 |
identity [file] [--show] | 初始化或显示 AI peer identity 表示 |
enable | 为当前 profile 启用 Honcho |
disable | 为当前 profile 关闭 Honcho |
sync | 将 Honcho 配置同步到已有 profile |
migrate | 从 openclaw-honcho 迁移到 Hermes Honcho 的引导流程 |
hermes memory
hermes memory <subcommand>
设置与管理外部 memory provider plugin。内置记忆(MEMORY.md/USER.md)始终启用。
| Subcommand | Description |
|---|---|
setup | 交互式选择并配置 provider |
status | 显示当前 memory provider 配置 |
off | 关闭外部 provider,仅保留内置记忆 |
hermes acp
hermes acp
以 ACP(Agent Client Protocol)stdio server 的方式启动 Hermes,用于编辑器集成。
相关入口:
hermes-acp
python -m acp_adapter
hermes mcp
hermes mcp <subcommand>
| Subcommand | Description |
|---|---|
serve [-v|--verbose] | 以 MCP server 模式运行 Hermes |
add <name> [--url URL] [--command CMD] [--args ...] [--auth oauth|header] | 添加 MCP server 并自动发现工具 |
remove <name>(别名:rm) | 从配置中删除 MCP server |
list(别名:ls) | 列出已配置 MCP server |
test <name> | 测试与 MCP server 的连接 |
configure <name>(别名:config) | 切换该 server 的工具选择 |
hermes plugins
hermes plugins [subcommand]
统一插件管理入口,涵盖通用插件、memory provider 和 context engine。
| Subcommand | Description |
|---|---|
| (none) | 组合式交互 UI:通用插件开关 + provider plugin 配置 |
install <identifier> [--force] | 从 Git URL 或 owner/repo 安装插件 |
update <name> | 拉取已安装插件的最新变化 |
remove <name>(别名:rm, uninstall) | 删除插件 |
enable <name> | 启用已禁用插件 |
disable <name> | 禁用插件但不移除 |
list(别名:ls) | 列出已安装插件及启用状态 |
hermes tools
hermes tools [--summary]
| Option | Description |
|---|---|
--summary | 打印当前启用工具摘要后退出 |
无 --summary 时,会启动按平台配置工具的交互式 UI。
hermes sessions
hermes sessions <subcommand>
| Subcommand | Description |
|---|---|
list | 列出最近会话 |
browse | 带搜索与恢复功能的交互式会话选择器 |
export <output> [--session-id ID] | 导出会话到 JSONL |
delete <session-id> | 删除单个会话 |
prune | 清理旧会话 |
stats | 显示 session store 统计 |
rename <session-id> <title> | 设置或修改会话标题 |
hermes insights
hermes insights [--days N] [--source platform]
| Option | Description |
|---|---|
--days <n> | 分析最近 n 天,默认 30 |
--source <platform> | 按来源平台过滤,如 cli、telegram、discord |
hermes claw
hermes claw migrate [options]
将 OpenClaw 配置迁移到 Hermes,默认从 ~/.openclaw 读取并写入 ~/.hermes。
| Option | Description |
|---|---|
--dry-run | 只预览,不写入 |
--preset <name> | 迁移预设:full 或 user-data |
--overwrite | 冲突时覆盖现有 Hermes 文件 |
--migrate-secrets | 一并迁移 API key |
--source <path> | 自定义 OpenClaw 目录 |
--workspace-target <path> | 工作区指令(AGENTS.md)目标目录 |
--skill-conflict <mode> | 技能重名处理策略:skip、overwrite、rename |
--yes | 跳过确认提示 |
hermes dashboard
hermes dashboard [options]
启动 Web 仪表盘,用于浏览器中管理配置、API key 和会话。
| Option | Default | Description |
|---|---|---|
--port | 9119 | Web server 端口 |
--host | 127.0.0.1 | 绑定地址 |
--no-open | — | 不自动打开浏览器 |
hermes profile
hermes profile <subcommand>
管理 profile,即多个彼此隔离的 Hermes 实例,每个实例都有独立的配置、会话、技能和 home 目录。
| Subcommand | Description |
|---|---|
list | 列出全部 profile |
use <name> | 设置一个持久默认 profile |
create <name> [--clone] [--clone-all] [--clone-from <source>] [--no-alias] | 创建新 profile |
delete <name> [-y] | 删除 profile |
show <name> | 显示 profile 详情 |
alias <name> [--remove] [--name NAME] | 管理 profile 包装脚本别名 |
rename <old> <new> | 重命名 profile |
export <name> [-o FILE] | 导出 profile 为 .tar.gz |
import <archive> [--name NAME] | 从 .tar.gz 导入 profile |
示例:
hermes profile list
hermes profile create work --clone
hermes profile use work
hermes profile alias work --name h-work
hermes profile export work -o work-backup.tar.gz
hermes profile import work-backup.tar.gz --name restored
hermes -p work chat -q "Hello from work profile"
hermes completion
hermes completion [bash|zsh]
把 shell 补全脚本输出到 stdout。将其 source 到 shell 配置中后,即可对 Hermes 命令、子命令和 profile 名启用 tab 补全。
# Bash
hermes completion bash >> ~/.bashrc
# Zsh
hermes completion zsh >> ~/.zshrc
维护命令
| Command | Description |
|---|---|
hermes version | 输出版本信息 |
hermes update | 拉取最新变更并重装依赖 |
hermes uninstall [--full] [--yes] | 移除 Hermes,可选删除所有配置与数据 |