Skip to main content

配置文件命令参考

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

hermes profile

hermes profile <subcommand>

这是管理配置文件的顶级命令。不带子命令运行 hermes profile 时,会显示帮助信息。

子命令描述
list列出所有配置文件。
use设置活动(默认)配置文件。
create创建新配置文件。
delete删除配置文件。
show显示某个配置文件的详细信息。
alias为配置文件重新生成 shell 别名。
rename重命名配置文件。
export将配置文件导出为 tar.gz 压缩包。
import从 tar.gz 压缩包导入配置文件。

hermes profile list

hermes profile list

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

示例:

$ hermes profile list
default
* work
dev
personal

无选项。

hermes profile use

hermes profile use <name>

<name> 设为当前活动配置文件。之后所有未显式使用 -phermes 命令,都会默认使用它。

参数描述
<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跳过包装脚本的创建。

示例:

# Blank profile — needs full setup
hermes profile create mybot

# Clone config only from current profile
hermes profile create work --clone

# Clone everything from current profile
hermes profile create backup --clone-all

# Clone config from a specific profile
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
warning

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

hermes profile show

hermes profile show <name>

显示某个配置文件的详细信息,包括主目录、当前模型、网关状态、技能数量以及配置文件状态。

参数描述
<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
# Creates/updates ~/.local/bin/work

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

hermes profile alias work --remove
# Removes the wrapper script

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
# Creates work.tar.gz in the current directory

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

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 类型:bashzsh

示例:

# 安装补全
hermes completion bash >> ~/.bashrc
hermes completion zsh >> ~/.zshrc

# 重新加载 shell
source ~/.bashrc

安装后,Tab 补全功能支持:

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

参见