Skip to content

CLI 命令参考

本页面列出 Hermes Agent 所有可用的命令行接口(CLI)命令,包括选项说明和使用示例。


hermes / hermes chat

启动交互式聊天会话(默认命令)。

bash
hermes [选项]
hermes chat [选项]

选项

选项说明
-q, --quiet静默模式,减少输出信息
-m, --model <模型>指定使用的模型(如 claude-3-5-sonnetgpt-4o
-t, --temperature <值>设置模型温度(0.0 ~ 2.0)
--provider <提供商>指定 AI 提供商(如 anthropicopenaiollama
-s, --system <提示词>自定义系统提示词
-v, --verbose详细输出模式,显示调试信息
-Q, --query <问题>非交互式:发送单条消息后退出
--checkpoints启用检查点,支持会话回溯
--yolo跳过所有工具调用确认(危险模式)
--max-turns <N>最大对话轮次,默认为 90
-c, --continue继续上次会话
-r, --resume <会话ID>恢复指定会话
-w, --workspace <目录>设置工作目录

示例

bash
# 启动默认聊天
hermes

# 使用指定模型启动
hermes -m claude-3-5-sonnet

# 非交互式问答
hermes -Q "今天北京天气如何?"

# 继续上次会话,最多 50 轮
hermes -c --max-turns 50

# 跳过确认(自动执行所有工具)
hermes --yolo

hermes model

管理和切换 AI 模型。

bash
hermes model

交互式列出所有可用模型,选择后保存为默认模型。支持按提供商过滤,显示每个模型的上下文长度和能力信息。


hermes gateway

管理消息网关服务(Telegram、Discord、Slack 等平台接入)。

bash
hermes gateway <子命>
子命令说明
setup交互式配置网关(选择平台、填写 Token 等)
install安装为系统服务(用户级);加 --system 安装为系统级服务
start启动网关服务
stop停止网关服务
status查看网关运行状态和已接入平台

示例

bash
hermes gateway setup
hermes gateway install
hermes gateway start
hermes gateway status
sudo hermes gateway install --system

hermes setup

首次运行引导配置向导,帮助配置 API 密钥、默认模型、终端后端等基本设置。

bash
hermes setup

hermes whatsapp

配置 WhatsApp 接入(需要 Node.js v22)。

bash
hermes whatsapp

通过 QR 码扫描完成 WhatsApp Web 配对,详见 WhatsApp 接入


hermes auth

管理身份认证信息,查看或刷新 OAuth 令牌、API 密钥状态。

bash
hermes auth

hermes status

显示 Hermes 当前运行状态,包括:

  • 已配置的提供商和模型
  • 网关服务状态
  • 内存使用情况
  • 活跃会话数
bash
hermes status

hermes cron

管理定时任务(Cron Jobs),让 Hermes 在指定时间自动执行任务。

bash
hermes cron <子命>
子命令说明
list列出所有定时任务
create创建新定时任务(交互式)
edit <任务ID>编辑已有定时任务
pause <任务ID>暂停定时任务
resume <任务ID>恢复已暂停的定时任务
run <任务ID>立即手动触发一次任务
remove <任务ID>删除定时任务
status <任务ID>查看单个任务状态和最近执行日志
tick检查并触发当前时刻到期的任务(通常由系统调用)

示例

bash
# 列出所有任务
hermes cron list

# 创建新任务
hermes cron create

# 立即运行任务
hermes cron run abc123

hermes webhook

管理 Webhook 订阅,将外部事件推送给 Hermes 处理。

bash
hermes webhook subscribe [选项]

subscribe 选项

选项说明
--prompt <提示词>收到事件时使用的处理提示词
--events <事件列表>订阅的事件类型(逗号分隔)
--description <描述>Webhook 的描述信息
--skills <技能列表>处理时加载的技能(逗号分隔)
--deliver <方式>结果投递方式(如 chatemail
--deliver-chat-id <ID>投递目标的聊天 ID
--secret <密钥>用于验证 Webhook 签名的密钥

示例

bash
hermes webhook subscribe \
  --prompt "分析这条 GitHub 事件并总结变更" \
  --events "push,pull_request" \
  --deliver chat \
  --deliver-chat-id 12345678 \
  --secret mywebhooksecret

hermes doctor

诊断 Hermes 安装问题,检查依赖、配置、API 连通性等。

bash
hermes doctor [--fix]
选项说明
--fix自动修复发现的问题(如安装缺失依赖)

hermes config

管理配置文件(~/.hermes/config.yaml)。

bash
hermes config <子命>
子命令说明
set <键> <值>设置指定配置项
show显示当前所有配置
edit用默认编辑器打开配置文件
migrate将旧版配置格式迁移到最新格式

示例

bash
hermes config set display.bell_on_complete true
hermes config show
hermes config edit
hermes config migrate

hermes pairing

管理消息平台的配对授权(用于控制哪些用户可以使用网关)。

bash
hermes pairing <子命>
子命令说明
approve <请求ID>批准配对请求,允许该用户使用
revoke <用户ID>撤销已授权用户的访问权限

hermes skills

管理 Hermes 技能(Skills)扩展。

bash
hermes skills <子命>
子命令说明
browse浏览技能市场,查看可安装的技能
install <技能名>安装指定技能
manage管理已安装的技能(启用/禁用/卸载)

hermes honcho

进入 Honcho 人格管理模式,配置和切换 Agent 人格(Personality)。

bash
hermes honcho

hermes memory

查看和管理 Hermes 的记忆系统。

bash
hermes memory

显示当前存储的用户画像、记忆条目,支持查看、编辑和删除。


hermes acp

管理 ACP(Agent Communication Protocol)适配器配置,用于多 Agent 协作场景。

bash
hermes acp

hermes mcp

管理 MCP(Model Context Protocol)服务器。

bash
hermes mcp <子命>
子命令说明
serve以 MCP 服务器模式运行 Hermes,供其他 Agent 调用
manage管理已配置的 MCP 服务器(添加/删除/测试)

hermes plugins

管理插件,查看已安装插件列表,安装或卸载第三方插件。

bash
hermes plugins

hermes tools

列出当前可用的所有工具(Tools),包括内置工具(47 个工具、37 个工具集)及通过 MCP 加载的外部工具。

bash
hermes tools

hermes sessions

管理历史会话。

bash
hermes sessions <子命>
子命令说明
list列出所有历史会话
browse交互式浏览会话列表
export <会话ID>导出会话内容(Markdown 或 JSON 格式)
delete <会话ID>删除指定会话
prune清理旧会话(保留最近 N 个)
stats显示会话统计信息(总数、token 用量等)
rename <会话ID> <新名称>重命名会话

示例

bash
hermes sessions list
hermes sessions export abc123 --format markdown
hermes sessions delete abc123
hermes sessions prune --keep 20

hermes insights

查看使用洞察报告,包括模型使用频率、token 消耗、工具调用统计等。

bash
hermes insights [--days <>]
选项说明
--days <N>统计最近 N 天的数据(默认 7 天)

hermes claw migrate

将 Claw 配置迁移到 Hermes,用于从旧版工具升级。

bash
hermes claw migrate

hermes profile

管理配置文件(Profile),每个 Profile 可以有独立的模型、提示词和配置。

bash
hermes profile <子命>
子命令说明
list列出所有配置文件
use <名称>切换到指定配置文件
create <名称>创建新配置文件
delete <名称>删除配置文件
show [名称]显示配置文件详情
alias <名称> <别名>为配置文件设置别名
rename <旧名称> <新名称>重命名配置文件
export <名称>导出配置文件为 YAML
import <文件路径>从 YAML 文件导入配置文件

示例

bash
hermes profile create work
hermes profile use work
hermes profile list
hermes profile export work > work-profile.yaml
hermes profile import ./work-profile.yaml

hermes completion

生成 Shell 自动补全脚本。

bash
hermes completion [bash|zsh]

示例

bash
# Bash 补全
hermes completion bash >> ~/.bashrc

# Zsh 补全
hermes completion zsh >> ~/.zshrc

hermes update

检查并更新 Hermes 到最新版本。

bash
hermes update

hermes uninstall

卸载 Hermes 及相关文件。

bash
hermes uninstall

执行前会提示确认,并可选择是否保留用户数据(~/.hermes/)。


全局选项

以下选项适用于所有命令:

选项说明
--help, -h显示帮助信息
--version显示版本号
--config <路径>指定配置文件路径(默认 ~/.hermes/config.yaml
--profile <名称>使用指定配置文件

基于 MIT 许可发布 | 由 Nous Research 开发