Skip to content

Hermes Agent CLI 命令速查手册:从安装到调优全覆盖

2026年4月17日

Hermes Agent CLI 命令速查手册:从安装到调优全覆盖

装完 Hermes Agent,不知道从哪下手?hermes chat、hermes model、hermes gateway、hermes skills、hermes cron……每个命令干什么用,什么时候用,怎么组合用,这篇全给你讲清楚。直接上命令+场景+速查表,常用命令全覆盖。

这篇手册把 Hermes Agent 的所有命令按功能分组:核心命令(日常必用)、配置调试(出问题用)、定时任务(自动化)、Skills 系统(技能管理)、数据管理(备份恢复)、多实例管理(profile)、OpenClaw 迁移。

每个命令都有使用场景和典型例子,看完就能上手。

一、核心命令:日常必用

hermes chat — 启动对话

bash
hermes                         # 启动交互式对话
hermes chat -q "Summarize PRs"  # 单次查询,不进入交互模式
hermes chat --model claude-sonnet-4  # 指定模型
hermes chat --toolsets web,terminal  # 指定工具集
hermes chat --resume abc123     # 恢复指定会话
hermes chat --continue          # 恢复上一个会话

什么时候用:日常对话、临时任务、问问题。

典型场景:打开终端,直接敲 hermes 开始聊天;加了 -q 参数做单次自动化调用然后退出。

hermes model — 配置模型

bash
hermes model                   # 交互式选择模型和 Provider
/model claude-sonnet-4         # 切换模型(会话内)
/model zai:glm-5              # 切换 Provider 和模型
/model claude-sonnet-4 --global  # 切换并保存为默认

什么时候用:添加新 Provider(OpenRouter、Anthropic 等)、首次配置 API Key、切换默认模型。

典型场景:切换到更便宜的速度提供商,或者临时用更强模型跑复杂任务。

支持的 Provider: auto, openrouter, nous, openai-codex, copilot-acp, copilot, anthropic, gemini, huggingface, zai, kimi-coding, minimax, minimax-cn, kilocode, xiaomi, arcee

hermes gateway — 消息网关

bash
hermes gateway setup           # 配置消息平台(飞书/Telegram/Discord 等)
hermes gateway run             # 前台运行(WSL 用户用这个)
hermes gateway start           # 后台服务启动
hermes gateway stop            # 停止服务
hermes gateway status          # 查看服务状态

什么时候用:配置飞书接入、启动 Bot 服务、检查运行状态。

典型场景:首次配置飞书 Bot 用 setup,WSL 环境下用 run 前台运行便于看日志,服务端部署用 start 后台守护。

二、配置与调试:出了问题用这些

hermes doctor — 自动诊断

bash
hermes doctor                  # 诊断配置问题
hermes doctor --fix            # 自动修复(能修的自动修)

什么时候用:命令报错、连接失败、先跑这个。

典型场景:跑任何命令报错了,第一反应就是 hermes doctor --fix,能修的自动修,修不了的告诉你哪里有问题。

💡 组合用法hermes doctor --fix && hermes gateway restart 是排查问题的标准流程,先诊断再重启。

hermes status — 查看状态

bash
hermes status                  # 快速状态总览
hermes status --all           # 完整详细信息
hermes status --deep          # 深度检查(耗时更长)

什么时候用:快速了解当前配置情况。

典型场景:接手别人的机器,先跑 hermes status --all 扫一眼当前配置。

hermes dump — 一键导出诊断信息

bash
hermes dump                    # 生成可分享的诊断报告
hermes dump --show-keys       # 显示 API Key 状态(脱敏)

什么时候用:提 Bug、问社区、让高手帮你看配置。

典型场景:在 GitHub Issue 或 Discord 求助前,先跑 hermes dump 生成报告链接贴上去,省得来回要日志。

hermes logs — 查看日志

bash
hermes logs                    # 查看最近 50 行
hermes logs -f                 # 实时跟踪日志
hermes logs gateway -n 100    # 查看 gateway 日志 100 行
hermes logs --level WARNING --since 1h  # 最近 1 小时警告级别日志
hermes logs --session abc123   # 只看指定会话的日志

什么时候用:排查 Bug、追踪 Agent 行为、看 Webhook 事件。

典型场景:配合 hermes logs -f 实时盯日志,定位问题时加上 --level WARNING 只看警告。

hermes debug share — 分享调试信息

bash
hermes debug share             # 上传诊断报告,生成可分享链接
hermes debug share --lines 500  # 包含更多日志行
hermes debug share --expire 30  # 30 天后过期

什么时候用:在 Discord/GitHub 提问时贴链接。

典型场景:群里有人问你问题,hermes debug share --lines 500 一键生成链接甩过去,比截图清晰一百倍。

三、定时任务与自动化

hermes cron — 定时任务

bash
hermes cron list               # 列出所有定时任务
hermes cron create             # 创建新任务(交互式)
hermes cron create --skill myskill  # 带 Skill 创建
hermes cron run <id>           # 立即触发执行一次
hermes cron pause <id>         # 暂停任务
hermes cron resume <id>        # 恢复任务
hermes cron remove <id>        # 删除任务
hermes cron status             # 查看调度器状态

什么时候用:每天自动生成日报、每周自动推送周报、监控任务等。

典型场景:早上 8 点自动抓取 GH Trending 生成技术日报,配置一次每天自动跑,不用手动触发。

💡 定时备份建议

bash
hermes cron create "0 2 * * *" "hermes backup -o ~/backups/hermes-$(date +%Y%m%d).zip"

hermes webhook — 事件触发

bash
hermes webhook subscribe <name> \
  --prompt "分析GitHub issue: {payload.title}" \
  --events=issues,pull_request \
  --deliver telegram \
  --deliver-chat-id 你的ChatID

hermes webhook list            # 列出所有 Webhook 订阅
hermes webhook test <name>     # 发送测试事件
hermes webhook remove <name>   # 删除订阅

什么时候用:GitHub 有 PR 自动触发 Agent 处理、第三方服务事件触发等。

典型场景:给仓库配置一个 webhook,收到 GitHub Issue 事件自动触发 Agent 分类和初步回复。支持 --events=issues,pull_request,push 等多个事件类型,--deliver 指定推送平台。

四、记忆与 Skills 系统

hermes skills — 技能管理

bash
hermes skills browse           # 浏览 Skill 市场
hermes skills search <关键>   # 搜索 Skills
hermes skills install <name>   # 安装 Skill
hermes skills inspect <name>   # 预览 Skill 内容(不安装)
hermes skills list            # 列出已安装 Skills
hermes skills check            # 检查 Skills 更新
hermes skills update          # 更新已有 Skills
hermes skills audit           # 扫描 Skills 健康状态
hermes skills uninstall <name>  # 卸载 Skill

什么时候用:扩展 Agent 能力、管理技能库。

典型场景:想做图片生成?hermes skills search image 搜一下;装完不确定有没有问题?hermes skills audit 扫一遍。

hermes memory — 外部记忆

bash
hermes memory configure        # 配置外部记忆 Provider

什么时候用:连接 Honcho、Mem0 等外部记忆系统,实现跨会话记忆共享。

典型场景:需要 Agent 记住你的偏好、项目背景,用这个配置外部记忆 Provider。

hermes honcho — Honcho 集成

bash
hermes honcho status           # 查看 Honcho 连接状态
hermes honcho setup            # 配置 Honcho

什么时候用:跨会话记忆共享、用户画像持久化。

典型场景:Honcho 是一个用户画像服务,配置后每次对话 Agent 都知道你是谁、关注什么。

五、数据与文件管理

hermes backup — 备份

bash
hermes backup                  # 全量备份
hermes backup --quick         # 快速快照(只备份关键状态)
hermes backup -o /path/backup.zip  # 指定备份路径

什么时候用:升级前、大改配置前、定期自动备份。

典型场景:升级大版本前跑一遍 hermes backup,出了问题一分钟回滚。

hermes import — 恢复

bash
hermes import backup.zip      # 从备份恢复
hermes import backup.zip --force  # 覆盖恢复

什么时候用:换服务器、迁移数据、回滚配置。

典型场景:换了一台新机器,hermes import backup.zip 把所有配置和会话历史迁移过去。

hermes sessions — 会话管理

bash
hermes sessions list           # 列出所有会话
hermes sessions rename <id> <name>  # 重命名会话
hermes sessions delete <id>    # 删除会话
hermes sessions prune          # 清理旧会话

什么时候用:整理会话历史、删除敏感对话、释放存储空间。

典型场景:聊了很多轮之后 hermes sessions list 看看有哪些,prune 批量清理旧会话。

hermes insights — 用量分析

bash
hermes insights                # 查看 Token/费用/活跃度统计
hermes insights --days 30    # 最近 30 天统计

什么时候用:了解使用成本、优化模型选择。

典型场景:月底跑一下 hermes insights --days 30,看看 Token 消耗分布,考虑是否切换到更划算的 Provider。

hermes auth — 凭证管理

bash
hermes auth list               # 列出所有凭证
hermes auth add openrouter --api-key sk-or-v1-xxx  # 添加 API Key
hermes auth remove openrouter 2  # 删除指定 Key
hermes auth reset openrouter    # 重置限速

什么时候用:管理多个 API Key、Key 轮换、处理限速。

典型场景:同一个 Provider 注册了多个 Key,某个 Key 被限速了,hermes auth reset 重置后切到另一个。

💡 企业场景:多人共用服务器时,可以用 profile + auth list 实现凭证隔离,每个人只能看到自己的 API Key。

hermes update — 更新与卸载

bash
hermes update                  # 更新到最新版本
hermes uninstall              # 卸载 Hermes

什么时候用:保持最新版本、彻底清理。

典型场景:每次大版本更新后跑 hermes update,不想用了 hermes uninstall 干净卸载。

六、全局选项

所有命令都支持以下全局选项:

bash
--version, -V                  # 显示版本号
--profile, -p <name>           # 指定配置 profile
--resume, -r <session_id>      # 恢复指定会话
--continue, -c                # 恢复上一个会话
--worktree, -w <path>         # 指定工作目录
--yolo                        # 跳过确认直接执行
--pass-session-id             # 传递会话 ID 给子进程

什么时候用:多实例同时跑不同任务时用 --profile 隔离;脚本里自动化跑加 --yolo 跳过交互确认。

七、多实例管理:hermes profile

bash
hermes profile list             # 列出所有 profile
hermes profile create <name>    # 创建新 profile
hermes profile create <name> --clone  # 从当前 profile 克隆配置
hermes profile use <name>       # 设为默认 profile
hermes profile delete <name>    # 删除 profile
hermes profile alias <name> --name h-xxx  # 创建快捷命令别名
hermes profile export <name> -o backup.tar.gz  # 导出 profile
hermes profile import backup.tar.gz --name restored  # 导入 profile

# 用指定 profile 启动对话
hermes -p work chat -q "处理今天的工作任务"

什么时候用:工作和生活完全隔离?hermes profile create workhermes profile use work,两套配置互不干扰。切换机器时 export 备份,import 恢复,5 秒迁移完成。

典型场景:多人共用一台服务器,每人一个 profile;或者同一台机器上区分"日常对话"和"编程任务"两套配置。

八、OpenClaw 迁移(完整参数)

bash
hermes claw migrate --dry-run            # 预览迁移内容
hermes claw migrate --preset full        # 全量迁移(含 API keys)
hermes claw migrate --preset user-data   # 只迁移用户数据,不含密钥
hermes claw migrate --overwrite          # 覆盖已有文件(默认跳过冲突)
hermes claw migrate --source ~/.openclaw  # 指定 OpenClaw 目录
hermes claw migrate --workspace-target ~/.hermes/workspace  # 指定 workspace 迁移目标
hermes claw migrate --skill-conflict overwrite  # 技能冲突处理:skip/overwrite/rename

什么时候用:从 OpenClaw 完整迁移,包括 SOUL.md、MEMORY.md、Skills、API keys、Telegram/Discord 配置等 30+ 项目。

典型场景:试了几天 Hermes 决定正式切换,--dry-run 先看一遍迁移清单,确认没问题 --preset full 正式迁移。

九、MCP 外部能力接入

bash
hermes mcp add                 # 添加 MCP 服务器
hermes mcp list                # 列出已配置的 MCP
hermes mcp remove <name>       # 移除 MCP

什么时候用:接入外部工具和能力,比如飞书 MCP、本地文件系统 MCP。

典型场景:想让 Hermes 直接操作飞书日历,hermes mcp add 配置飞书 MCP 服务器。

十、速查表

常用命令速查

场景命令
启动对话hermes chat
配置模型hermes model
配置飞书 Bothermes gateway setup
启动 Bot 服务(WSL)hermes gateway run
启动 Bot 服务(后台)hermes gateway start
诊断问题hermes doctor --fix
导出诊断信息hermes dump
查日志hermes logs -f
创建定时任务hermes cron create
安装 Skillhermes skills install <name>
搜索 Skillhermes skills search <关键词>
备份配置hermes backup
恢复备份hermes import backup.zip
OpenClaw 迁移hermes claw migrate --dry-run
查看用量hermes insights
管理凭证hermes auth list
更新版本hermes update

Provider 速查

Provider说明
anthropicAnthropic 官方(Claude 系列)
openrouter聚合多模型的网关
geminiGoogle Gemini
minimax / minimax-cnMiniMax(国内可用)
zaiNous Research
kimi-coding月之暗面 Kimi
openai-codexOpenAI Codex
copilot / copilot-acpGitHub Copilot
huggingfaceHugging Face 模型
xiaomi小米 MiMo

版本信息:Hermes v0.8.0(2026.4.8)

官方文档https://hermes-agent.nousresearch.com/docs/reference/cli-commands

密钥管理:建议所有敏感配置放进 ~/.hermes/.env,不要写进 config.yaml

不要孤军奋战啦!

加入微信群一起学习交流 AI

与大神一起使用 OpenClaw、Hermes、Claude Code、Seedance 2.0、GPT-Image-2 等

微信公众号

扫码关注微信公众号
私信 "加群",将自动获取微信群二维码

探索 AI 世界,掌握智能未来