配置文件命令參考
本頁面涵蓋與 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
* 工作
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、.env 和 SOUL.md。 |
--clone-all | 從當前配置文件複製全部內容(配置、記憶、技能、會話、狀態)。 |
--clone-from <profile> | 從指定配置文件而非當前配置文件進行克隆。與 --clone 或 --clone-all 一起使用。 |
示例:
# 空白 profile — 需要完整設置
hermes profile create mybot
# 僅從當前 profile 克隆配置
hermes profile create work --clone
# 克隆當前 profile 中的所有內容
hermes profile create backup --clone-all
# 從特定 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
注意
此操作將永久刪除配置文件的整個目錄,包括所有配置、記憶、會話和技能。無法刪除當前活動的配置文件。
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
# 創建/updates ~/.local/bin/work
hermes profile alias work --name mywork
# 創建“0”
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
# 從存檔推斷 profile 名稱
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:bash 或 zsh。 |
示例:
# 安裝完成情況
hermes completion bash >> ~/.bashrc
hermes completion zsh >> ~/.zshrc
# 重新加載外殼
source ~/.bashrc
安裝完成後,以下命令支持自動補全功能:
hermes profile <TAB>— 子命令(list、use、create 等)hermes profile use <TAB>— 配置文件名稱hermes -p <TAB>— 配置文件名稱