跳到主要内容

配置文件命令参考

本页涵盖与 Hermes 配置文件相关的所有命令。通用 CLI 命令请参阅 CLI 命令参考

hermes profile

hermes profile <subcommand>

管理配置文件的顶层命令。不带子命令运行 hermes profile 将显示帮助信息。

子命令描述
list列出所有配置文件。
use设置活动(默认)配置文件。
create创建新配置文件。
delete删除配置文件。
show显示配置文件详情。
alias重新生成配置文件的 Shell 别名。
rename重命名配置文件。
export将配置文件导出为 tar.gz 归档。
import从 tar.gz 归档导入配置文件。
install从 git URL 或本地目录安装配置文件分发版。详见配置文件分发版
update重新拉取分发版管理的配置文件并重新应用其 bundle。
info显示配置文件的分发版元数据(源 URL、提交、最后更新)。

hermes profile list

hermes profile list

列出所有配置文件。当前活动的配置文件以 * 标记。

示例:

$ hermes profile list
default
* work
dev
personal

无选项。

hermes profile use

hermes profile use <name>

<name> 设置为活动配置文件。后续所有 hermes 命令(未指定 -p)都将使用此配置文件。

参数描述
<name>要激活的配置文件名称。使用 default 返回基础配置文件。

示例:

hermes profile use work
hermes profile use default

hermes profile create

hermes profile create <name> [options]

创建新配置文件。

参数 / 选项描述
<name>新配置文件的名称。必须是有效的目录名(字母数字、连字符、下划线)。
--clone从当前配置文件复制 config.yaml.envSOUL.md
--clone-all从当前配置文件复制所有内容(配置、记忆、技能、会话、状态)。
--clone-from <profile>从指定配置文件克隆,而非当前配置文件。与 --clone--clone-all 配合使用。
--no-alias跳过包装脚本创建。

创建配置文件不会将该配置文件目录设置为终端命令的默认项目/工作区目录。如果希望配置文件在特定项目中启动,请在该配置文件的 config.yaml 中设置 terminal.cwd

示例:

# 空白配置文件——需要完整设置
hermes profile create mybot

# 仅从当前配置文件克隆配置
hermes profile create work --clone

# 从当前配置文件克隆所有内容
hermes profile create backup --clone-all

# 从指定配置文件克隆配置
hermes profile create work2 --clone --clone-from work

hermes profile delete

hermes profile delete <name> [options]

删除配置文件并移除其 Shell 别名。

参数 / 选项描述
<name>要删除的配置文件。
--yes, -y跳过确认提示。

示例:

hermes profile delete mybot
hermes profile delete mybot --yes
注意

此操作会永久删除配置文件的整个目录,包括所有配置、记忆、会话和技能。无法删除当前活动的配置文件。

hermes profile show

hermes profile show <name>

显示配置文件的详细信息,包括其主目录、已配置的模型、网关状态、技能数量和配置文件状态。

此命令显示的是配置文件的 Hermes 主目录,而非终端工作目录。终端命令从 terminal.cwd 启动(在本地后端且 cwd: "." 时为启动目录)。

参数描述
<name>要检查的配置文件。

示例:

$ hermes profile show work
Profile: work
Path: ~/.hermes/profiles/work
Model: anthropic/claude-sonnet-4 (anthropic)
Gateway: stopped
Skills: 12
.env: exists
SOUL.md: exists
Alias: ~/.local/bin/work

hermes profile alias

hermes profile alias <name> [options]

~/.local/bin/<name> 重新生成 Shell 别名脚本。在别名被意外删除,或移动 Hermes 安装位置后需要更新时非常有用。

参数 / 选项描述
<name>要创建/更新别名的配置文件。
--remove删除包装脚本而非创建。
--name <alias>自定义别名名称(默认:配置文件名称)。

示例:

hermes profile alias work
# 创建/更新 ~/.local/bin/work

hermes profile alias work --name mywork
# 创建 ~/.local/bin/mywork

hermes profile alias work --remove
# 移除包装脚本

hermes profile rename

hermes profile rename <old-name> <new-name>

重命名配置文件,同时更新目录和 Shell 别名。

参数描述
<old-name>当前配置文件名称。
<new-name>新配置文件名称。

示例:

hermes profile rename mybot assistant
# ~/.hermes/profiles/mybot → ~/.hermes/profiles/assistant
# ~/.local/bin/mybot → ~/.local/bin/assistant

hermes profile export

hermes profile export <name> [options]

将配置文件导出为压缩的 tar.gz 归档。

参数 / 选项描述
<name>要导出的配置文件。
-o, --output <path>输出文件路径(默认:<name>.tar.gz)。

示例:

hermes profile export work
# 在当前目录创建 work.tar.gz

hermes profile export work -o ./work-2026-03-29.tar.gz

hermes profile import

hermes profile import <archive> [options]

从 tar.gz 归档导入配置文件。

参数 / 选项描述
<archive>要导入的 tar.gz 归档路径。
--name <name>导入配置文件的名称(默认:从归档推断)。

示例:

hermes profile import ./work-2026-03-29.tar.gz
# 从归档推断配置文件名称

hermes profile import ./work-2026-03-29.tar.gz --name work-restored

分发版命令

提示

初次了解分发版? 请先阅读配置文件分发版用户指南——它涵盖了为什么、何时以及如何使用,并附有完整示例。以下章节是给知道想要什么的人看的简洁 CLI 参考。

分发版将配置文件转变为可通过 git 仓库 发布的可共享、有版本管理的制品。接收者只需一条命令即可安装分发版,之后可以在不触及本地记忆、会话或凭据的情况下就地更新。

auth.json.env 永远不会包含在分发版中——它们保留在安装用户的机器上。

接收者的用户数据(记忆、会话、认证、其对 .env 的自己的编辑)在初始安装和后续更新中始终被保留。

信息

hermes profile export / import 仍然是在您自己的机器上本地备份和恢复配置文件的正确命令。分发版(install / update / info)是一个独立的概念:通过 git 分发配置文件,以便其他人可以安装它。

hermes profile install

hermes profile install <source> [--name <name>] [--alias] [--force] [--yes]

从 git URL 或本地目录安装配置文件分发版。

选项描述
<source>Git URL(github.com/user/repohttps://...git@...ssh://git://)或包含根目录 distribution.yaml 的本地目录。
--name NAME覆盖清单中的配置文件名称。
--alias同时创建 Shell 包装器(例如 telemetryhermes -p telemetry)。
--force覆盖同名的现有配置文件。用户数据仍会被保留。
-y, --yes跳过清单预览确认提示。

安装程序会显示清单、列出所需的环境变量,并在要求确认之前警告有关 cron 作业的内容。所需的环境变量会进入 .env.EXAMPLE 文件,您可以复制到 .env 并填写。

示例:

# 从 GitHub 仓库安装(简写形式)
hermes profile install github.com/kyle/telemetry-distribution --alias

# 从完整 HTTPS git URL 安装
hermes profile install https://github.com/kyle/telemetry-distribution.git

# 从 SSH 安装
hermes profile install git@github.com:kyle/telemetry-distribution.git

# 在开发期间从本地目录安装
hermes profile install ./telemetry/

hermes profile update

hermes profile update <name> [--force-config] [--yes]

从记录的源重新克隆分发版并应用更新。分发版拥有的文件(SOUL.md、skills/、cron/、mcp.json)会被覆盖;用户数据(记忆、会话、认证、.env)永远不会被触及。

config.yaml 默认保留,以保持您的本地覆盖。传递 --force-config 将其重置为分发版随附的配置。

hermes profile info

hermes profile info <name>

打印配置文件的分发版清单——名称、版本、所需的 Hermes 版本、作者、环境变量要求、源 URL 和最后一次 installupdate 记录的 Installed: 时间戳。在安装之前检查共享配置文件需要什么时很有用,也可以用来发现"这个配置文件是 6 个月前安装的,一直没有更新"。

hermes profile list 也会在 Distribution 列中显示分发版名称和版本,hermes profile show <name> / delete <name> 会显示源 URL,以便您可以一目了然地看出哪些配置文件来自 git 仓库,哪些是在本地创建的。

私有分发版

私有 git 仓库可以作为分发版源,无需额外配置——安装程序会调用您正常的 git 二进制文件,因此您的 shell 已经设置的任何认证(SSH 密钥、git credential 助手、GitHub CLI 存储的 HTTPS 凭据)都会透明地应用。

# 使用您的 SSH 密钥,就像任何其他 `git clone` 一样
hermes profile install git@github.com:your-org/internal-assistant.git

# 使用您的 git credential 助手
hermes profile install https://github.com/your-org/internal-assistant.git

如果克隆过程中在终端中提示输入凭据,该提示会正常传递。请先按照您通常使用 git clone 访问同一仓库的方式设置好认证,然后再运行安装程序。

分发版清单(distribution.yaml

每个分发版在其仓库根目录都有一个 distribution.yaml

name: telemetry
version: 0.1.0
description: "Compliance monitoring harness"
hermes_requires: ">=0.12.0"
author: "Your Name"
license: "MIT"
env_requires:
- name: OPENAI_API_KEY
description: "OpenAI API key"
required: true
- name: GRAPHITI_MCP_URL
description: "Memory graph URL"
required: false
default: "http://127.0.0.1:8000/sse"
distribution_owned: # 可选;默认为 SOUL.md、config.yaml、
# mcp.json、skills/、cron/、distribution.yaml
- SOUL.md
- skills/compliance/
- cron/

hermes_requires 支持 >=<===!=>< 或裸版本号(视为 >=)。如果当前 Hermes 版本不满足规范,安装将失败并显示明确的错误。

distribution_owned 是可选的。如果设置,则仅这些路径会在更新时被替换;配置文件中的其他内容仍为用户拥有。如果省略,则适用上述默认值。

发布分发版

创作分发版只需 git push

  1. 在您的配置文件目录中,至少使用 nameversion 创建 distribution.yaml
  2. 初始化 git 仓库(或使用现有的)并推送到 GitHub / GitLab / Hermes 可以克隆的任何主机。
  3. 告诉接收者运行 hermes profile install <your-repo-url>

使用 git 标签进行版本化发布——克隆 HEAD 的接收者会获取您的最新状态,您始终可以在清单中更新 version:

hermes -p / hermes --profile

hermes -p <name> <command> [options]
hermes --profile <name> <command> [options]

全局标志,用于在特定配置文件下运行任何 Hermes 命令,而不更改默认配置文件。在命令执行期间,此标志会覆盖活动配置文件。

选项描述
-p <name>, --profile <name>此命令使用的配置文件。

示例:

hermes -p work chat -q "Check the server status"
hermes --profile dev gateway start
hermes -p personal skills list
hermes -p work config edit

hermes completion

hermes completion <shell>

生成 Shell 补全脚本,包含配置文件名称和配置文件子命令的补全。

参数描述
<shell>要生成补全脚本的 Shell:bashzshfish

示例:

# 安装补全脚本
hermes completion bash >> ~/.bashrc
hermes completion zsh >> ~/.zshrc
hermes completion fish > ~/.config/fish/completions/hermes.fish

# 重新加载 Shell
source ~/.bashrc

安装后,Tab 补全适用于:

  • hermes profile <TAB> — 子命令(list、use、create 等)
  • hermes profile use <TAB> — 配置文件名称
  • hermes -p <TAB> — 配置文件名称

另请参阅