hermes-agent

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Hermes Agent

Hermes Agent

Hermes Agent is an open-source AI agent framework by Nous Research that runs in your terminal, messaging platforms, and IDEs. It belongs to the same category as Claude Code (Anthropic), Codex (OpenAI), and OpenClaw — autonomous coding and task-execution agents that use tool calling to interact with your system. Hermes works with any LLM provider (OpenRouter, Anthropic, OpenAI, DeepSeek, local models, and 15+ others) and runs on Linux, macOS, and WSL.
What makes Hermes different:
  • Self-improving through skills — Hermes learns from experience by saving reusable procedures as skills. When it solves a complex problem, discovers a workflow, or gets corrected, it can persist that knowledge as a skill document that loads into future sessions. Skills accumulate over time, making the agent better at your specific tasks and environment.
  • Persistent memory across sessions — remembers who you are, your preferences, environment details, and lessons learned. Pluggable memory backends (built-in, Honcho, Mem0, and more) let you choose how memory works.
  • Multi-platform gateway — the same agent runs on Telegram, Discord, Slack, WhatsApp, Signal, Matrix, Email, and 10+ other platforms with full tool access, not just chat.
  • Provider-agnostic — swap models and providers mid-workflow without changing anything else. Credential pools rotate across multiple API keys automatically.
  • Profiles — run multiple independent Hermes instances with isolated configs, sessions, skills, and memory.
  • Extensible — plugins, MCP servers, custom tools, webhook triggers, cron scheduling, and the full Python ecosystem.
People use Hermes for software development, research, system administration, data analysis, content creation, home automation, and anything else that benefits from an AI agent with persistent context and full system access.
This skill helps you work with Hermes Agent effectively — setting it up, configuring features, spawning additional agent instances, troubleshooting issues, finding the right commands and settings, and understanding how the system works when you need to extend or contribute to it.
Hermes Agent是Nous Research开发的开源AI Agent框架,可在终端、消息平台和IDE中运行。它与Claude Code(Anthropic)、Codex(OpenAI)和OpenClaw属于同一类别——这类自主编码和任务执行Agent通过调用工具与系统交互。Hermes兼容所有LLM提供商(OpenRouter、Anthropic、OpenAI、DeepSeek、本地模型及其他15+提供商),可在Linux、macOS和WSL上运行。
Hermes的独特之处:
  • 通过技能实现自我提升 —— Hermes会将可复用流程保存为技能,从经验中学习。当它解决复杂问题、发现工作流或得到修正时,可将该知识保存为技能文档,供后续会话加载。技能会随时间积累,让Agent在你的特定任务和环境中表现更出色。
  • 跨会话持久化记忆 —— 记住你的身份、偏好、环境细节和所学经验。可插拔的记忆后端(内置、Honcho、Mem0等)让你选择记忆的运作方式。
  • 多平台网关 —— 同一Agent可在Telegram、Discord、Slack、WhatsApp、Signal、Matrix、Email及其他10+平台上运行,且完全支持工具调用,不局限于聊天功能。
  • 提供商无关性 —— 在工作流中切换模型和提供商,无需修改其他内容。凭证池会自动轮换多个API密钥。
  • 配置文件 —— 运行多个独立的Hermes实例,每个实例都有独立的配置、会话、技能和记忆。
  • 可扩展性 —— 支持插件、MCP服务器、自定义工具、Webhook触发器、定时任务调度,以及完整的Python生态系统。
人们使用Hermes进行软件开发、研究、系统管理、数据分析、内容创作、家庭自动化,以及任何需要具备持久上下文和完整系统访问权限的AI Agent的场景。
本技能帮助你高效使用Hermes Agent —— 包括设置、配置功能、生成额外Agent实例、排查问题、找到合适的命令和设置,以及在需要扩展或贡献代码时理解系统的工作原理。

Quick Start

快速开始

bash
undefined
bash
undefined

Install

安装

Interactive chat (default)

交互式聊天(默认)

hermes
hermes

Single query

单次查询

hermes chat -q "What is the capital of France?"
hermes chat -q "法国的首都是什么?"

Setup wizard

设置向导

hermes setup
hermes setup

Change model/provider

切换模型/提供商

hermes model
hermes model

Check health

检查健康状态

hermes doctor

---
hermes doctor

---

CLI Reference

CLI参考

Global Flags

全局标志

hermes [flags] [command]

  --version, -V             Show version
  --resume, -r SESSION      Resume session by ID or title
  --continue, -c [NAME]     Resume by name, or most recent session
  --worktree, -w            Isolated git worktree mode (parallel agents)
  --skills, -s SKILL        Preload skills (comma-separate or repeat)
  --profile, -p NAME        Use a named profile
  --yolo                    Skip dangerous command approval
  --pass-session-id         Include session ID in system prompt
No subcommand defaults to
chat
.
hermes [flags] [command]

  --version, -V             显示版本
  --resume, -r SESSION      通过ID或标题恢复会话
  --continue, -c [NAME]     通过名称恢复会话,或恢复最近的会话
  --worktree, -w            独立Git工作树模式(并行Agent)
  --skills, -s SKILL        预加载技能(逗号分隔或重复指定)
  --profile, -p NAME        使用指定名称的配置文件
  --yolo                    跳过危险命令确认
  --pass-session-id         在系统提示中包含会话ID
未指定子命令时默认执行
chat

Chat

聊天

hermes chat [flags]
  -q, --query TEXT          Single query, non-interactive
  -m, --model MODEL         Model (e.g. anthropic/claude-sonnet-4)
  -t, --toolsets LIST       Comma-separated toolsets
  --provider PROVIDER       Force provider (openrouter, anthropic, nous, etc.)
  -v, --verbose             Verbose output
  -Q, --quiet               Suppress banner, spinner, tool previews
  --checkpoints             Enable filesystem checkpoints (/rollback)
  --source TAG              Session source tag (default: cli)
hermes chat [flags]
  -q, --query TEXT          单次查询,非交互式
  -m, --model MODEL         模型(例如 anthropic/claude-sonnet-4)
  -t, --toolsets LIST       逗号分隔的工具集
  --provider PROVIDER       强制指定提供商(openrouter、anthropic、nous等)
  -v, --verbose             详细输出
  -Q, --quiet               隐藏横幅、加载动画、工具预览
  --checkpoints             启用文件系统检查点(/rollback)
  --source TAG              会话来源标签(默认:cli)

Configuration

配置

hermes setup [section]      Interactive wizard (model|terminal|gateway|tools|agent)
hermes model                Interactive model/provider picker
hermes config               View current config
hermes config edit          Open config.yaml in $EDITOR
hermes config set KEY VAL   Set a config value
hermes config path          Print config.yaml path
hermes config env-path      Print .env path
hermes config check         Check for missing/outdated config
hermes config migrate       Update config with new options
hermes auth                 Interactive credential manager
hermes auth add PROVIDER    Add OAuth or API-key credential (e.g. nous, openai-codex, qwen-oauth)
hermes auth list            List stored credentials
hermes auth remove PROVIDER Remove a stored credential
hermes doctor [--fix]       Check dependencies and config
hermes status [--all]       Show component status
hermes setup [section]      交互式向导(model|terminal|gateway|tools|agent)
hermes model                交互式模型/提供商选择器
hermes config               查看当前配置
hermes config edit          在$EDITOR中打开config.yaml
hermes config set KEY VAL   设置配置值
hermes config path          打印config.yaml路径
hermes config env-path      打印.env路径
hermes config check         检查缺失/过时的配置
hermes config migrate       更新配置以添加新选项
hermes auth                 交互式凭证管理器
hermes auth add PROVIDER    添加OAuth或API密钥凭证(例如 nous、openai-codex、qwen-oauth)
hermes auth list            列出已存储的凭证
hermes auth remove PROVIDER 删除已存储的凭证
hermes doctor [--fix]       检查依赖项和配置
hermes status [--all]       显示组件状态

Tools & Skills

工具与技能

hermes tools                Interactive tool enable/disable (curses UI)
hermes tools list           Show all tools and status
hermes tools enable NAME    Enable a toolset
hermes tools disable NAME   Disable a toolset

hermes skills list          List installed skills
hermes skills search QUERY  Search the skills hub
hermes skills install ID    Install a skill (ID can be a hub identifier OR a direct https://…/SKILL.md URL; pass --name to override when frontmatter has no name)
hermes skills inspect ID    Preview without installing
hermes skills config        Enable/disable skills per platform
hermes skills check         Check for updates
hermes skills update        Update outdated skills
hermes skills uninstall N   Remove a hub skill
hermes skills publish PATH  Publish to registry
hermes skills browse        Browse all available skills
hermes skills tap add REPO  Add a GitHub repo as skill source
hermes tools                交互式工具启用/禁用(curses UI)
hermes tools list           显示所有工具及其状态
hermes tools enable NAME    启用工具集
hermes tools disable NAME   禁用工具集

hermes skills list          列出已安装的技能
hermes skills search QUERY  搜索技能中心
hermes skills install ID    安装技能(ID可以是中心标识符或直接的https://…/SKILL.md URL;当前置元数据无名称时,传入--name覆盖)
hermes skills inspect ID    预览技能而不安装
hermes skills config        按平台启用/禁用技能
hermes skills check         检查更新
hermes skills update        更新过时的技能
hermes skills uninstall N   删除中心技能
hermes skills publish PATH  发布到注册表
hermes skills browse        浏览所有可用技能
hermes skills tap add REPO  添加GitHub仓库作为技能源

MCP Servers

MCP服务器

hermes mcp serve            Run Hermes as an MCP server
hermes mcp add NAME         Add an MCP server (--url or --command)
hermes mcp remove NAME      Remove an MCP server
hermes mcp list             List configured servers
hermes mcp test NAME        Test connection
hermes mcp configure NAME   Toggle tool selection
hermes mcp serve            将Hermes作为MCP服务器运行
hermes mcp add NAME         添加MCP服务器(--url或--command)
hermes mcp remove NAME      删除MCP服务器
hermes mcp list             列出已配置的服务器
hermes mcp test NAME        测试连接
hermes mcp configure NAME   切换工具选择

Gateway (Messaging Platforms)

网关(消息平台)

hermes gateway run          Start gateway foreground
hermes gateway install      Install as background service
hermes gateway start/stop   Control the service
hermes gateway restart      Restart the service
hermes gateway status       Check status
hermes gateway setup        Configure platforms
Supported platforms: Telegram, Discord, Slack, WhatsApp, Signal, Email, SMS, Matrix, Mattermost, Home Assistant, DingTalk, Feishu, WeCom, BlueBubbles (iMessage), Weixin (WeChat), API Server, Webhooks. Open WebUI connects via the API Server adapter.
hermes gateway run          前台启动网关
hermes gateway install      安装为后台服务
hermes gateway start/stop   控制服务
hermes gateway restart      重启服务
hermes gateway status       检查状态
hermes gateway setup        配置平台
支持的平台:Telegram、Discord、Slack、WhatsApp、Signal、Email、SMS、Matrix、Mattermost、Home Assistant、钉钉、飞书、企业微信、BlueBubbles(iMessage)、微信、API Server、Webhooks。Open WebUI通过API Server适配器连接。

Sessions

会话

hermes sessions list        List recent sessions
hermes sessions browse      Interactive picker
hermes sessions export OUT  Export to JSONL
hermes sessions rename ID T Rename a session
hermes sessions delete ID   Delete a session
hermes sessions prune       Clean up old sessions (--older-than N days)
hermes sessions stats       Session store statistics
hermes sessions list        列出最近的会话
hermes sessions browse      交互式选择器
hermes sessions export OUT  导出为JSONL
hermes sessions rename ID T 重命名会话
hermes sessions delete ID   删除会话
hermes sessions prune       清理旧会话(--older-than N days)
hermes sessions stats       会话存储统计信息

Cron Jobs

定时任务

hermes cron list            List jobs (--all for disabled)
hermes cron create SCHED    Create: '30m', 'every 2h', '0 9 * * *'
hermes cron edit ID         Edit schedule, prompt, delivery
hermes cron pause/resume ID Control job state
hermes cron run ID          Trigger on next tick
hermes cron remove ID       Delete a job
hermes cron status          Scheduler status
hermes cron list            列出任务(--all显示已禁用的任务)
hermes cron create SCHED    创建任务:'30m'、'every 2h'、'0 9 * * *'
hermes cron edit ID         编辑调度、提示、交付方式
hermes cron pause/resume ID 控制任务状态
hermes cron run ID          在下一个触发点执行任务
hermes cron remove ID       删除任务
hermes cron status          调度器状态

Webhooks

Webhooks

hermes webhook subscribe N  Create route at /webhooks/<name>
hermes webhook list         List subscriptions
hermes webhook remove NAME  Remove a subscription
hermes webhook test NAME    Send a test POST
hermes webhook subscribe N  在/webhooks/<name>创建路由
hermes webhook list         列出订阅
hermes webhook remove NAME  删除订阅
hermes webhook test NAME    发送测试POST请求

Profiles

配置文件

hermes profile list         List all profiles
hermes profile create NAME  Create (--clone, --clone-all, --clone-from)
hermes profile use NAME     Set sticky default
hermes profile delete NAME  Delete a profile
hermes profile show NAME    Show details
hermes profile alias NAME   Manage wrapper scripts
hermes profile rename A B   Rename a profile
hermes profile export NAME  Export to tar.gz
hermes profile import FILE  Import from archive
hermes profile list         列出所有配置文件
hermes profile create NAME  创建配置文件(--clone、--clone-all、--clone-from)
hermes profile use NAME     设置默认配置文件
hermes profile delete NAME  删除配置文件
hermes profile show NAME    显示详细信息
hermes profile alias NAME   管理包装脚本
hermes profile rename A B   重命名配置文件
hermes profile export NAME  导出为tar.gz
hermes profile import FILE  从归档导入

Credential Pools

凭证池

hermes auth add             Interactive credential wizard
hermes auth list [PROVIDER] List pooled credentials
hermes auth remove P INDEX  Remove by provider + index
hermes auth reset PROVIDER  Clear exhaustion status
hermes auth add             交互式凭证向导
hermes auth list [PROVIDER] 列出池化凭证
hermes auth remove P INDEX  按提供商+索引删除
hermes auth reset PROVIDER  清除耗尽状态

Other

其他

hermes insights [--days N]  Usage analytics
hermes update               Update to latest version
hermes pairing list/approve/revoke  DM authorization
hermes plugins list/install/remove  Plugin management
hermes honcho setup/status  Honcho memory integration (requires honcho plugin)
hermes memory setup/status/off  Memory provider config
hermes completion bash|zsh  Shell completions
hermes acp                  ACP server (IDE integration)
hermes claw migrate         Migrate from OpenClaw
hermes uninstall            Uninstall Hermes

hermes insights [--days N]  使用分析
hermes update               更新到最新版本
hermes pairing list/approve/revoke  DM授权
hermes plugins list/install/remove  插件管理
hermes honcho setup/status  Honcho记忆集成(需要honcho插件)
hermes memory setup/status/off  记忆提供商配置
hermes completion bash|zsh  Shell补全
hermes acp                  ACP服务器(IDE集成)
hermes claw migrate         从OpenClaw迁移
hermes uninstall            卸载Hermes

Slash Commands (In-Session)

会话内斜杠命令

Type these during an interactive chat session. New commands land fairly often; if something below looks stale, run
/help
in-session for the authoritative list or see the live slash commands reference. The registry of record is
hermes_cli/commands.py
— every consumer (autocomplete, Telegram menu, Slack mapping,
/help
) derives from it.
在交互式聊天会话中输入这些命令。新命令会频繁更新;如果以下内容看起来过时,可在会话中运行
/help
获取权威列表,或查看实时斜杠命令参考。记录的注册表是
hermes_cli/commands.py
——所有消费端(自动补全、Telegram菜单、Slack映射、
/help
)均从中派生。

Session Control

会话控制

/new (/reset)        Fresh session
/clear               Clear screen + new session (CLI)
/retry               Resend last message
/undo                Remove last exchange
/title [name]        Name the session
/compress            Manually compress context
/stop                Kill background processes
/rollback [N]        Restore filesystem checkpoint
/snapshot [sub]      Create or restore state snapshots of Hermes config/state (CLI)
/background <prompt> Run prompt in background
/queue <prompt>      Queue for next turn
/steer <prompt>      Inject a message after the next tool call without interrupting
/agents (/tasks)     Show active agents and running tasks
/resume [name]       Resume a named session
/goal [text|sub]     Set a standing goal Hermes works on across turns until achieved
                     (subcommands: status, pause, resume, clear)
/redraw              Force a full UI repaint (CLI)
/new (/reset)        新会话
/clear               清屏并开启新会话(CLI)
/retry               重新发送最后一条消息
/undo                删除最后一次对话
/title [name]        为会话命名
/compress            手动压缩上下文
/stop                终止后台进程
/rollback [N]        恢复文件系统检查点
/snapshot [sub]      创建或恢复Hermes配置/状态快照(CLI)
/background <prompt> 在后台运行提示
/queue <prompt>      加入下一轮队列
/steer <prompt>      在下次工具调用后注入消息,不中断会话
/agents (/tasks)     显示活跃Agent和运行中的任务
/resume [name]       恢复指定名称的会话
/goal [text|sub]     设置Hermes在多轮对话中持续执行的目标,直至完成
                     (子命令:status、pause、resume、clear)
/redraw              强制重新绘制完整UI(CLI)

Configuration

配置

/config              Show config (CLI)
/model [name]        Show or change model
/personality [name]  Set personality
/reasoning [level]   Set reasoning (none|minimal|low|medium|high|xhigh|show|hide)
/verbose             Cycle: off → new → all → verbose
/voice [on|off|tts]  Voice mode
/yolo                Toggle approval bypass
/busy [sub]          Control what Enter does while Hermes is working (CLI)
                     (subcommands: queue, steer, interrupt, status)
/indicator [style]   Pick the TUI busy-indicator style (CLI)
                     (styles: kaomoji, emoji, unicode, ascii)
/footer [on|off]     Toggle gateway runtime-metadata footer on final replies
/skin [name]         Change theme (CLI)
/statusbar           Toggle status bar (CLI)
/config              查看配置(CLI)
/model [name]        查看或切换模型
/personality [name]  设置个性
/reasoning [level]   设置推理级别(none|minimal|low|medium|high|xhigh|show|hide)
/verbose             循环切换:off → new → all → verbose
/voice [on|off|tts]  语音模式
/yolo                切换是否跳过确认
/busy [sub]          控制Hermes工作时Enter键的行为(CLI)
                     (子命令:queue、steer、interrupt、status)
/indicator [style]   选择TUI忙碌指示器样式(CLI)
                     (样式:kaomoji、emoji、unicode、ascii)
/footer [on|off]     在最终回复中切换网关运行元数据页脚
/skin [name]         更改主题(CLI)
/statusbar           切换状态栏(CLI)

Tools & Skills

工具与技能

/tools               Manage tools (CLI)
/toolsets            List toolsets (CLI)
/skills              Search/install skills (CLI)
/skill <name>        Load a skill into session
/reload-skills       Re-scan ~/.hermes/skills/ for added/removed skills
/reload              Reload .env variables into the running session (CLI)
/reload-mcp          Reload MCP servers
/cron                Manage cron jobs (CLI)
/curator [sub]       Background skill maintenance (status, run, pin, archive, …)
/kanban [sub]        Multi-profile collaboration board (tasks, links, comments)
/plugins             List plugins (CLI)
/tools               管理工具(CLI)
/toolsets            列出工具集(CLI)
/skills              搜索/安装技能(CLI)
/skill <name>        将技能加载到会话
/reload-skills       重新扫描~/.hermes/skills/以检测添加/删除的技能
/reload              将.env变量重新加载到运行中的会话(CLI)
/reload-mcp          重新加载MCP服务器
/cron                管理定时任务(CLI)
/curator [sub]       后台技能维护(status、run、pin、archive等)
/kanban [sub]        多配置文件协作看板(tasks、links、comments)
/plugins             列出插件(CLI)

Gateway

网关

/approve             Approve a pending command (gateway)
/deny                Deny a pending command (gateway)
/restart             Restart gateway (gateway)
/sethome             Set current chat as home channel (gateway)
/update              Update Hermes to latest (gateway)
/topic [sub]         Enable or inspect Telegram DM topic sessions (gateway)
/platforms (/gateway) Show platform connection status (gateway)
/approve             批准待处理命令(网关)
/deny                拒绝待处理命令(网关)
/restart             重启网关(网关)
/sethome             将当前聊天设置为主频道(网关)
/update              将Hermes更新到最新版本(网关)
/topic [sub]         启用或查看Telegram DM主题会话(网关)
/platforms (/gateway) 显示平台连接状态(网关)

Utility

实用工具

/branch (/fork)      Branch the current session
/fast                Toggle priority/fast processing
/browser             Open CDP browser connection
/history             Show conversation history (CLI)
/save                Save conversation to file (CLI)
/copy [N]            Copy the last assistant response to clipboard (CLI)
/paste               Attach clipboard image (CLI)
/image               Attach local image file (CLI)
/branch (/fork)      分支当前会话
/fast                切换优先级/快速处理
/browser             打开CDP浏览器连接
/history             显示对话历史(CLI)
/save                将对话保存到文件(CLI)
/copy [N]            将最后N条助手回复复制到剪贴板(CLI)
/paste               粘贴剪贴板图片(CLI)
/image               附加本地图片文件(CLI)

Info

信息

/help                Show commands
/commands [page]     Browse all commands (gateway)
/usage               Token usage
/insights [days]     Usage analytics
/gquota              Show Google Gemini Code Assist quota usage (CLI)
/status              Session info (gateway)
/profile             Active profile info
/debug               Upload debug report (system info + logs) and get shareable links
/help                显示命令
/commands [page]     浏览所有命令(网关)
/usage               令牌使用情况
/insights [days]     使用分析
/gquota              显示Google Gemini Code Assist配额使用情况(CLI)
/status              会话信息(网关)
/profile             活跃配置文件信息
/debug               上传调试报告(系统信息+日志)并获取可分享链接

Exit

退出

/quit (/exit, /q)    Exit CLI

/quit (/exit, /q)    退出CLI

Key Paths & Config

关键路径与配置

~/.hermes/config.yaml       Main configuration
~/.hermes/.env              API keys and secrets
$HERMES_HOME/skills/        Installed skills
~/.hermes/sessions/         Gateway routing index, request dumps, *.jsonl transcripts (and optional per-session JSON snapshots when sessions.write_json_snapshots: true)
~/.hermes/state.db          Canonical session store (SQLite + FTS5)
~/.hermes/logs/             Gateway and error logs
~/.hermes/auth.json         OAuth tokens and credential pools
~/.hermes/hermes-agent/     Source code (if git-installed)
Profiles use
~/.hermes/profiles/<name>/
with the same layout.
~/.hermes/config.yaml       主配置文件
~/.hermes/.env              API密钥和机密
$HERMES_HOME/skills/        已安装的技能
~/.hermes/sessions/         网关路由索引、请求转储、*.jsonl转录(当sessions.write_json_snapshots: true时,可选包含每个会话的JSON快照)
~/.hermes/state.db          标准会话存储(SQLite + FTS5)
~/.hermes/logs/             网关和错误日志
~/.hermes/auth.json         OAuth令牌和凭证池
~/.hermes/hermes-agent/     源代码(如果通过git安装)
配置文件使用
~/.hermes/profiles/<name>/
,布局相同。

Config Sections

配置章节

Edit with
hermes config edit
or
hermes config set section.key value
.
SectionKey options
model
default
,
provider
,
base_url
,
api_key
,
context_length
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)
display
skin
,
tool_progress
,
show_reasoning
,
show_cost
stt
enabled
,
provider
(local/groq/openai/mistral)
tts
provider
(edge/elevenlabs/openai/minimax/mistral/neutts)
memory
memory_enabled
,
user_profile_enabled
,
provider
security
tirith_enabled
,
website_blocklist
delegation
model
,
provider
,
base_url
,
api_key
,
max_iterations
(50),
reasoning_effort
checkpoints
enabled
,
max_snapshots
(50)
使用
hermes config edit
hermes config set section.key value
编辑。
章节键选项
model
default
provider
base_url
api_key
context_length
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)
display
skin
tool_progress
show_reasoning
show_cost
stt
enabled
provider
(local/groq/openai/mistral)
tts
provider
(edge/elevenlabs/openai/minimax/mistral/neutts)
memory
memory_enabled
user_profile_enabled
provider
security
tirith_enabled
website_blocklist
delegation
model
provider
base_url
api_key
max_iterations
(50)、
reasoning_effort
checkpoints
enabled
max_snapshots
(50)

Providers

提供商

20+ providers supported. Set via
hermes model
or
hermes setup
.
ProviderAuthKey env var
OpenRouterAPI key
OPENROUTER_API_KEY
AnthropicAPI key
ANTHROPIC_API_KEY
Nous PortalOAuth
hermes auth
OpenAI CodexOAuth
hermes auth
GitHub CopilotToken
COPILOT_GITHUB_TOKEN
Google GeminiAPI key
GOOGLE_API_KEY
or
GEMINI_API_KEY
DeepSeekAPI key
DEEPSEEK_API_KEY
xAI / GrokAPI key
XAI_API_KEY
Hugging FaceToken
HF_TOKEN
Z.AI / GLMAPI key
GLM_API_KEY
MiniMaxAPI key
MINIMAX_API_KEY
MiniMax CNAPI key
MINIMAX_CN_API_KEY
Kimi / MoonshotAPI key
KIMI_API_KEY
Alibaba / DashScopeAPI key
DASHSCOPE_API_KEY
Xiaomi MiMoAPI key
XIAOMI_API_KEY
Kilo CodeAPI key
KILOCODE_API_KEY
OpenCode ZenAPI key
OPENCODE_ZEN_API_KEY
OpenCode GoAPI key
OPENCODE_GO_API_KEY
Qwen OAuthOAuth
hermes auth add qwen-oauth
Custom endpointConfig
model.base_url
+
model.api_key
in config.yaml
GitHub Copilot ACPExternal
COPILOT_CLI_PATH
or Copilot CLI
支持20+提供商。通过
hermes model
hermes setup
设置。
提供商认证方式密钥环境变量
OpenRouterAPI密钥
OPENROUTER_API_KEY
AnthropicAPI密钥
ANTHROPIC_API_KEY
Nous PortalOAuth
hermes auth
OpenAI CodexOAuth
hermes auth
GitHub Copilot令牌
COPILOT_GITHUB_TOKEN
Google GeminiAPI密钥
GOOGLE_API_KEY
GEMINI_API_KEY
DeepSeekAPI密钥
DEEPSEEK_API_KEY
xAI / GrokAPI密钥
XAI_API_KEY
Hugging Face令牌
HF_TOKEN
Z.AI / GLMAPI密钥
GLM_API_KEY
MiniMaxAPI密钥
MINIMAX_API_KEY
MiniMax CNAPI密钥
MINIMAX_CN_API_KEY
Kimi / MoonshotAPI密钥
KIMI_API_KEY
Alibaba / DashScopeAPI密钥
DASHSCOPE_API_KEY
Xiaomi MiMoAPI密钥
XIAOMI_API_KEY
Kilo CodeAPI密钥
KILOCODE_API_KEY
OpenCode ZenAPI密钥
OPENCODE_ZEN_API_KEY
OpenCode GoAPI密钥
OPENCODE_GO_API_KEY
Qwen OAuthOAuth
hermes auth add qwen-oauth
自定义端点配置
model.base_url
+
model.api_key
(在config.yaml中)
GitHub Copilot ACP外部
COPILOT_CLI_PATH
或Copilot CLI

Toolsets

工具集

Enable/disable via
hermes tools
(interactive) or
hermes tools enable/disable NAME
.
ToolsetWhat it provides
web
Web search and content extraction
search
Web search only (subset of
web
)
browser
Browser automation (Browserbase, Camofox, or local Chromium)
terminal
Shell commands and process management
file
File read/write/search/patch
code_execution
Sandboxed Python execution
vision
Image analysis
image_gen
AI image generation
video
Video analysis and generation
tts
Text-to-speech
skills
Skill browsing and management
memory
Persistent cross-session memory
session_search
Search past conversations
delegation
Subagent task delegation
cronjob
Scheduled task management
clarify
Ask user clarifying questions
messaging
Cross-platform message sending
todo
In-session task planning and tracking
kanban
Multi-agent work-queue tools (gated to workers)
debugging
Extra introspection/debug tools (off by default)
safe
Minimal, low-risk toolset for locked-down sessions
spotify
Spotify playback and playlist control
homeassistant
Smart home control (off by default)
discord
Discord integration tools
discord_admin
Discord admin/moderation tools
feishu_doc
Feishu (Lark) document tools
feishu_drive
Feishu (Lark) drive tools
yuanbao
Yuanbao integration tools
rl
Reinforcement learning tools (off by default)
moa
Mixture of Agents (off by default)
Full enumeration lives in
toolsets.py
as the
TOOLSETS
dict;
_HERMES_CORE_TOOLS
is the default bundle most platforms inherit from.
Tool changes take effect on
/reset
(new session). They do NOT apply mid-conversation to preserve prompt caching.

通过
hermes tools
(交互式)或
hermes tools enable/disable NAME
启用/禁用。
工具集提供的功能
web
网页搜索和内容提取
search
仅网页搜索(
web
的子集)
browser
浏览器自动化(Browserbase、Camofox或本地Chromium)
terminal
Shell命令和进程管理
file
文件读/写/搜索/补丁
code_execution
沙箱化Python执行
vision
图像分析
image_gen
AI图像生成
video
视频分析和生成
tts
文本转语音
skills
技能浏览和管理
memory
跨会话持久化记忆
session_search
搜索过往对话
delegation
子Agent任务委托
cronjob
定时任务管理
clarify
向用户询问澄清问题
messaging
跨平台消息发送
todo
会话内任务规划和跟踪
kanban
多Agent工作队列工具(仅限工作者)
debugging
额外的内省/调试工具(默认关闭)
safe
用于锁定会话的最小低风险工具集
spotify
Spotify播放和播放列表控制
homeassistant
智能家居控制(默认关闭)
discord
Discord集成工具
discord_admin
Discord管理/ moderation工具
feishu_doc
飞书文档工具
feishu_drive
飞书云盘工具
yuanbao
元宝集成工具
rl
强化学习工具(默认关闭)
moa
多Agent混合(默认关闭)
完整枚举在
toolsets.py
TOOLSETS
字典中;
_HERMES_CORE_TOOLS
是大多数平台继承的默认工具包。
工具更改在
/reset
(新会话)后生效。为了保留提示缓存,它们不会在对话中途应用。

Security & Privacy Toggles

安全与隐私开关

Common "why is Hermes doing X to my output / tool calls / commands?" toggles — and the exact commands to change them. Most of these need a fresh session (
/reset
in chat, or start a new
hermes
invocation) because they're read once at startup.
常见的“Hermes为什么对我的输出/工具调用/命令执行X操作?”开关——以及更改它们的确切命令。其中大多数需要新会话(聊天中输入
/reset
,或启动新的
hermes
进程),因为它们在启动时仅读取一次。

Secret redaction in tool output

工具输出中的机密脱敏

Secret redaction is on by default — tool output (terminal stdout,
read_file
, web content, subagent summaries, etc.) is scanned for strings that look like API keys, tokens, and secrets before it enters the conversation context and logs. Leave it enabled for normal use:
bash
hermes config set security.redact_secrets true       # keep enabled globally
Restart required.
security.redact_secrets
is snapshotted at import time — toggling it mid-session (e.g. via
export HERMES_REDACT_SECRETS=false
from a tool call) will NOT take effect for the running process. Tell the user to change it in config from a terminal, then start a new session. This is deliberate — it prevents an LLM from flipping the toggle on itself mid-task.
Disable only when you deliberately need raw credential-like strings for debugging or redactor development:
bash
hermes config set security.redact_secrets false
机密脱敏默认开启——工具输出(终端标准输出、
read_file
、网页内容、子Agent摘要等)在进入对话上下文和日志之前,会被扫描以查找类似API密钥、令牌和机密的字符串。正常使用时保持开启:
bash
hermes config set security.redact_secrets true       # 全局保持开启
需要重启。
security.redact_secrets
在导入时被快照——在会话中途切换(例如通过工具调用执行
export HERMES_REDACT_SECRETS=false
)不会对运行中的进程生效。告知用户从终端更改配置,然后启动新会话。这是有意设计的——防止LLM在任务中途自行切换该开关。
仅在出于调试或脱敏器开发目的,故意需要原始凭证类字符串时才禁用:
bash
hermes config set security.redact_secrets false

PII redaction in gateway messages

网关消息中的PII脱敏

Separate from secret redaction. When enabled, the gateway hashes user IDs and strips phone numbers from the session context before it reaches the model:
bash
hermes config set privacy.redact_pii true    # enable
hermes config set privacy.redact_pii false   # disable (default)
与机密脱敏分离。启用后,网关会在会话上下文到达模型之前,对用户ID进行哈希处理并剥离电话号码:
bash
hermes config set privacy.redact_pii true    # 启用
hermes config set privacy.redact_pii false   # 禁用(默认)

Command approval prompts

命令确认提示

By default (
approvals.mode: manual
), Hermes prompts the user before running shell commands flagged as destructive (
rm -rf
,
git reset --hard
, etc.). The modes are:
  • manual
    — always prompt (default)
  • smart
    — use an auxiliary LLM to auto-approve low-risk commands, prompt on high-risk
  • off
    — skip all approval prompts (equivalent to
    --yolo
    )
bash
hermes config set approvals.mode smart       # recommended middle ground
hermes config set approvals.mode off         # bypass everything (not recommended)
Per-invocation bypass without changing config:
  • hermes --yolo …
  • export HERMES_YOLO_MODE=1
Note: YOLO /
approvals.mode: off
does NOT turn off secret redaction. They are independent.
默认情况下(
approvals.mode: manual
),Hermes在运行标记为破坏性的Shell命令(如
rm -rf
git reset --hard
等)之前会提示用户确认。模式包括:
  • manual
    —— 始终提示(默认)
  • smart
    —— 使用辅助LLM自动批准低风险命令,高风险命令则提示确认
  • off
    —— 跳过所有确认提示(等效于
    --yolo
bash
hermes config set approvals.mode smart       # 推荐的折中方案
hermes config set approvals.mode off         # 绕过所有确认(不推荐)
无需更改配置的单次调用绕过:
  • hermes --yolo …
  • export HERMES_YOLO_MODE=1
注意:YOLO /
approvals.mode: off
不会关闭机密脱敏。它们是独立的。

Shell hooks allowlist

Shell钩子允许列表

Some shell-hook integrations require explicit allowlisting before they fire. Managed via
~/.hermes/shell-hooks-allowlist.json
— prompted interactively the first time a hook wants to run.
某些Shell钩子集成需要显式加入允许列表才能触发。通过
~/.hermes/shell-hooks-allowlist.json
管理——钩子首次运行时会交互式提示。

Disabling the web/browser/image-gen tools

禁用web/browser/image-gen工具

To keep the model away from network or media tools entirely, open
hermes tools
and toggle per-platform. Takes effect on next session (
/reset
). See the Tools & Skills section above.

要让模型完全远离网络或媒体工具,打开
hermes tools
并按平台切换。在下次会话(
/reset
)后生效。请参阅上面的“工具与技能”部分。

Voice & Transcription

语音与转录

STT (Voice → Text)

STT(语音→文本)

Voice messages from messaging platforms are auto-transcribed.
Provider priority (auto-detected):
  1. Local faster-whisper — free, no API key:
    pip install faster-whisper
  2. Groq Whisper — free tier: set
    GROQ_API_KEY
  3. OpenAI Whisper — paid: set
    VOICE_TOOLS_OPENAI_KEY
  4. Mistral Voxtral — set
    MISTRAL_API_KEY
Config:
yaml
stt:
  enabled: true
  provider: local        # local, groq, openai, mistral
  local:
    model: base          # tiny, base, small, medium, large-v3
消息平台的语音消息会自动转录。
提供商优先级(自动检测):
  1. 本地faster-whisper —— 免费,无需API密钥:
    pip install faster-whisper
  2. Groq Whisper —— 免费 tier:设置
    GROQ_API_KEY
  3. OpenAI Whisper —— 付费:设置
    VOICE_TOOLS_OPENAI_KEY
  4. Mistral Voxtral —— 设置
    MISTRAL_API_KEY
配置:
yaml
stt:
  enabled: true
  provider: local        # local、groq、openai、mistral
  local:
    model: base          # tiny、base、small、medium、large-v3

TTS (Text → Voice)

TTS(文本→语音)

ProviderEnv varFree?
Edge TTSNoneYes (default)
ElevenLabs
ELEVENLABS_API_KEY
Free tier
OpenAI
VOICE_TOOLS_OPENAI_KEY
Paid
MiniMax
MINIMAX_API_KEY
Paid
Mistral (Voxtral)
MISTRAL_API_KEY
Paid
NeuTTS (local)None (
pip install neutts[all]
+
espeak-ng
)
Free
Voice commands:
/voice on
(voice-to-voice),
/voice tts
(always voice),
/voice off
.

提供商环境变量免费?
Edge TTS是(默认)
ElevenLabs
ELEVENLABS_API_KEY
免费 tier
OpenAI
VOICE_TOOLS_OPENAI_KEY
付费
MiniMax
MINIMAX_API_KEY
付费
Mistral (Voxtral)
MISTRAL_API_KEY
付费
NeuTTS(本地)无(
pip install neutts[all]
+
espeak-ng
免费
语音命令:
/voice on
(语音转语音)、
/voice tts
(始终语音输出)、
/voice off

Spawning Additional Hermes Instances

生成额外的Hermes实例

Run additional Hermes processes as fully independent subprocesses — separate sessions, tools, and environments.
运行额外的Hermes进程作为完全独立的子进程——拥有独立的会话、工具和环境。

When to Use This vs delegate_task

使用场景对比:
delegate_task
vs 生成
hermes
进程

delegate_task
Spawning
hermes
process
IsolationSeparate conversation, shared processFully independent process
DurationMinutes (bounded by parent loop)Hours/days
Tool accessSubset of parent's toolsFull tool access
InteractiveNoYes (PTY mode)
Use caseQuick parallel subtasksLong autonomous missions
delegate_task
生成
hermes
进程
隔离性独立对话,共享进程完全独立的进程
持续时间分钟级(受父循环限制)小时/天级
工具访问父进程工具的子集完整工具访问权限
交互性是(PTY模式)
用例快速并行子任务长时间自主任务

One-Shot Mode

一次性模式

terminal(command="hermes chat -q 'Research GRPO papers and write summary to ~/research/grpo.md'", timeout=300)
terminal(command="hermes chat -q '研究GRPO论文并将摘要写入~/research/grpo.md'", timeout=300)

Background for long tasks:

后台运行长时间任务:

terminal(command="hermes chat -q 'Set up CI/CD for ~/myapp'", background=true)
undefined
terminal(command="hermes chat -q '为~/myapp设置CI/CD'", background=true)
undefined

Interactive PTY Mode (via tmux)

交互式PTY模式(通过tmux)

Hermes uses prompt_toolkit, which requires a real terminal. Use tmux for interactive spawning:
undefined
Hermes使用prompt_toolkit,需要真实终端。使用tmux进行交互式生成:
undefined

Start

启动

terminal(command="tmux new-session -d -s agent1 -x 120 -y 40 'hermes'", timeout=10)
terminal(command="tmux new-session -d -s agent1 -x 120 -y 40 'hermes'", timeout=10)

Wait for startup, then send a message

等待启动,然后发送消息

terminal(command="sleep 8 && tmux send-keys -t agent1 'Build a FastAPI auth service' Enter", timeout=15)
terminal(command="sleep 8 && tmux send-keys -t agent1 '构建FastAPI认证服务' Enter", timeout=15)

Read output

读取输出

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

Send follow-up

发送后续指令

terminal(command="tmux send-keys -t agent1 'Add rate limiting middleware' Enter", timeout=5)
terminal(command="tmux send-keys -t agent1 '添加限流中间件' Enter", timeout=5)

Exit

退出

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

Multi-Agent Coordination

多Agent协作

undefined
undefined

Agent A: backend

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)
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 '构建用户管理REST API' Enter", timeout=15)

Agent B: frontend

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 for user management' Enter", timeout=15)
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 '构建用户管理React仪表盘' Enter", timeout=15)

Check progress, relay context between them

检查进度,在它们之间传递上下文

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 the backend agent: ...' Enter", timeout=5)
undefined
terminal(command="tmux capture-pane -t backend -p | tail -30", timeout=5) terminal(command="tmux send-keys -t frontend '这是后端Agent提供的API架构:...' Enter", timeout=5)
undefined

Session Resume

恢复会话

undefined
undefined

Resume most recent session

恢复最近的会话

terminal(command="tmux new-session -d -s resumed 'hermes --continue'", timeout=10)
terminal(command="tmux new-session -d -s resumed 'hermes --continue'", timeout=10)

Resume specific session

恢复特定会话

terminal(command="tmux new-session -d -s resumed 'hermes --resume 20260225_143052_a1b2c3'", timeout=10)
undefined
terminal(command="tmux new-session -d -s resumed 'hermes --resume 20260225_143052_a1b2c3'", timeout=10)
undefined

Tips

提示

  • Prefer
    delegate_task
    for quick subtasks
    — less overhead than spawning a full process
  • Use
    -w
    (worktree mode)
    when spawning agents that edit code — prevents git conflicts
  • Set timeouts for one-shot mode — complex tasks can take 5-10 minutes
  • Use
    hermes chat -q
    for fire-and-forget
    — no PTY needed
  • Use tmux for interactive sessions — raw PTY mode has
    \r
    vs
    \n
    issues with prompt_toolkit
  • For scheduled tasks, use the
    cronjob
    tool instead of spawning — handles delivery and retry

  • 对于快速子任务,优先使用
    delegate_task
    —— 比生成完整进程的开销更小
  • 编辑代码时使用
    -w
    (工作树模式)
    —— 防止Git冲突
  • 为一次性模式设置超时 —— 复杂任务可能需要5-10分钟
  • 使用
    hermes chat -q
    实现即发即忘
    —— 无需PTY
  • 使用tmux进行交互式会话 —— 原始PTY模式与prompt_toolkit存在
    \r
    \n
    的问题
  • 对于定时任务,使用
    cronjob
    工具而非生成进程
    —— 它会处理交付和重试

Durable & Background Systems

持久化与后台系统

Four systems run alongside the main conversation loop. Quick reference here; full developer notes live in
AGENTS.md
, user-facing docs under
website/docs/user-guide/features/
.
有四个系统与主对话循环并行运行。此处为快速参考;完整开发者说明在
AGENTS.md
中,面向用户的文档在
website/docs/user-guide/features/
下。

Delegation (
delegate_task
)

任务委托(
delegate_task

Synchronous subagent spawn — the parent waits for the child's summary before continuing its own loop. Isolated context + terminal session.
  • Single:
    delegate_task(goal, context, toolsets)
    .
  • Batch:
    delegate_task(tasks=[{goal, ...}, ...])
    runs children in parallel, capped by
    delegation.max_concurrent_children
    (default 3).
  • Roles:
    leaf
    (default; cannot re-delegate) vs
    orchestrator
    (can spawn its own workers, bounded by
    delegation.max_spawn_depth
    ).
  • Not durable. If the parent is interrupted, the child is cancelled. For work that must outlive the turn, use
    cronjob
    or
    terminal(background=True, notify_on_complete=True)
    .
Config:
delegation.*
in
config.yaml
.
同步子Agent生成——父进程等待子进程的摘要后再继续自身循环。拥有独立上下文和终端会话。
  • 单次任务:
    delegate_task(goal, context, toolsets)
  • 批量任务:
    delegate_task(tasks=[{goal, ...}, ...])
    并行运行子任务,上限为
    delegation.max_concurrent_children
    (默认3)。
  • 角色:
    leaf
    (默认;无法重新委托) vs
    orchestrator
    (可以生成自己的工作者,受
    delegation.max_spawn_depth
    限制)。
  • 非持久化。 如果父进程被中断,子进程会被取消。对于必须在对话轮次结束后继续的工作,使用
    cronjob
    terminal(background=True, notify_on_complete=True)
配置:
config.yaml
中的
delegation.*

Cron (scheduled jobs)

定时任务(cron)

Durable scheduler —
cron/jobs.py
+
cron/scheduler.py
. Drive it via the
cronjob
tool, the
hermes cron
CLI (
list
,
add
,
edit
,
pause
,
resume
,
run
,
remove
), or the
/cron
slash command.
  • Schedules: duration (
    "30m"
    ,
    "2h"
    ), "every" phrase (
    "every monday 9am"
    ), 5-field cron (
    "0 9 * * *"
    ), or ISO timestamp.
  • Per-job knobs:
    skills
    ,
    model
    /
    provider
    override,
    script
    (pre-run data collection;
    no_agent=True
    makes the script the whole job),
    context_from
    (chain job A's output into job B),
    workdir
    (run in a specific dir with its
    AGENTS.md
    /
    CLAUDE.md
    loaded), multi-platform delivery.
  • Invariants: 3-minute hard interrupt per run,
    .tick.lock
    file prevents duplicate ticks across processes, cron sessions pass
    skip_memory=True
    by default, and cron deliveries are framed with a header/footer instead of being mirrored into the target gateway session (keeps role alternation intact).
持久化调度器——
cron/jobs.py
+
cron/scheduler.py
。通过
cronjob
工具、
hermes cron
CLI(
list
add
edit
pause
resume
run
remove
)或
/cron
斜杠命令操作。
  • 调度规则: 时长(
    "30m"
    "2h"
    )、“every”短语(
    "every monday 9am"
    )、5字段cron表达式(
    "0 9 * * *"
    )或ISO时间戳。
  • 每个任务的配置项:
    skills
    model
    /
    provider
    覆盖、
    script
    (预运行数据收集;
    no_agent=True
    使脚本成为整个任务)、
    context_from
    (将任务A的输出传递到任务B)、
    workdir
    (在特定目录中运行,加载其
    AGENTS.md
    /
    CLAUDE.md
    )、多平台交付。
  • 不变规则: 每次运行有3分钟硬中断,
    .tick.lock
    文件防止跨进程重复触发,定时会话默认传递
    skip_memory=True
    ,定时交付会添加页眉/页脚,而不是镜像到目标网关会话(保持角色交替完整)。

Curator (skill lifecycle)

技能管理器(Curator)

Background maintenance for agent-created skills. Tracks usage, marks idle skills stale, archives stale ones, keeps a pre-run tar.gz backup so nothing is lost.
  • CLI:
    hermes curator <verb>
    status
    ,
    run
    ,
    pause
    ,
    resume
    ,
    pin
    ,
    unpin
    ,
    archive
    ,
    restore
    ,
    prune
    ,
    backup
    ,
    rollback
    .
  • Slash:
    /curator <subcommand>
    mirrors the CLI.
  • Scope: only touches skills with
    created_by: "agent"
    provenance. Bundled + hub-installed skills are off-limits. Never deletes — max destructive action is archive. Pinned skills are exempt from every auto-transition and every LLM review pass.
  • Telemetry: sidecar at
    ~/.hermes/skills/.usage.json
    holds per-skill
    use_count
    ,
    view_count
    ,
    patch_count
    ,
    last_activity_at
    ,
    state
    ,
    pinned
    .
Config:
curator.*
(
enabled
,
interval_hours
,
min_idle_hours
,
stale_after_days
,
archive_after_days
,
backup.*
). User docs: https://hermes-agent.nousresearch.com/docs/user-guide/features/curator
Agent创建的技能的后台维护。跟踪使用情况,标记闲置技能为过时,归档过时技能,保留预运行tar.gz备份,以防数据丢失。
  • CLI:
    hermes curator <verb>
    ——
    status
    run
    pause
    resume
    pin
    unpin
    archive
    restore
    prune
    backup
    rollback
  • 斜杠命令:
    /curator <subcommand>
    与CLI镜像。
  • 范围: 仅处理
    created_by: "agent"
    来源的技能。捆绑包和中心安装的技能不在范围内。永不删除——最大的破坏性操作是归档。固定的技能不受任何自动转换和LLM审查的影响。
  • 遥测: 辅助文件
    ~/.hermes/skills/.usage.json
    保存每个技能的
    use_count
    view_count
    patch_count
    last_activity_at
    state
    pinned
配置:
curator.*
enabled
interval_hours
min_idle_hours
stale_after_days
archive_after_days
backup.*
)。 用户文档:https://hermes-agent.nousresearch.com/docs/user-guide/features/curator

Kanban (multi-agent work queue)

看板(Kanban)

Durable SQLite board for multi-profile / multi-worker collaboration. Users drive it via
hermes kanban <verb>
; dispatcher-spawned workers see a focused
kanban_*
toolset gated by
HERMES_KANBAN_TASK
, and orchestrator profiles can opt into the broader
kanban
toolset. Normal sessions still have zero
kanban_*
schema footprint unless configured.
  • CLI verbs (common):
    init
    ,
    create
    ,
    list
    (alias
    ls
    ),
    show
    ,
    assign
    ,
    link
    ,
    unlink
    ,
    comment
    ,
    complete
    ,
    block
    ,
    unblock
    ,
    archive
    ,
    tail
    . Less common:
    watch
    ,
    stats
    ,
    runs
    ,
    log
    ,
    dispatch
    ,
    daemon
    ,
    gc
    .
  • Worker/orchestrator toolset:
    kanban_show
    ,
    kanban_complete
    ,
    kanban_block
    ,
    kanban_heartbeat
    ,
    kanban_comment
    ,
    kanban_create
    ,
    kanban_link
    ; profiles that explicitly enable the
    kanban
    toolset outside a dispatcher-spawned task also get
    kanban_list
    and
    kanban_unblock
    for board routing.
  • Dispatcher runs inside the gateway by default (
    kanban.dispatch_in_gateway: true
    ) — reclaims stale claims, promotes ready tasks, atomically claims, spawns assigned profiles. Auto-blocks a task after
    failure_limit
    consecutive spawn failures (default 2; configurable via
    kanban.failure_limit
    or per-task
    max_retries
    ).
  • Isolation: board is the hard boundary (workers get
    HERMES_KANBAN_BOARD
    pinned in env); tenant is a soft namespace within a board for workspace-path + memory-key isolation.

用于多配置文件/多工作者协作的持久化SQLite看板。用户通过
hermes kanban <verb>
操作;调度器生成的工作者看到受
HERMES_KANBAN_TASK
限制的
kanban_*
工具集,协调器配置文件可以选择启用更广泛的
kanban
工具集。正常会话在未配置的情况下,
kanban_*
架构占用为零。
  • 常用CLI动词:
    init
    create
    list
    (别名
    ls
    )、
    show
    assign
    link
    unlink
    comment
    complete
    block
    unblock
    archive
    tail
    。不常用:
    watch
    stats
    runs
    log
    dispatch
    daemon
    gc
  • 工作者/协调器工具集:
    kanban_show
    kanban_complete
    kanban_block
    kanban_heartbeat
    kanban_comment
    kanban_create
    kanban_link
    ;在调度器生成的任务之外显式启用
    kanban
    工具集的配置文件还会获得
    kanban_list
    kanban_unblock
    用于看板路由。
  • 调度器默认在网关内运行(
    kanban.dispatch_in_gateway: true
    )——回收过时的任务认领、推进就绪任务、原子化认领、生成分配的配置文件。在连续
    failure_limit
    次生成失败后自动阻止任务(默认2;可通过
    kanban.failure_limit
    或每个任务的
    max_retries
    配置)。
  • 隔离性: 看板是硬边界(工作者的环境中固定
    HERMES_KANBAN_BOARD
    );租户是看板内的软命名空间,用于工作区路径和记忆密钥隔离。

Windows-Specific Quirks

Windows特定问题

Hermes runs natively on Windows (PowerShell, cmd, Windows Terminal, git-bash mintty, VS Code integrated terminal). Most of it just works, but a handful of differences between Win32 and POSIX have bitten us — document new ones here as you hit them so the next person (or the next session) doesn't rediscover them from scratch.
Hermes可在Windows上原生运行(PowerShell、cmd、Windows Terminal、git-bash mintty、VS Code集成终端)。大多数功能正常工作,但Win32和POSIX之间的一些差异会导致问题——遇到新问题时请在此处记录,以便下一个人(或下一个会话)不必从头重新发现。

Input / Keybindings

输入/按键绑定

Alt+Enter doesn't insert a newline. Windows Terminal intercepts Alt+Enter at the terminal layer to toggle fullscreen — the keystroke never reaches prompt_toolkit. Use Ctrl+Enter instead. Windows Terminal delivers Ctrl+Enter as LF (
c-j
), distinct from plain Enter (
c-m
/ CR), and the CLI binds
c-j
to newline insertion on
win32
only (see
_bind_prompt_submit_keys
+ the Windows-only
c-j
binding in
cli.py
). Side effect: the raw Ctrl+J keystroke also inserts a newline on Windows — unavoidable, because Windows Terminal collapses Ctrl+Enter and Ctrl+J to the same keycode at the Win32 console API layer. No conflicting binding existed for Ctrl+J on Windows, so this is a harmless side effect.
mintty / git-bash behaves the same (fullscreen on Alt+Enter) unless you disable Alt+Fn shortcuts in Options → Keys. Easier to just use Ctrl+Enter.
Diagnosing keybindings. Run
python scripts/keystroke_diagnostic.py
(repo root) to see exactly how prompt_toolkit identifies each keystroke in the current terminal. Answers questions like "does Shift+Enter come through as a distinct key?" (almost never — most terminals collapse it to plain Enter) or "what byte sequence is my terminal sending for Ctrl+Enter?" This is how the Ctrl+Enter = c-j fact was established.
Alt+Enter无法插入换行符。 Windows Terminal在终端层拦截Alt+Enter以切换全屏——按键永远无法到达prompt_toolkit。请改用Ctrl+Enter。Windows Terminal将Ctrl+Enter作为LF(
c-j
)传递,与普通Enter(
c-m
/ CR)不同,CLI仅在
win32
上将
c-j
绑定到换行插入(请参阅
_bind_prompt_submit_keys
+
cli.py
中Windows专属的
c-j
绑定)。副作用:在Windows上,原始Ctrl+J按键也会插入换行符——这是不可避免的,因为Windows Terminal在Win32控制台API层将Ctrl+Enter和Ctrl+J合并为相同的键码。Windows上没有与Ctrl+J冲突的绑定,因此这是无害的副作用。
mintty / git-bash的行为相同(Alt+Enter切换全屏),除非在Options → Keys中禁用Alt+Fn快捷键。直接使用Ctrl+Enter更简单。
诊断按键绑定。 运行
python scripts/keystroke_diagnostic.py
(仓库根目录),查看prompt_toolkit在当前终端中如何识别每个按键。回答诸如“Shift+Enter是否作为不同的按键传递?”(几乎从不——大多数终端将其合并为普通Enter)或“我的终端为Ctrl+Enter发送什么字节序列?”等问题。这就是Ctrl+Enter = c-j这一事实的确定方式。

Config / Files

配置/文件

HTTP 400 "No models provided" on first run.
config.yaml
was saved with a UTF-8 BOM (common when Windows apps write it). Re-save as UTF-8 without BOM.
hermes config edit
writes without BOM; manual edits in Notepad are the usual culprit.
首次运行时出现HTTP 400 "No models provided"错误。
config.yaml
保存时带有UTF-8 BOM(Windows应用程序写入时常见)。重新保存为无BOM的UTF-8格式。
hermes config edit
写入时不带BOM;手动使用记事本编辑通常是罪魁祸首。

execute_code
/ Sandbox

execute_code
/ 沙箱

WinError 10106 ("The requested service provider could not be loaded or initialized") from the sandbox child process — it can't create an
AF_INET
socket, so the loopback-TCP RPC fallback fails before
connect()
. Root cause is usually not a broken Winsock LSP; it's Hermes's own env scrubber dropping
SYSTEMROOT
/
WINDIR
/
COMSPEC
from the child env. Python's
socket
module needs
SYSTEMROOT
to locate
mswsock.dll
. Fixed via the
_WINDOWS_ESSENTIAL_ENV_VARS
allowlist in
tools/code_execution_tool.py
. If you still hit it, echo
os.environ
inside an
execute_code
block to confirm
SYSTEMROOT
is set. Full diagnostic recipe in
references/execute-code-sandbox-env-windows.md
.
沙箱子进程出现WinError 10106(“无法加载或初始化请求的服务提供商”)——它无法创建
AF_INET
套接字,因此环回TCP RPC回落在
connect()
之前失败。根本原因通常不是Winsock LSP损坏;而是Hermes的环境清理器从子环境中删除了
SYSTEMROOT
/
WINDIR
/
COMSPEC
。Python的
socket
模块需要
SYSTEMROOT
来定位
mswsock.dll
。通过
tools/code_execution_tool.py
中的
_WINDOWS_ESSENTIAL_ENV_VARS
允许列表修复。如果仍然遇到此问题,在
execute_code
块中回显
os.environ
以确认
SYSTEMROOT
已设置。完整诊断方法在
references/execute-code-sandbox-env-windows.md
中。

Testing / Contributing

测试/贡献

scripts/run_tests.sh
doesn't work as-is on Windows
— it looks for POSIX venv layouts (
.venv/bin/activate
). The Hermes-installed venv at
venv/Scripts/
has no pip or pytest either (stripped for install size). Workaround: install
pytest + pytest-xdist + pyyaml
into a system Python 3.11 user site, then invoke pytest directly with
PYTHONPATH
set:
bash
"/c/Program Files/Python311/python" -m pip install --user pytest pytest-xdist pyyaml
export PYTHONPATH="$(pwd)"
"/c/Program Files/Python311/python" -m pytest tests/foo/test_bar.py -v --tb=short -n 0
Use
-n 0
, not
-n 4
pyproject.toml
's default
addopts
already includes
-n
, and the wrapper's CI-parity guarantees don't apply off POSIX.
POSIX-only tests need skip guards. Common markers already in the codebase:
  • Symlinks — elevated privileges on Windows
  • 0o600
    file modes — POSIX mode bits not enforced on NTFS by default
  • signal.SIGALRM
    — Unix-only (see
    tests/conftest.py::_enforce_test_timeout
    )
  • Winsock / Windows-specific regressions —
    @pytest.mark.skipif(sys.platform != "win32", ...)
Use the existing skip-pattern style (
sys.platform == "win32"
or
sys.platform.startswith("win")
) to stay consistent with the rest of the suite.
scripts/run_tests.sh
在Windows上无法直接工作
——它查找POSIX虚拟环境布局(
.venv/bin/activate
)。Hermes安装的虚拟环境在
venv/Scripts/
中,也没有pip或pytest(为了减小安装大小而被剥离)。解决方法:将
pytest + pytest-xdist + pyyaml
安装到系统Python 3.11用户站点,然后设置
PYTHONPATH
直接调用pytest:
bash
"/c/Program Files/Python311/python" -m pip install --user pytest pytest-xdist pyyaml
export PYTHONPATH="$(pwd)"
"/c/Program Files/Python311/python" -m pytest tests/foo/test_bar.py -v --tb=short -n 0
使用
-n 0
,而不是
-n 4
——
pyproject.toml
的默认
addopts
已经包含
-n
,并且包装器的CI一致性保证不适用于非POSIX系统。
仅POSIX的测试需要跳过标记。 代码库中已有的常见标记:
  • 符号链接——Windows上需要提升权限
  • 0o600
    文件模式——NTFS默认不强制POSIX模式位
  • signal.SIGALRM
    ——仅Unix可用(请参阅
    tests/conftest.py::_enforce_test_timeout
  • Winsock / Windows特定回归测试——
    @pytest.mark.skipif(sys.platform != "win32", ...)
使用现有的跳过模式(
sys.platform == "win32"
sys.platform.startswith("win")
),与套件的其余部分保持一致。

Path / Filesystem

路径/文件系统

Line endings. Git may warn
LF will be replaced by CRLF the next time Git touches it
. Cosmetic — the repo's
.gitattributes
normalizes. Don't let editors auto-convert committed POSIX-newline files to CRLF.
Forward slashes work almost everywhere.
C:/Users/...
is accepted by every Hermes tool and most Windows APIs. Prefer forward slashes in code and logs — avoids shell-escaping backslashes in bash.

行尾。 Git可能会警告
LF will be replaced by CRLF the next time Git touches it
。这只是 cosmetic——仓库的
.gitattributes
会进行规范化。不要让编辑器自动将提交的POSIX换行文件转换为CRLF。
正斜杠几乎在所有地方都有效。
C:/Users/...
被所有Hermes工具和大多数Windows API接受。在代码和日志中优先使用正斜杠——避免在bash中转义反斜杠。

Troubleshooting

故障排除

Voice not working

语音功能不工作

  1. Check
    stt.enabled: true
    in config.yaml
  2. Verify provider:
    pip install faster-whisper
    or set API key
  3. In gateway:
    /restart
    . In CLI: exit and relaunch.
  1. 检查config.yaml中
    stt.enabled: true
  2. 验证提供商:
    pip install faster-whisper
    或设置API密钥
  3. 在网关中:
    /restart
    。在CLI中:退出并重新启动。

Tool not available

工具不可用

  1. hermes tools
    — check if toolset is enabled for your platform
  2. Some tools need env vars (check
    .env
    )
  3. /reset
    after enabling tools
  1. hermes tools
    ——检查工具集是否为你的平台启用
  2. 某些工具需要环境变量(检查
    .env
  3. 启用工具后执行
    /reset

Model/provider issues

模型/提供商问题

  1. hermes doctor
    — check config and dependencies
  2. hermes auth
    — re-authenticate OAuth providers (or
    hermes auth add <provider>
    )
  3. Check
    .env
    has the right API key
  4. Copilot 403:
    gh auth login
    tokens do NOT work for Copilot API. You must use the Copilot-specific OAuth device code flow via
    hermes model
    → GitHub Copilot.
  1. hermes doctor
    ——检查配置和依赖项
  2. hermes auth
    ——重新认证OAuth提供商(或
    hermes auth add <provider>
  3. 检查
    .env
    是否有正确的API密钥
  4. Copilot 403错误
    gh auth login
    令牌不适用于Copilot API。你必须通过
    hermes model
    → GitHub Copilot使用Copilot专属的OAuth设备代码流。

Changes not taking effect

更改未生效

  • Tools/skills:
    /reset
    starts a new session with updated toolset
  • Config changes: In gateway:
    /restart
    . In CLI: exit and relaunch.
  • Code changes: Restart the CLI or gateway process
  • 工具/技能:
    /reset
    启动带有更新工具集的新会话
  • 配置更改: 在网关中:
    /restart
    。在CLI中:退出并重新启动。
  • 代码更改: 重启CLI或网关进程

Skills not showing

技能未显示

  1. hermes skills list
    — verify installed
  2. hermes skills config
    — check platform enablement
  3. Load explicitly:
    /skill name
    or
    hermes -s name
  1. hermes skills list
    ——验证已安装
  2. hermes skills config
    ——检查平台启用情况
  3. 显式加载:
    /skill name
    hermes -s name

Gateway issues

网关问题

Check logs first:
bash
grep -i "failed to send\|error" ~/.hermes/logs/gateway.log | tail -20
Common gateway problems:
  • Gateway dies on SSH logout: Enable linger:
    sudo loginctl enable-linger $USER
  • Gateway dies on WSL2 close: WSL2 requires
    systemd=true
    in
    /etc/wsl.conf
    for systemd services to work. Without it, gateway falls back to
    nohup
    (dies when session closes).
  • Gateway crash loop: Reset the failed state:
    systemctl --user reset-failed hermes-gateway
首先检查日志:
bash
grep -i "failed to send\|error" ~/.hermes/logs/gateway.log | tail -20
常见网关问题:
  • SSH注销后网关终止:启用linger:
    sudo loginctl enable-linger $USER
  • WSL2关闭后网关终止:WSL2需要在
    /etc/wsl.conf
    中设置
    systemd=true
    才能让systemd服务工作。没有它,网关会回退到
    nohup
    (会话关闭时终止)。
  • 网关崩溃循环:重置失败状态:
    systemctl --user reset-failed hermes-gateway

Platform-specific issues

平台特定问题

  • Discord bot silent: Must enable Message Content Intent in Bot → Privileged Gateway Intents.
  • Slack bot only works in DMs: Must subscribe to
    message.channels
    event. Without it, the bot ignores public channels.
  • Windows-specific issues (
    Alt+Enter
    newline, WinError 10106, UTF-8 BOM config, test suite, line endings): see the dedicated Windows-Specific Quirks section above.
  • Discord机器人无响应:必须在Bot → Privileged Gateway Intents中启用Message Content Intent
  • Slack机器人仅在DM中工作:必须订阅
    message.channels
    事件。没有它,机器人会忽略公共频道。
  • Windows特定问题
    Alt+Enter
    换行、WinError 10106、UTF-8 BOM配置、测试套件、行尾):请参阅上面专门的Windows特定问题部分。

Auxiliary models not working

辅助模型不工作

If
auxiliary
tasks (vision, compression, session_search) fail silently, the
auto
provider can't find a backend. Either set
OPENROUTER_API_KEY
or
GOOGLE_API_KEY
, or explicitly configure each auxiliary task's provider:
bash
hermes config set auxiliary.vision.provider <your_provider>
hermes config set auxiliary.vision.model <model_name>

如果
auxiliary
任务(视觉、压缩、会话搜索)静默失败,
auto
提供商无法找到后端。要么设置
OPENROUTER_API_KEY
GOOGLE_API_KEY
,要么显式配置每个辅助任务的提供商:
bash
hermes config set auxiliary.vision.provider <your_provider>
hermes config set auxiliary.vision.model <model_name>

Where to Find Things

查找资源

Looking for...Location
Config options
hermes config edit
or Configuration docs
Available tools
hermes tools list
or Tools reference
Slash commands
/help
in session or Slash commands reference
Skills catalog
hermes skills browse
or Skills catalog
Provider setup
hermes model
or Providers guide
Platform setup
hermes gateway setup
or Messaging docs
MCP servers
hermes mcp list
or MCP guide
Profiles
hermes profile list
or Profiles docs
Cron jobs
hermes cron list
or Cron docs
Memory
hermes memory status
or Memory docs
Env variables
hermes config env-path
or Env vars reference
CLI commands
hermes --help
or CLI reference
Gateway logs
~/.hermes/logs/gateway.log
Session files
hermes sessions browse
(reads state.db)
Source code
~/.hermes/hermes-agent/

查找内容位置
配置选项
hermes config edit
配置文档
可用工具
hermes tools list
工具参考
斜杠命令会话中输入
/help
斜杠命令参考
技能目录
hermes skills browse
技能目录
提供商设置
hermes model
提供商指南
平台设置
hermes gateway setup
消息文档
MCP服务器
hermes mcp list
MCP指南
配置文件
hermes profile list
配置文件文档
定时任务
hermes cron list
定时任务文档
记忆
hermes memory status
记忆文档
环境变量
hermes config env-path
环境变量参考
CLI命令
hermes --help
CLI参考
网关日志
~/.hermes/logs/gateway.log
会话文件
hermes sessions browse
(读取state.db)
源代码
~/.hermes/hermes-agent/

Contributor Quick Reference

贡献者快速参考

For occasional contributors and PR authors. Full developer docs: https://hermes-agent.nousresearch.com/docs/developer-guide/
面向偶尔贡献者和PR作者。完整开发者文档:https://hermes-agent.nousresearch.com/docs/developer-guide/

Project Layout

项目布局

hermes-agent/
├── run_agent.py          # AIAgent — core conversation loop
├── model_tools.py        # Tool discovery and dispatch
├── toolsets.py           # Toolset definitions
├── cli.py                # Interactive CLI (HermesCLI)
├── hermes_state.py       # SQLite session store
├── agent/                # Prompt builder, context compression, memory, model routing, credential pooling, skill dispatch
├── hermes_cli/           # CLI subcommands, config, setup, commands
│   ├── commands.py       # Slash command registry (CommandDef)
│   ├── config.py         # DEFAULT_CONFIG, env var definitions
│   └── main.py           # CLI entry point and argparse
├── tools/                # One file per tool
│   └── registry.py       # Central tool registry
├── gateway/              # Messaging gateway
│   └── platforms/        # Platform adapters (telegram, discord, etc.)
├── cron/                 # Job scheduler
├── tests/                # ~3000 pytest tests
└── website/              # Docusaurus docs site
Config:
~/.hermes/config.yaml
(settings),
~/.hermes/.env
(API keys).
hermes-agent/
├── run_agent.py          # AIAgent — 核心对话循环
├── model_tools.py        # 工具发现和调度
├── toolsets.py           # 工具集定义
├── cli.py                # 交互式CLI(HermesCLI)
├── hermes_state.py       # SQLite会话存储
├── agent/                # 提示构建器、上下文压缩、记忆、模型路由、凭证池、技能调度
├── hermes_cli/           # CLI子命令、配置、设置、命令
│   ├── commands.py       # 斜杠命令注册表(CommandDef)
│   ├── config.py         # DEFAULT_CONFIG、环境变量定义
│   └── main.py           # CLI入口点和argparse
├── tools/                # 每个工具对应一个文件
│   └── registry.py       # 中央工具注册表
├── gateway/              # 消息网关
│   └── platforms/        # 平台适配器(telegram、discord等)
├── cron/                 # 任务调度器
├── tests/                # ~3000个pytest测试
└── website/              # Docusaurus文档站点
配置:
~/.hermes/config.yaml
(设置)、
~/.hermes/.env
(API密钥)。

Adding a Tool (3 files)

添加工具(3个文件)

1. Create
tools/your_tool.py
:
python
import json, os
from tools.registry import registry

def check_requirements() -> bool:
    return bool(os.getenv("EXAMPLE_API_KEY"))

def example_tool(param: str, task_id: str = None) -> str:
    return json.dumps({"success": True, "data": "..."})

registry.register(
    name="example_tool",
    toolset="example",
    schema={"name": "example_tool", "description": "...", "parameters": {...}},
    handler=lambda args, **kw: example_tool(
        param=args.get("param", ""), task_id=kw.get("task_id")),
    check_fn=check_requirements,
    requires_env=["EXAMPLE_API_KEY"],
)
2. Add to
toolsets.py
_HERMES_CORE_TOOLS
list.
Auto-discovery: any
tools/*.py
file with a top-level
registry.register()
call is imported automatically — no manual list needed.
All handlers must return JSON strings. Use
get_hermes_home()
for paths, never hardcode
~/.hermes
.
1. 创建
tools/your_tool.py
python
import json, os
from tools.registry import registry

def check_requirements() -> bool:
    return bool(os.getenv("EXAMPLE_API_KEY"))

def example_tool(param: str, task_id: str = None) -> str:
    return json.dumps({"success": True, "data": "..."})

registry.register(
    name="example_tool",
    toolset="example",
    schema={"name": "example_tool", "description": "...", "parameters": {...}},
    handler=lambda args, **kw: example_tool(
        param=args.get("param", ""), task_id=kw.get("task_id")),
    check_fn=check_requirements,
    requires_env=["EXAMPLE_API_KEY"],
)
2. 添加到
toolsets.py
_HERMES_CORE_TOOLS
列表。
自动发现:任何带有顶级
registry.register()
调用的
tools/*.py
文件都会被自动导入——无需手动添加到列表。
所有处理程序必须返回JSON字符串。使用
get_hermes_home()
获取路径,永远不要硬编码
~/.hermes

Adding a Slash Command

添加斜杠命令

  1. Add
    CommandDef
    to
    COMMAND_REGISTRY
    in
    hermes_cli/commands.py
  2. Add handler in
    cli.py
    process_command()
  3. (Optional) Add gateway handler in
    gateway/run.py
All consumers (help text, autocomplete, Telegram menu, Slack mapping) derive from the central registry automatically.
  1. hermes_cli/commands.py
    COMMAND_REGISTRY
    中添加
    CommandDef
  2. cli.py
    process_command()
    中添加处理程序
  3. (可选)在
    gateway/run.py
    中添加网关处理程序
所有消费端(帮助文本、自动补全、Telegram菜单、Slack映射)都会自动从中央注册表派生。

Agent Loop (High Level)

Agent循环(高级)

run_conversation():
  1. Build system prompt
  2. Loop while iterations < max:
     a. Call LLM (OpenAI-format messages + tool schemas)
     b. If tool_calls → dispatch each via handle_function_call() → append results → continue
     c. If text response → return
  3. Context compression triggers automatically near token limit
run_conversation():
  1. 构建系统提示
  2. 循环直到迭代次数超过最大值:
     a. 调用LLM(OpenAI格式消息 + 工具架构)
     b. 如果有tool_calls → 通过handle_function_call()调度每个调用 → 添加结果 → 继续循环
     c. 如果是文本响应 → 返回
  3. 接近令牌限制时自动触发上下文压缩

Testing

测试

bash
python -m pytest tests/ -o 'addopts=' -q   # Full suite
python -m pytest tests/tools/ -q            # Specific area
  • Tests auto-redirect
    HERMES_HOME
    to temp dirs — never touch real
    ~/.hermes/
  • Run full suite before pushing any change
  • Use
    -o 'addopts='
    to clear any baked-in pytest flags
Windows contributors:
scripts/run_tests.sh
currently looks for POSIX venvs (
.venv/bin/activate
/
venv/bin/activate
) and will error out on Windows where the layout is
venv/Scripts/activate
+
python.exe
. The Hermes-installed venv at
venv/Scripts/
also has no
pip
or
pytest
— it's stripped for end-user install size. Workaround: install pytest + pytest-xdist + pyyaml into a system Python 3.11 user site (
/c/Program Files/Python311/python -m pip install --user pytest pytest-xdist pyyaml
), then run tests directly:
bash
export PYTHONPATH="$(pwd)"
"/c/Program Files/Python311/python" -m pytest tests/tools/test_foo.py -v --tb=short -n 0
Use
-n 0
(not
-n 4
) because
pyproject.toml
's default
addopts
already includes
-n
, and the wrapper's CI-parity story doesn't apply off-POSIX.
Cross-platform test guards: tests that use POSIX-only syscalls need a skip marker. Common ones already in the codebase:
  • Symlink creation →
    @pytest.mark.skipif(sys.platform == "win32", reason="Symlinks require elevated privileges on Windows")
    (see
    tests/cron/test_cron_script.py
    )
  • POSIX file modes (0o600, etc.) →
    @pytest.mark.skipif(sys.platform.startswith("win"), reason="POSIX mode bits not enforced on Windows")
    (see
    tests/hermes_cli/test_auth_toctou_file_modes.py
    )
  • signal.SIGALRM
    → Unix-only (see
    tests/conftest.py::_enforce_test_timeout
    )
  • Live Winsock / Windows-specific regression tests →
    @pytest.mark.skipif(sys.platform != "win32", reason="Windows-specific regression")
Monkeypatching
sys.platform
is not enough
when the code under test also calls
platform.system()
/
platform.release()
/
platform.mac_ver()
. Those functions re-read the real OS independently, so a test that sets
sys.platform = "linux"
on a Windows runner will still see
platform.system() == "Windows"
and route through the Windows branch. Patch all three together:
python
monkeypatch.setattr(sys, "platform", "linux")
monkeypatch.setattr(platform, "system", lambda: "Linux")
monkeypatch.setattr(platform, "release", lambda: "6.8.0-generic")
See
tests/agent/test_prompt_builder.py::TestEnvironmentHints
for a worked example.
bash
python -m pytest tests/ -o 'addopts=' -q   # 完整套件
python -m pytest tests/tools/ -q            # 特定区域
  • 测试会自动将
    HERMES_HOME
    重定向到临时目录——永远不会触及真实的
    ~/.hermes/
  • 推送任何更改前运行完整套件
  • 使用
    -o 'addopts='
    清除任何内置的pytest标志
Windows贡献者:
scripts/run_tests.sh
目前查找POSIX虚拟环境(
.venv/bin/activate
/
venv/bin/activate
),在Windows上会出错,因为Windows的布局是
venv/Scripts/activate
+
python.exe
。Hermes安装的虚拟环境在
venv/Scripts/
中也没有
pip
pytest
——为了减小终端用户安装大小而被剥离。解决方法:将pytest + pytest-xdist + pyyaml安装到系统Python 3.11用户站点(
/c/Program Files/Python311/python -m pip install --user pytest pytest-xdist pyyaml
),然后直接运行测试:
bash
export PYTHONPATH="$(pwd)"
"/c/Program Files/Python311/python" -m pytest tests/tools/test_foo.py -v --tb=short -n 0
使用
-n 0
(不是
-n 4
),因为
pyproject.toml
的默认
addopts
已经包含
-n
,并且包装器的CI一致性不适用于非POSIX系统。
跨平台测试保护: 使用仅POSIX系统调用的测试需要跳过标记。代码库中已有的常见标记:
  • 创建符号链接 →
    @pytest.mark.skipif(sys.platform == "win32", reason="Symlinks require elevated privileges on Windows")
    (请参阅
    tests/cron/test_cron_script.py
  • POSIX文件模式(0o600等) →
    @pytest.mark.skipif(sys.platform.startswith("win"), reason="POSIX mode bits not enforced on Windows")
    (请参阅
    tests/hermes_cli/test_auth_toctou_file_modes.py
  • signal.SIGALRM
    → 仅Unix可用(请参阅
    tests/conftest.py::_enforce_test_timeout
  • 实时Winsock / Windows特定回归测试 →
    @pytest.mark.skipif(sys.platform != "win32", reason="Windows-specific regression")
仅猴子补丁
sys.platform
不够
,当被测代码也调用
platform.system()
/
platform.release()
/
platform.mac_ver()
时。这些函数会独立读取真实操作系统,因此在Windows运行器上设置
sys.platform = "linux"
的测试仍然会看到
platform.system() == "Windows"
并进入Windows分支。需要同时补丁这三个函数:
python
monkeypatch.setattr(sys, "platform", "linux")
monkeypatch.setattr(platform, "system", lambda: "Linux")
monkeypatch.setattr(platform, "release", lambda: "6.8.0-generic")
请参阅
tests/agent/test_prompt_builder.py::TestEnvironmentHints
获取示例。

Extending the system prompt's execution-environment block

扩展系统提示的执行环境块

Factual guidance about the host OS, user home, cwd, terminal backend, and shell (bash vs. PowerShell on Windows) is emitted from
agent/prompt_builder.py::build_environment_hints()
. This is also where the WSL hint and per-backend probe logic live. The convention:
  • Local terminal backend → emit host info (OS,
    $HOME
    , cwd) + Windows-specific notes (hostname ≠ username,
    terminal
    uses bash not PowerShell).
  • Remote terminal backend (anything in
    _REMOTE_TERMINAL_BACKENDS
    :
    docker, singularity, modal, daytona, ssh, managed_modal
    ) → suppress host info entirely and describe only the backend. A live
    uname
    /
    whoami
    /
    pwd
    probe runs inside the backend via
    tools.environments.get_environment(...).execute(...)
    , cached per process in
    _BACKEND_PROBE_CACHE
    , with a static fallback if the probe times out.
  • Key fact for prompt authoring: when
    TERMINAL_ENV != "local"
    , every file tool (
    read_file
    ,
    write_file
    ,
    patch
    ,
    search_files
    ) runs inside the backend container, not on the host. The system prompt must never describe the host in that case — the agent can't touch it.
Full design notes, the exact emitted strings, and testing pitfalls:
references/prompt-builder-environment-hints.md
.
Refactor-safety pattern (POSIX-equivalence guard): when you extract inline logic into a helper that adds Windows/platform-specific behavior, keep a
_legacy_<name>
oracle function in the test file that's a verbatim copy of the old code, then parametrize-diff against it. Example:
tests/tools/test_code_execution_windows_env.py::TestPosixEquivalence
. This locks in the invariant that POSIX behavior is bit-for-bit identical and makes any future drift fail loudly with a clear diff.
关于主机OS、用户主目录、cwd、终端后端和Shell(Windows上的bash vs. PowerShell)的事实指导,从
agent/prompt_builder.py::build_environment_hints()
生成。这也是WSL提示和每个后端探测逻辑所在的位置。约定:
  • 本地终端后端 → 生成主机信息(OS、
    $HOME
    、cwd) + Windows特定说明(主机名≠用户名,
    terminal
    使用bash而非PowerShell)。
  • 远程终端后端
    _REMOTE_TERMINAL_BACKENDS
    中的任何后端:
    docker, singularity, modal, daytona, ssh, managed_modal
    ) → 完全抑制主机信息,仅描述后端。通过
    tools.environments.get_environment(...).execute(...)
    在后端内部运行实时
    uname
    /
    whoami
    /
    pwd
    探测,每个进程在
    _BACKEND_PROBE_CACHE
    中缓存,如果探测超时则使用静态回退。
  • 提示编写的关键事实:当
    TERMINAL_ENV != "local"
    时,所有文件工具(
    read_file
    write_file
    patch
    search_files
    )都在后端容器内运行,而不是在主机上。系统提示在这种情况下绝不能描述主机——Agent无法触及它。
完整设计说明、确切生成的字符串和测试陷阱:
references/prompt-builder-environment-hints.md
重构安全模式(POSIX等效性保护): 当你将内联逻辑提取到添加Windows/平台特定行为的辅助函数时,在测试文件中保留一个
_legacy_<name>
oracle函数,它是旧代码的逐字副本,然后参数化地与它进行差异比较。示例:
tests/tools/test_code_execution_windows_env.py::TestPosixEquivalence
。这锁定了POSIX行为完全相同的不变量,任何未来的偏差都会通过清晰的差异明显失败。

Commit Conventions

提交约定

type: concise subject line

Optional body.
Types:
fix:
,
feat:
,
refactor:
,
docs:
,
chore:
type: 简洁的主题行

可选正文。
类型:
fix:
feat:
refactor:
docs:
chore:

Key Rules

关键规则

  • Never break prompt caching — don't change context, tools, or system prompt mid-conversation
  • Message role alternation — never two assistant or two user messages in a row
  • Use
    get_hermes_home()
    from
    hermes_constants
    for all paths (profile-safe)
  • Config values go in
    config.yaml
    , secrets go in
    .env
  • New tools need a
    check_fn
    so they only appear when requirements are met
  • 永远不要破坏提示缓存 —— 不要在对话中途更改上下文、工具或系统提示
  • 消息角色交替 —— 永远不要连续出现两条助手或两条用户消息
  • 使用
    hermes_constants
    中的
    get_hermes_home()
    获取所有路径(支持配置文件)
  • 配置值放在
    config.yaml
    中,机密放在
    .env
  • 新工具需要
    check_fn
    ,以便仅在满足要求时显示