Hermes Agent 内部/后端命令速查表

来源:Hermes Agent 官方文档 + 实际使用验证

适用版本:Hermes Agent v0.11+

范围:本文档覆盖 Hermes 的内部子命令、后台系统、底层配置、slash commands、agent 派生

区别于 hermes-commands-cheatsheet.md(常用命令),本文档聚焦进阶/底层功能


目录

  1. [MCP 服务器](#MCP 服务器)
  2. 认证与凭据池
  3. 插件管理
  4. 内存系统
  5. [ACP / IDE 集成](#ACP / IDE 集成)
  6. 其他内部命令
  7. [In-Session Slash Commands](#In-Session Slash Commands)
  8. [派生 Agent 实例](#派生 Agent 实例)
  9. [Durable & Background Systems](#Durable & Background Systems)
  10. [Voice & Transcription](#Voice & Transcription)
  11. 安全与隐私开关
  12. 配置章节详解

1. MCP 服务器

bash 复制代码
# 启动 Hermes 作为 MCP server(让 Claude Desktop / 其他 MCP client 连接)
hermes mcp serve

# 加 MCP server
hermes mcp add myserver --url http://localhost:8080
hermes mcp add myserver --command "node /path/to/server.js"

# 删除
hermes mcp remove myserver

# 列出
hermes mcp list

# 测试连接
hermes mcp test myserver

# 切换 tool 选择
hermes mcp configure myserver

解释: MCP (Model Context Protocol) 是 Anthropic 开放的标准,让外部工具/数据源接入 LLM。mcp serve 把 Hermes 本身变成 MCP server(暴露它的工具);mcp add 让 Hermes 连接其他 MCP server。


2. 认证与凭据池

bash 复制代码
# 交互式添加凭据
hermes auth
hermes auth add openai-codex           # OAuth flow
hermes auth add anthropic              # API key

# 列出
hermes auth list
hermes auth list openai               # 按 provider 过滤

# 删除
hermes auth remove openai-codex 0      # provider + index

# 重置 exhaustion 状态(key 被标记为耗尽后)
hermes auth reset openai

解释: Hermes 支持凭据池 --- 同一个 provider 可以配多个 API key,自动轮换避免限流。auth list <provider> 看每个 key 的状态。exhaustion 表示 key 被标记为暂时用完(rate limit 等),reset 恢复。


3. 插件管理

bash 复制代码
# 列出已装插件
hermes plugins list

# 安装
hermes plugins install honcho
hermes plugins install <github-url>

# 卸载
hermes plugins remove honcho

常用插件:

  • honcho --- 跨 session 内存(推荐)
  • kanban --- 多 agent 协作
  • web-search --- 内置(不需要装)

4. 内存系统

bash 复制代码
# Honcho 集成
hermes honcho setup                   # 配置
hermes honcho status                  # 状态

# Memory provider
hermes memory setup                   # 初始化
hermes memory status                  # 看配置
hermes memory off                     # 禁用

# 内存后端:built-in, Honcho, Mem0(看 plugins)

配置示例:

yaml 复制代码
memory:
  memory_enabled: true
  user_profile_enabled: true
  provider: honcho          # 或 built-in / mem0

解释: Memory 跨 session 持久化。Honcho 是 Nous Research 出的分布式 memory 服务,能在多 device 同步。"User profile" 让 Hermes 自动学习 Jack 的偏好(已经看到了 Jack 收藏的文章)。


5. ACP / IDE 集成

bash 复制代码
hermes acp                            # 启动 ACP server

ACP = Agent Client Protocol。让 IDE(VS Code、JetBrains)作为 client 连接 Hermes。配置例子(VS Code settings.json):

json 复制代码
{
  "acp.agent.command": "hermes",
  "acp.agent.args": ["acp"]
}

解释: 通过 ACP,IDE 内的文件/项目直接喂给 Hermes agent,agent 改文件、跑命令像在 CLI 一样。


6. 其他内部命令

bash 复制代码
# 平台 DM 授权(首次有人 DM Telegram bot 需 admin 批准)
hermes pairing list
hermes pairing approve <code>
hermes pairing revoke <code>

# 更新到最新版本
hermes update

# 卸载 Hermes
hermes uninstall

# 从 OpenClaw 迁移(老项目)
hermes claw migrate

# Shell 自动补全
hermes completion bash > ~/.bash_completion
hermes completion zsh > "${fpath[1]}/_hermes"

# 用量分析
hermes insights --days 30

# Debug 报告(上传到 nous 服务器,生成可分享链接)
hermes debug

解释: pairing 用于 DM-first 平台(Telegram、Discord、Signal)防止陌生人触发 agent。update 拉最新 release。debug 打包 system info + logs + config,输出一个 URL 给开发者定位问题。


7. In-Session Slash Commands

这些是 chat session 内的命令,输入 / 触发。

Session 控制

复制代码
/new (/reset)        全新 session
/clear               清屏 + 新 session(CLI)
/retry               重发上一条
/undo                删最后一个 exchange
/title [name]        命名当前 session
/compress            手动压缩 context
/stop                kill 后台进程
/rollback [N]        恢复 filesystem checkpoint
/snapshot [sub]      创建/恢复 Hermes 状态快照(CLI)
/background <prompt> 后台跑 prompt
/queue <prompt>      排队到下一 turn
/steer <prompt>      在下一个 tool call 后注入(不打断当前)
/agents (/tasks)     列出活跃 subagent 和 running task
/resume [name]       恢复命名 session
/goal [text|sub]     设定持续目标(agent 跨 turn 工作直到完成)
                     sub: status, pause, resume, clear
/redraw              强制刷新 UI(CLI)

配置

复制代码
/config              显示配置(CLI)
/model [name]        显示或切换模型
/personality [name]  设定 personality
/reasoning [level]   none|minimal|low|medium|high|xhigh|show|hide
/verbose             off → new → all → verbose
/voice [on|off|tts]  voice 模式
/yolo                切换 approval bypass
/busy [sub]          控制 Enter 行为(queue, steer, interrupt, status)
/indicator [style]   选 busy-indicator(kaomoji, emoji, unicode, ascii)
/footer [on|off]     gateway 元数据 footer
/skin [name]         改主题(CLI)
/statusbar           切换状态栏

Tools & Skills

复制代码
/tools               管理工具(CLI)
/toolsets            列出 toolset(CLI)
/skills              搜索/安装 skills(CLI)
/skill <name>        加载 skill 到 session
/reload-skills       重新扫描 ~/.hermes/skills/
/reload              重载 .env(CLI)
/reload-mcp          重载 MCP servers
/cron                管理 cron jobs(CLI)
/curator [sub]       后台 skill 维护(status, run, pin, archive, ...)
/kanban [sub]        多 profile 协作看板(tasks, links, comments)
/plugins             列出插件(CLI)

Gateway

复制代码
/approve             批准待执行的命令
/deny                拒绝
/restart             重启 gateway
/sethome             当前 chat 设为 home channel
/update              更新 gateway
/topic [sub]         Telegram DM topic session
/platforms (/gateway) 看平台连接状态

Utility

复制代码
/branch (/fork)      分叉当前 session
/fast                切换 priority/fast
/browser             开 CDP 浏览器
/history             历史(CLI)
/save                保存对话到文件(CLI)
/copy [N]            复制最后一条到剪贴板
/paste               附剪贴板图片
/image               附本地图片

Info

复制代码
/help                命令列表
/commands [page]     浏览命令
/usage               token 用量
/insights [days]     分析
/gquota              Gemini 配额
/status              session 信息
/profile             当前 profile
/debug               上传 debug 报告

Exit

复制代码
/quit (/exit, /q)    退出 CLI

解释: slash commands 是 in-session 的快捷操作。/goal 是 Hermes 独有 --- 设定目标后 agent 跨多个 turn 工作直到完成(适合长任务)。


8. 派生 Agent 实例

8.1 vs delegate_task 的选择

delegate_task Spawn hermes process
隔离 独立对话,共享 process 完全独立 process
时长 分钟级 小时/天
工具 父 agent 工具的子集 完整工具
交互 是(PTY)
场景 快速并行子任务 长自主任务

8.2 One-shot 模式

bash 复制代码
# 前台跑
terminal(command="hermes chat -q 'Research GRPO papers and write to ~/research/grpo.md'", timeout=300)

# 后台跑(不阻塞当前 turn)
terminal(command="hermes chat -q 'Set up CI/CD for ~/myapp'", background=true)

8.3 Interactive PTY 模式(用 tmux)

bash 复制代码
# 启动派生 agent
terminal(command="tmux new-session -d -s agent1 -x 120 -y 40 'hermes'", timeout=10)

# 等启动完后发消息
terminal(command="sleep 8 && tmux send-keys -t agent1 'Build a FastAPI auth service' Enter", timeout=15)

# 读输出
terminal(command="sleep 20 && tmux capture-pane -t agent1 -p", timeout=5)

# 后续指令
terminal(command="tmux send-keys -t agent1 'Add rate limiting middleware' Enter", timeout=5)

# 退出
terminal(command="tmux send-keys -t agent1 '/exit' Enter && sleep 2 && tmux kill-session -t agent1", timeout=10)

8.4 多 Agent 协调

bash 复制代码
# Agent A
terminal(command="tmux new-session -d -s backend -x 120 -y 40 'hermes -w'", timeout=10)
terminal(command="sleep 8 && tmux send-keys -t backend 'Build REST API for user management' Enter", timeout=15)

# Agent B(同时跑)
terminal(command="tmux new-session -d -s frontend -x 120 -y 40 'hermes -w'", timeout=10)
terminal(command="sleep 8 && tmux send-keys -t frontend 'Build React dashboard' Enter", timeout=15)

# 互相传递上下文
terminal(command="tmux capture-pane -t backend -p | tail -30", timeout=5)
terminal(command="tmux send-keys -t frontend 'Here is the API schema from backend: ...' Enter", timeout=5)

8.5 Session Resume

bash 复制代码
# 恢复最近 session
terminal(command="tmux new-session -d -s resumed 'hermes --continue'", timeout=10)

# 恢复指定 session
terminal(command="tmux new-session -d -s resumed 'hermes --resume 20260225_143052_a1b2c3'", timeout=10)

8.6 派生参数

bash 复制代码
# -w (worktree) --- 隔离 git 改动
hermes -w chat -q "Add OAuth"

# -p (profile) --- 用指定 profile
hermes -p myproject chat -q "..."

# 预加载 skills
hermes -s "kimi-model-setup,plan" chat -q "Build a CLI tool"

# 传 session ID 给后续 system prompt
hermes --pass-session-id chat -q "..."

解释: -w 防止多 agent 在同一 git 仓库改文件冲突。-p 切换 profile(独立 config/skills/memory)。-s 预加载 skills(跳过自动触发)。


9. Durable & Background Systems

四个"持久化"系统:subagent 派生、cron、curator、kanban。

9.1 Delegation (delegate_task)

bash 复制代码
# 通过 LLM 工具调用(不是 CLI)
# 实际是 in-session 调:
delegate_task(goal="...", context={...}, toolsets=[...])
delegate_task(tasks=[{goal:...}, {goal:...}], ...)   # 并行

配置:

yaml 复制代码
delegation:
  model: kimi-k2.6
  provider: kimi-coding-cn
  max_iterations: 50
  reasoning_effort: medium
  max_concurrent_children: 3    # 并行上限
  max_spawn_depth: 1           # 不允许嵌套

不持久: 父 agent 中断时子任务被取消。需要持久化用 cronjobterminal(background=true, notify_on_complete=true)

9.2 Cron(持久化调度)

bash 复制代码
hermes cron create "0 9 * * *" \
  --prompt "Daily report" \
  --skills report-aggregator \
  --deliver telegram \
  --deliver-extra chat_id=-1001234567890

支持的 schedule 格式:

  • "30m", "2h" --- 持续时间
  • "every monday 9am" --- 自然语言
  • "0 9 * * *" --- 5-field cron
  • "2026-07-01T09:00:00" --- ISO 时间戳

不变量:

  • 每次 run 3 分钟硬中断
  • .tick.lock 防多 process 重复 tick
  • cron session 默认 skip_memory=True
  • 投递用 header/footer 框架,不污染目标 session

9.3 Curator(skill 生命周期)

bash 复制代码
hermes curator status
hermes curator run                  # 立即跑维护
hermes curator pause
hermes curator resume
hermes curator pin <skill>         # 钉住 = 不会被自动归档
hermes curator unpin <skill>
hermes curator archive <skill>     # 归档(不删除)
hermes curator restore <skill>
hermes curator prune
hermes curator backup
hermes curator rollback

作用: 后台维护 agent 创建的 skill。追踪使用率、标记 idle skill 为 stale、归档 stale。created_by: "agent" 的 skill 才会被 curator 处理(in-repo + hub-installed 不动)。不删除,最大动作是 archive。

遥测: ~/.hermes/skills/.usage.json 记录 use_count/view_count/last_activity_at/state/pinned

配置:

yaml 复制代码
curator:
  enabled: true
  interval_hours: 24
  min_idle_hours: 72
  stale_after_days: 30
  archive_after_days: 90
  backup:
    enabled: true
    keep: 5

9.4 Kanban(多 Agent 协作)

bash 复制代码
hermes kanban init
hermes kanban create "Implement X" --assign backend
hermes kanban list                  # 别名 ls
hermes kanban show <id>
hermes kanban assign <id> frontend
hermes kanban link <id> <other-id>  # 任务间链接
hermes kanban comment <id> "..."
hermes kanban complete <id>
hermes kanban block <id> "等待 Y"
hermes kanban unblock <id>
hermes kanban archive <id>
hermes kanban tail <id>             # 跟 log

hermes kanban watch                 # 实时
hermes kanban stats
hermes kanban runs
hermes kanban log <run-id>
hermes kanban dispatch              # 启动 dispatcher
hermes kanban daemon                # 后台跑 dispatcher
hermes kanban gc                    # 清理

特性:

  • 持久化 SQLite board
  • Dispatcher 自动 reclaim stale claims、原子认领任务、spawn 派给 profile
  • failure_limit 次连续失败后自动 block task
  • Worker 通过 kanban_* toolset 交互(被 HERMES_KANBAN_TASK env gate)
  • Board 是隔离边界,tenant 是 workspace-path + memory-key 隔离

10. Voice & Transcription

10.1 STT(语音 → 文本)

bash 复制代码
# 自动转录(无需命令)--- gateway 收到 voice message 自动转
# 配置 provider:
hermes config set stt.enabled true
hermes config set stt.provider groq     # local / groq / openai / mistral
hermes config set GROQ_API_KEY ***      # free tier

优先级(自动检测):

  1. Local faster-whisper --- 免费:pip install faster-whisper
  2. Groq Whisper --- 免费 tier
  3. OpenAI Whisper --- 付费
  4. Mistral Voxtral --- 付费
yaml 复制代码
stt:
  enabled: true
  provider: local
  local:
    model: base       # tiny/base/small/medium/large-v3

10.2 TTS(文本 → 语音)

Provider Env Var Free?
Edge TTS (none) ✓ 默认
ElevenLabs ELEVENLABS_API_KEY Free tier
OpenAI VOICE_TOOLS_OPENAI_KEY 付费
MiniMax MINIMAX_API_KEY 付费
Mistral Voxtral MISTRAL_API_KEY 付费
NeuTTS (local) 无(pip install neutts[all] ✓ Free

用法:

  • /voice on --- voice-to-voice 模式
  • /voice tts --- 总是用 voice
  • /voice off --- 关闭

11. 安全与隐私开关

11.1 Secret Redaction

bash 复制代码
hermes config set security.redact_secrets true       # 默认开
hermes config set security.redact_secrets false      # 调试用

重要: redact_secrets 在启动时 snapshot,session 中改不生效。要重启 Hermes。

效果: tool output (terminal/read_file/web/subagent) 自动 scan 看起来像 API key/token 的字符串再进 context。

11.2 PII Redaction(Gateway)

bash 复制代码
hermes config set privacy.redact_pii true    # 开启
hermes config set privacy.redact_pii false   # 默认关

效果: Gateway 哈希 user ID,剥电话号码后再喂给 model。

11.3 Command Approvals

bash 复制代码
hermes config set approvals.mode manual      # 默认:每次危险命令都问
hermes config set approvals.mode smart       # 推荐:LLM 判风险
hermes config set approvals.mode off         # 全跳过
hermes --yolo                               # 单次 bypass
export HERMES_YOLO_MODE=1                   # 临时开

不变量: YOLO 不关 secret redaction(独立机制)。

11.4 Shell Hooks Allowlist

bash 复制代码
# 首次跑会交互式询问
# 手动管理:
~/.hermes/shell-hooks-allowlist.json

解释: Shell hook 是触发器(pre/post command),需明确 allowlist 后才执行。

11.5 禁用网络/媒体工具

bash 复制代码
hermes tools                             # curses UI 切换
# 改动需新 session(/reset)生效

12. 配置章节详解

~/.hermes/config.yaml 的所有顶层 section:

Section 关键 keys 作用
model default, provider, base_url, api_key, context_length LLM 配置
agent max_turns (90), tool_use_enforcement 主循环
terminal backend (local/docker/ssh/modal), cwd, timeout (180) 命令执行
compression enabled, threshold (0.50), target_ratio (0.20) Context 压缩
display skin, tool_progress, show_reasoning, show_cost UI
stt enabled, provider (local/groq/openai/mistral) 语音转文本
tts provider (edge/elevenlabs/openai/MiniMax/mistral/neutts) 文本转语音
memory memory_enabled, user_profile_enabled, provider 跨 session 内存
security tirith_enabled, website_blocklist, redact_secrets 安全
delegation model, provider, max_iterations (50), max_concurrent_children (3) subagent
checkpoints enabled, max_snapshots (50) filesystem 快照
curator enabled, interval_hours (24), stale_after_days (30) skill 维护
auxiliary vision, compression, title_generation 各自的 provider 辅助模型

Toolsets(按需启用)

bash 复制代码
hermes tools enable NAME
hermes tools disable NAME

完整列表(toolsets.py::_HERMES_CORE_TOOLS):

Toolset 用途
web Web 搜索 + 内容提取
search 仅搜索(web 子集)
browser 浏览器自动化(Browserbase/Camofox/local Chromium)
terminal Shell 命令
file 读/写/搜索/patch
code_execution 沙箱 Python
vision 图像分析
image_gen AI 图像生成
video 视频分析/生成
tts TTS
skills skill 浏览/管理
memory 内存
session_search 搜历史对话
delegation subagent
cronjob cron
clarify 问用户澄清
messaging 跨平台消息
todo session 内 todo
kanban 多 agent 看板(worker 默认 gate)
debugging 调试(默认关)
safe 低风险 toolset
spotify Spotify
homeassistant 智能家居(默认关)
discord / discord_admin Discord
feishu_doc / feishu_drive 飞书
yuanbao 元宝
rl 强化学习(默认关)
moa Mixture of Agents(默认关)

注意: toolset 改动需要 /reset 新 session 才生效(避免破坏 prompt cache)。


路径速查

用途 路径
配置 ~/.hermes/config.yaml
环境变量 ~/.hermes/.env
认证 ~/.hermes/auth.json
会话存储 ~/.hermes/state.db (SQLite + FTS5)
Gateway 日志 ~/.hermes/logs/gateway.log
Skills 根 ~/.hermes/skills/<cat>/<name>/
Profile skills ~/.hermes/profiles/<name>/skills/...
Profile config ~/.hermes/profiles/<name>/config.yaml
Skill 使用遥测 ~/.hermes/skills/.usage.json
Shell hooks 允许列表 ~/.hermes/shell-hooks-allowlist.json
源码(git 安装) ~/.hermes/hermes-agent/

相关 Skills

  • hermes-agent --- 完整参考(本文档是浓缩)
  • kimi-model-setup --- Kimi/MiniMax 配置
  • hermes-agent-skill-authoring --- 写 SKILL.md 规范
  • skill-invocation --- 何时加载哪个 skill
  • hermes-webhook-integration --- Webhook 集成

生成时间: 2026-06-05

来源: Hermes Agent 官方文档 + 实际使用经验

对应文档: hermes-commands-cheatsheet.md(常用命令)

相关推荐
j_xxx404_1 小时前
MySQL表操作硬核解析:从 CREATE TABLE 到磁盘文件、ALTER TABLE 与 DDL 风险
运维·服务器·数据库·c++·mysql·adb·ai
大模型真好玩1 小时前
智能体从入门到精通:6个必学GitHub开源项目
人工智能·agent·deepseek
Jackeyzhe2 小时前
让 3 个 AI 一起写公众号:一篇 Hermes 多 Agent 实操
ai
阿里云云原生3 小时前
AI Agent 资源利用率瓶颈如何破?AI 任务调度 + Sandbox 实现动态休眠与唤醒
agent
MELF晓宇3 小时前
多模态向量对齐:从 Embedding 到多模态大模型
llm·agent
AI导出鸭PC端3 小时前
智谱清言怎么生成word文档?AI导出鸭终结乱码烦恼
人工智能·ai·c#·word·豆包·ai导出鸭
leeyi3 小时前
Graph 编排:不只是 ReAct 的通用 DAG
react native·agent·graphql
iChochy3 小时前
通过 ZenMux 使用 Claude Code CLI 解锁更多 AI 模型,包括 Claude 所有模型
ai·claude
Nile3 小时前
Claude Code-Dynamic Workflows:1.为什么用工作流?
人工智能·ai·ai编程·ai-native