终端工具支持 7 种后端,适应不同的安全隔离和运行环境需求:
选择建议:
默认先用 local,适合本机开发和可信任务
不信任任务内容、担心误改本机文件时,用 docker
目标环境在远程服务器上时,用 ssh
HPC / 集群环境优先考虑 singularity
需要云端隔离或弹性资源时,考虑 modal、daytona、vercel_sandbox
后端 说明 适用场景
local 在本机直接执行(默认) 本地开发、可信任务
docker 隔离容器中执行 安全隔离、可复现环境
ssh 远程服务器执行 沙箱化,防止 Agent 修改自身代码
singularity HPC 容器(Apptainer) 集群计算、无 root 环境
modal 云端无服务器执行 弹性伸缩
daytona 云端沙箱工作区 持久化远程开发环境
vercel_sandbox Vercel 云端微虚拟机 部署与长期运行进程
桌面版切换后端:
修改完询问 Hermes Agent 当前工作目录是什么,是指定目录才修改正确。如果修改失败用命令行更稳妥
切换终端后端为docker:设置------高级------执行后端下拉选择 docker
image-20260705223409060
修改工作区:设置------工作区------工作目录(默认是.,修改成/workspace)
image-20260705223433357
cmd拉取镜像:docker pull nikolaik/python-nodejs:python3.11-nodejs20
前提:需要已经安装并打开了Docker Desktop
重启Hermes Agent桌面版,后面Hermes Agent执行的命令和输出的文件都是在docker镜像中了
命令行切换后端:
切换终端后端为docker
hermes config set terminal.backend docker
切换终端后端为本地电脑
hermes config set terminal.backend local
【Docker安装时配置过可以忽略】配置国内的镜像(在docker desktop中配置)
"registry-mirrors": [
]
使用docker desktop拉取正确的镜像
docker pull nikolaik/python-nodejs:python3.11-nodejs20
各后端的具体配置示例:
~/.hermes/config.yaml
terminal:
backend: docker
modal_mode: auto
cwd: /workspace
timeout: 180
daemon_term_grace_seconds: 2
env_passthrough: \[\]
home_mode: auto
shell_init_files: \[\]
auto_source_bashrc: true
docker_image: nikolaik/python-nodejs:python3.11-nodejs20
docker_forward_env: \[\]
docker_env: {}
singularity_image: docker://nikolaik/python-nodejs:python3.11-nodejs20
modal_image: nikolaik/python-nodejs:python3.11-nodejs20
daytona_image: nikolaik/python-nodejs:python3.11-nodejs20
container_cpu: 1
container_memory: 5120
container_disk: 51200
container_persistent: true
docker_volumes: \[\]
docker_mount_cwd_to_workspace: false
docker_extra_args: \[\]
docker_run_as_host_user: false
persistent_shell: true
lifetime_seconds: 300
如需挂载宿主机目录:
volumes:
- /home/user/project:/workspace
SSH 后端 --- 在远程服务器上执行命令
backend: ssh
ssh:
host: "192.168.1.100"
port: 22
user: "hermes"
# 认证方式二选一:
key_path: "~/.ssh/id_ed25519" # SSH 密钥
# password: "***" # 或密码(推荐放 .env)
Modal 后端 --- 云端无服务器执行
backend: modal
modal:
token_id: "ak-xxxx" # Modal API token ID(放 .env)
token_secret: "as-xxxx" # Modal API token secret(放 .env)
当命令需要 sudo 权限时,终端会提示输入密码(会话内缓存)。也可以在 ~/.hermes/.env 中设置 SUDO_PASSWORD 环境变量。
4.4 并行工具执行
Hermes 支持通过 ThreadPoolExecutor 并行执行多个独立的工具调用(最多 8 个并行 worker)。当 Agent 在同一轮中发出多个互不依赖的工具调用时,它们会自动并行执行,显著减少总耗时。
4.5 Smart Approvals 智能审批
受 Codex CLI 启发,Hermes 会学习哪些命令是安全的。当你反复批准同一类命令(如 git status、ls),Hermes 会逐步减少审批提示。审批模式可以通过 /yolo 切换。
4.6 Post-Write Linting 写入后检查(v0.13+)
Agent 通过 patch 或 write_file 写入文件后,会自动进行格式检查,支持 Python、JSON、YAML、TOML。这减少了 Agent 写入格式错误内容的概率。
MCP(Model Context Protocol)可以把外部工具服务器接入 Hermes。
5.1 添加 MCP 服务器
配置示例:project-fs是本地MCP案例;company_api是外部MCP案例
~/.hermes/config.yaml
mcp_servers:
project-fs:
command: "npx"
args: "-y", "@modelcontextprotocol/server-filesystem", "/home/user/my-project"
company_api:
url: "https://mcp.internal.example.com/mcp"
headers:
Authorization: "Bearer ***"
上面两个 server 分别代表两种传输方式:
模式 配置方式 工作方式 适用场景
stdio command + args Hermes 在本机启动 MCP server 进程,通过 stdin / stdout 与其通信 本地文件系统、CLI 工具、开发环境里的集成
HTTP url Hermes 连接一个已经运行的 MCP server 公司内部服务、远程 API、共享的工具服务器
常用配置项:
配置项 说明
command 本地 stdio MCP Server 的启动命令
args 传给启动命令的参数
env 传给 stdio server 的环境变量
url 远程 HTTP MCP Server 地址
headers 远程 HTTP 请求头
auth: oauth 仅用于 HTTP server,启用 OAuth 2.1 授权流程
enabled 是否启用该 server
timeout 工具调用超时时间
connect_timeout 初次连接超时时间
auth: oauth 通常需要一次浏览器交互式授权。授权完成后,Hermes 会缓存授权结果,后续调用复用已授权 token。
推荐使用魔搭广场 https://www.modelscope.cn/mcp
可以在每个 server 下配置 tools.include 或 tools.exclude,来控制注册工具白名单或黑名单:
~/.hermes/config.yaml
mcp_servers:
github:
command: "npx"
args: "-y", "@modelcontextprotocol/server-github"
env:
GITHUB_PERSONAL_ACCESS_TOKEN: "***"
tools:
include: list_issues, create_issue, update_issue, search_code
resources: false
prompts: false
stripe:
url: "https://mcp.stripe.com"
headers:
Authorization: "Bearer ***"
tools:
exclude: delete_customer, refund_payment
5.2 管理与重载
桌面版可以直接管理并重载
hermes mcp list # 列出已配置的服务器
hermes mcp test project-fs # 测试连接
hermes mcp configure project-fs # 管理服务器中的工具启用状态
hermes mcp remove project-fs # 移除服务器
/reload-mcp # 修改配置后,在会话内重载 MCP 工具
Hermes 启动时会自动发现 MCP 工具。修改 mcp_servers 配置后,用 /reload-mcp 重新加载;如果 MCP Server 支持动态工具变更通知,Hermes 可以自动刷新工具列表。
5.3 MCP Server Mode 反向暴露【重要,操作实用】
MCP Server Mode 是 Hermes 的一个独特功能:它反过来把 Hermes 的会话暴露给 MCP 兼容的客户端。这意味着你可以在 Claude Desktop、VS Code、Cursor 等支持 MCP 的工具中,把 Hermes 当作一个工具服务器来使用。
配置方式:在 MCP 客户端配置中将 Hermes 注册为 MCP server,客户端就可以调用 Hermes 的能力。
例如在 Claude Desktop 中,编辑 claude_desktop_config.json:
{
"mcpServers": {
"hermes-agent": {
"command": "hermes",
"args": "mcp", "serve"
}
}
}
配置后重启 Claude Desktop,即可在对话中调用 Hermes 的所有已启用工具。VS Code 和 Cursor 的配置方式类似,将同样的 server 定义加入对应客户端的 mcpServers 配置块即可。
5.4 Nous-Approved MCP Catalog(v0.15+)
v0.15 引入了 Nous 精选的 MCP 服务器目录,提供交互式选择器。不用再去 GitHub 搜索 MCP server,直接在 Hermes 里浏览和安装:
hermes mcp catalog # 浏览精选 MCP 目录
- SKILL 技能系统
官方文档:https://hermes-agent.nousresearch.com/docs/user-guide/features/skills
Skills 是 Hermes Agent 最核心的差异化能力------自进化。Agent 解决复杂问题后,会把可复用流程保存为 Skill,下次遇到类似任务时自动加载。Skill 是透明的人类可读 Markdown 文件,你可以随时查看、编辑或删除。
Skills 系统包含 166 个已追踪的技能(87 个内置 + 79 个可选),覆盖 26+ 个类别。已安装的技能会以斜杠命令的形式提供。
1.1 基本操作
hermes skills list # 列出已安装的技能
hermes skills browse # 浏览可用的技能
hermes skills search honcho # 搜索技能
hermes skills install honcho # 通过 ID 安装技能
hermes skills install https://example.com/my-skill/SKILL.md # 通过 URL 安装技能
hermes skills uninstall honcho # 卸载技能
/skills # 会话内管理技能
1.2 技能目录结构
所有技能默认存放在 ~/.hermes/skills/:以下是HermesSKILL目录的解释
~/.hermes/skills/
├── mlops/ # 类别目录
│ ├── axolotl/ # 技能目录
│ │ ├── SKILL.md # 主说明文件,必需
│ │ ├── references/ # 额外参考资料
│ │ ├── templates/ # 输出模板
│ │ ├── scripts/ # 技能可调用的辅助脚本
│ │ └── assets/ # 图片、数据等附加资源
│ └── vllm/
│ └── SKILL.md
├── devops/
│ └── deploy-k8s/
│ ├── SKILL.md
│ └── references/
├── .hub/ # Skills Hub 状态
│ ├── lock.json
│ ├── quarantine/
│ └── audit.log
└── .bundled_manifest # 记录内置技能同步状态
SKILL.md 是每个技能的入口文件。references/、templates/、scripts/、assets/ 都是可选目录。
可以把 Skill 粗略分成三种层级:
类型 例子 含义
普通具体 Skill mlops/axolotl 面向某个具体工具或流程
总括型 Skill(umbrella) mlops/training 覆盖一组相关流程
类别级总括型 Skill software-development/debugging 抽象到任务类别
一个完整的 SKILL.md 示例(~/.hermes/skills/writing/tech-blog/SKILL.md):
Technical Blog Post Writing
Write technical blog posts targeting AI/ML developers. Follow this workflow:
Pre-writing
- Read all provided research summaries
- Identify 3-5 key takeaways that readers will find actionable
- Check for conflicting claims --- flag them before writing
Structure
- Hook (100-150 words): Start with a real problem or surprising finding
- Background (200-300 words): Context that makes the topic accessible
- Deep Dive (1000-1500 words): Core content with code examples
- Implications (200-300 words): Why this matters for practitioners
- Key Takeaways (bullet points): 3-5 actionable conclusions
Code Examples
- Must be complete and runnable
- Use Python 3.11+ syntax
- Include error handling in production-facing code
- Prefer
uvoverpipfor package management commands
Language
- Main content in Chinese, technical terms in English
- Target 2000-2500 words
- Avoid passive voice in Chinese
Frontmatter Template
yaml
---
title: "<English Title>"
date: <YYYY-MM-DD>
tags: [<3-5 relevant tags>]
author: "AI+Human"
---
可以看到,SKILL.md 就是一份结构化的工作指南,Agent 加载后会自动按照其中的流程执行。