跳到主要內容

CLI 命令參考

本頁面涵蓋您從 shell 中運行的 終端命令

有關聊天中的斜槓命令,請參閱 斜槓命令參考

全局入口點

hermes [global-options] <command> [subcommand/options]

全局選項

選項描述
--version, -V顯示版本並退出。
--profile <name>, -p <name>為本次調用選擇要使用的 Hermes 配置文件。覆蓋由 hermes profile use 設置的持久默認值。
--resume <session>, -r <session>通過 ID 或標題恢復之前的會話。
--continue [name], -c [name]恢復最近的會話,或恢復與標題匹配的最近會話。
--worktree, -w為並行 Agent 工作流啟動一個隔離的 git 工作樹。
--yolo跳過危險命令的審批提示。
--pass-session-id將會話 ID 包含在 Agent 的系統提示中。

頂層命令

命令用途
hermes chat與 Agent 進行交互式或單次對話。
hermes model交互式選擇默認提供者和模型。
hermes gateway運行或管理消息網關服務。
hermes setup交互式設置嚮導,用於全部或部分配置。
hermes whatsapp配置並配對 WhatsApp 橋接。
hermes auth管理憑據 — 添加、列出、刪除、重置、設置策略。處理 Codex/Nous/Anthropic 的 OAuth 流程。
hermes login / logout已棄用 — 請改用 hermes auth
hermes status顯示 Agent、認證和平臺狀態。
hermes cron檢查並觸發定時調度器。
hermes webhook管理事件驅動激活的動態 Webhook 訂閱。
hermes doctor診斷配置和依賴項問題。
hermes dump可複製粘貼的設置摘要,用於支持/調試。
hermes logs查看、實時跟蹤和過濾 Agent/網關/錯誤日誌文件。
hermes config顯示、編輯、遷移和查詢配置文件。
hermes pairing批准或撤銷消息配對碼。
hermes skills瀏覽、安裝、發佈、審計和配置技能。
hermes honcho管理 Honcho 跨會話記憶集成。
hermes memory配置外部記憶提供者。
hermes acp以 ACP 服務器模式運行 Hermes,用於編輯器集成。
hermes mcp管理 MCP 服務器配置,並以 MCP 服務器模式運行 Hermes。
hermes plugins管理 Hermes Agent 插件(安裝、啟用、禁用、移除)。
hermes tools配置各平臺啟用的工具。
hermes sessions瀏覽、導出、清理、重命名和刪除會話。
hermes insights顯示 token/成本/活動分析。
hermes clawOpenClaw 遷移輔助工具。
hermes profile管理配置文件 — 多個隔離的 Hermes 實例。
hermes completion輸出 shell 補全腳本(bash/zsh)。
hermes version顯示版本信息。
hermes update拉取最新代碼並重新安裝依賴項。
hermes uninstall從系統中移除 Hermes。

hermes chat

hermes chat [options]

常用選項:

選項描述
-q, --query "..."單次、非交互式提示。
-m, --model <model>覆蓋本次運行的模型。
-t, --toolsets <csv>啟用逗號分隔的工具集。
--provider <provider>強制指定提供者:autoopenrouternousopenai-codexcopilot-acpcopilotanthropichuggingfacezaikimi-codingminimaxminimax-cndeepseekai-gatewayopencode-zenopencode-gokilocodealibaba
-s, --skills <name>為會話預加載一個或多個技能(可重複或以逗號分隔)。
-v, --verbose詳細輸出。
-Q, --quiet程序化模式:抑制橫幅/旋轉圖標/工具預覽。
--resume <session> / --continue [name]直接從 chat 命令中恢復會話。
--worktree為此運行創建一個隔離的 git 工作樹。
--checkpoints在破壞性文件更改前啟用文件系統檢查點。
--yolo跳過審批提示。
--pass-session-id將會話 ID 傳遞到系統提示中。
--source <tag>會話來源標籤,用於過濾(默認:cli)。使用 tool 表示第三方集成,不應出現在用戶會話列表中。
--max-turns <N>每輪對話的最大工具調用迭代次數(默認:90,或配置中的 agent.max_turns)。

示例:

hermes
hermes chat -q "Summarize the latest PRs"
hermes chat --provider openrouter --model anthropic/claude-sonnet-4.6
hermes chat --toolsets web,terminal,skills
hermes chat --quiet -q "Return only JSON"
hermes chat --worktree -q "Review this repo and open a PR"

hermes model

交互式提供者 + 模型選擇器。

hermes model

在以下情況下使用此命令:

  • 切換默認提供者
  • 在模型選擇過程中登錄 OAuth 支持的提供者
  • 從提供者特定的模型列表中選擇
  • 配置自定義/自託管端點
  • 將新默認值保存到配置中

/model 斜槓命令(會話中)

在不離開會話的情況下切換模型:

/model                              # 顯示當前 Model 和可用選項
/model claude-sonnet-4 # 切換 Model(自動識別 Provider)
/model zai:glm-5 # 切換 Provider 和 Model
/model custom:qwen-2.5 # 使用自定義端點上的 Model
/model custom # 從自定義端點自動檢測 Model
/model custom:local:qwen-2.5 # 使用具名自定義 Provider
/model openrouter:anthropic/claude-sonnet-4 # 切回雲端 Model

提供方和基礎 URL 的更改會自動保存到 config.yaml 中。當切換出自定義端點時,舊的基礎 URL 會被清除,以防止洩露到其他提供方。

hermes gateway

hermes gateway <subcommand>

子命令:

子命令描述
run在前臺運行網關。
start啟動已安裝的網關服務。
stop停止服務。
restart重啟服務。
status顯示服務狀態。
install作為用戶服務安裝(Linux 上為 systemd,macOS 上為 launchd)。
uninstall移除已安裝的服務。
setup交互式消息平臺設置。

hermes setup

hermes setup [model|terminal|gateway|tools|agent] [--non-interactive] [--reset]

使用完整嚮導,或直接跳轉到某個部分:

部分描述
model提供方和模型設置。
terminal終端後端和沙箱設置。
gateway消息平臺設置。
tools按平臺啟用/禁用工具。
agentAgent 行為設置。

選項:

選項描述
--non-interactive使用默認值 / 環境變量,不進行提示。
--reset在設置前將配置重置為默認值。

hermes whatsapp

hermes whatsapp

運行 WhatsApp 配對/設置流程,包括模式選擇和二維碼配對。

hermes login / hermes logout (已棄用)

警告

hermes login 已移除。請使用 hermes auth 管理 OAuth 憑證,使用 hermes model 選擇提供方,或使用 hermes setup 進行完整交互式設置。

hermes auth

管理同一提供方的憑證池以實現密鑰輪換。詳見 憑證池 獲取完整文檔。

hermes auth                                              # 啟動交互式嚮導
hermes auth list # 顯示所有憑證池
hermes auth list openrouter # 顯示指定 Provider
hermes auth add openrouter --api-key sk-or-v1-xxx # 添加 API key
hermes auth add anthropic --type oauth # 添加 OAuth 憑證
hermes auth remove openrouter 2 # 按索引刪除
hermes auth reset openrouter # 清除冷卻狀態

子命令:addlistremovereset。若未指定子命令,則啟動交互式管理嚮導。

hermes status

hermes status [--all] [--deep]
選項描述
--all以可共享的脫敏格式顯示所有詳細信息。
--deep執行更深入的檢查,可能耗時更長。

hermes cron

hermes cron <list|create|edit|pause|resume|run|remove|status|tick>
子命令描述
list顯示已安排的任務。
create / add從提示創建一個計劃任務,可選地通過重複 --skill 附加一個或多個技能。
edit更新任務的調度、提示、名稱、交付方式、重複次數或附加技能。支持 --clear-skills--add-skill--remove-skill
pause暫停任務但不刪除。
resume恢復暫停的任務,並計算其下一次未來運行時間。
run在下一個調度器 tick 觸發任務。
remove刪除已安排的任務。
status檢查 cron 調度器是否正在運行。
tick執行所有到期的任務一次後退出。

hermes webhook

hermes webhook <subscribe|list|remove|test>

管理用於事件驅動 Agent 激活的動態 Webhook 訂閱。需要在配置中啟用 Webhook 平臺——若未配置,將打印設置說明。

子命令描述
subscribe / add創建一個 Webhook 路由。返回 URL 和 HMAC 密鑰,用於在您的服務上配置。
list / ls顯示所有 Agent 創建的訂閱。
remove / rm刪除一個動態訂閱。配置文件中的靜態路由不受影響。
test發送測試 POST 請求以驗證訂閱是否正常工作。

hermes webhook subscribe

hermes webhook subscribe <name> [options]
選項描述
--prompt包含 {dot.notation} 負載引用的提示模板。
--events以逗號分隔的要接受的事件類型(例如 issues,pull_request)。空值 = 所有事件。
--description人類可讀的描述。
--skills以逗號分隔的技能名稱,用於 Agent 運行時加載。
--deliver交付目標:log(默認)、telegramdiscordslackgithub_comment
--deliver-chat-id用於跨平臺交付的目標聊天/頻道 ID。
--secret自定義 HMAC 密鑰。若省略則自動生成。

訂閱會持久化保存至 ~/.hermes/webhook_subscriptions.json,並由 Webhook 適配器熱重載,無需重啟網關。

hermes doctor

hermes doctor [--fix]
選項描述
--fix儘可能嘗試自動修復。

hermes dump

hermes dump [--show-keys]

輸出您整個 Hermes 設置的緊湊、純文本摘要。專為複製粘貼到 Discord、GitHub 問題或 Telegram 中請求支持而設計——無 ANSI 顏色,無特殊格式,僅包含數據。

選項描述
--show-keys顯示脫敏的 API 密鑰前綴(前 4 個和後 4 個字符),而非僅顯示 set/not set

包含內容

區段詳情
頭部Hermes 版本、發佈日期、git 提交哈希
環境操作系統、Python 版本、OpenAI SDK 版本
身份活躍配置文件名稱、HERMES_HOME 路徑
模型配置的默認模型和提供方
終端後端類型(本地、docker、ssh 等)
API 密鑰所有 22 個提供方/工具 API 密鑰的存在性檢查
功能已啟用的工具集、MCP 服務器數量、記憶提供方
服務網關狀態、配置的消息平臺
工作負載定時任務數量、已安裝技能數量
配置覆蓋與默認值不同的任何配置值

示例輸出

--- hermes dump ---
version: 0.8.0 (2026.4.8) [af4abd2f]
os: Linux 6.14.0-37-generic x86_64
python: 3.11.14
openai_sdk: 2.24.0
profile: default
hermes_home: ~/.hermes
model: anthropic/claude-opus-4.6
provider: openrouter
terminal: local

api_keys:
openrouter set
openai not set
anthropic set
nous not set
firecrawl set
...

features:
toolsets: all
mcp_servers: 0
memory_provider: built-in
gateway: running (systemd)
platforms: telegram, discord
cron_jobs: 3 active / 5 total
skills: 42

config_overrides:
agent.max_turns: 250
compression.threshold: 0.85
display.streaming: True
--- end dump ---

使用場景

  • 在 GitHub 上報告 bug —— 將轉儲內容粘貼到問題中
  • 在 Discord 中尋求幫助 —— 以代碼塊形式分享
  • 與他人設置進行對比
  • 當某項功能異常時快速進行健康檢查
提示

hermes dump 專為共享設計。如需交互式診斷,請使用 hermes doctor。如需可視化概覽,請使用 hermes status

hermes logs

hermes logs [log_name] [options]

查看、實時跟蹤和過濾 Hermes 日誌文件。所有日誌均存儲在 ~/.hermes/logs/(非默認配置文件則為 <profile>/logs/)。

日誌文件

名稱文件記錄內容
agent(默認)agent.log所有 Agent 活動 —— API 調用、工具分發、會話生命週期(INFO 及以上級別)
errorserrors.log僅記錄警告和錯誤 —— agent.log 的過濾子集
gatewaygateway.log消息網關活動 —— 平臺連接、消息分發、Webhook 事件

選項

選項描述
log_name要查看的日誌:agent(默認)、errorsgateway,或 list 以顯示可用文件及其大小。
-n, --lines <N>顯示的行數(默認:50)。
-f, --follow實時跟蹤日誌,類似 tail -f。按 Ctrl+C 停止。
--level <LEVEL>顯示的最低日誌級別:DEBUGINFOWARNINGERRORCRITICAL
--session <ID>過濾包含會話 ID 子串的日誌行。
--since <TIME>顯示從相對時間前開始的日誌行:30m1h2d 等。支持 s(秒)、m(分鐘)、h(小時)、d(天)。

示例

# 查看 agent.log 的最後 50 行(默認)
hermes logs

# 實時跟蹤 agent.log
hermes logs -f

# 查看 gateway.log 的最後 100 行
hermes logs gateway -n 100

# 僅顯示過去一小時的警告和錯誤
hermes logs --level WARNING --since 1h

# 按特定 session 過濾
hermes logs --session abc123

# 從 30 分鐘前開始跟蹤 error.log
hermes logs errors --since 30m -f

# 列出所有日誌文件及其大小
hermes logs list

過濾

可組合多個過濾條件。當啟用多個過濾器時,日誌行必須通過全部條件才會顯示:

# 查看過去 2 小時內包含 session "tg-12345" 的 WARNING+ 日誌
hermes logs --level WARNING --since 2h --session tg-12345

--since 激活時,無法解析時間戳的行也會被包含(可能是多行日誌條目的延續行)。當 --level 激活時,無法檢測到級別的行也會被包含。

日誌輪轉

Hermes 使用 Python 的 RotatingFileHandler 實現日誌輪轉。舊日誌會自動輪轉 —— 可見 agent.log.1agent.log.2 等文件。hermes logs list 子命令可顯示所有日誌文件(包括輪轉後的文件)。

hermes config

hermes config <subcommand>

子命令:

子命令描述
show顯示當前配置值。
edit在編輯器中打開 config.yaml
set <key> <value>設置一個配置值。
path打印配置文件路徑。
env-path打印 .env 文件路徑。
check檢查缺失或過期的配置。
migrate交互式添加新引入的選項。

hermes pairing

hermes pairing <list|approve|revoke|clear-pending>
子命令描述
list顯示待處理和已批准的用戶。
approve <platform> <code>批准一個配對碼。
revoke <platform> <user-id>撤銷用戶的訪問權限。
clear-pending清除待處理的配對碼。

hermes skills

hermes skills <subcommand>

子命令:

子命令描述
browse分頁式瀏覽器,用於技能註冊表。
search搜索技能註冊表。
install安裝一個技能。
inspect在不安裝的情況下預覽一個技能。
list列出已安裝的技能。
check檢查已安裝的 hub 技能是否有上游更新。
update當上遊有更新時,重新安裝 hub 技能。
audit重新掃描已安裝的 hub 技能。
uninstall卸載一個 hub 安裝的技能。
publish將一個技能發佈到註冊表。
snapshot導出/導入技能配置。
tap管理自定義技能源。
config交互式地按平臺啟用/禁用技能配置。

常見示例:

hermes skills browse
hermes skills browse --source official
hermes skills search react --source skills-sh
hermes skills search https://mintlify.com/docs --source well-known
hermes skills inspect official/security/1password
hermes skills inspect skills-sh/vercel-labs/json-render/json-render-react
hermes skills install official/migration/openclaw-migration
hermes skills install skills-sh/anthropics/skills/pdf --force
hermes skills check
hermes skills update
hermes skills config

備註:

  • --force 可覆蓋第三方/社區技能的非危險策略限制。
  • --force 不會覆蓋 dangerous 掃描結果。
  • --source skills-sh 用於搜索公共的 skills.sh 目錄。
  • --source well-known 允許 Hermes 指向一個提供 /.well-known/skills/index.json 的站點。

hermes honcho

hermes honcho [--target-profile NAME] <subcommand>

管理 Honcho 跨會話記憶集成。此命令由 Honcho 記憶提供方插件提供,僅當配置中 memory.provider 設置為 honcho 時可用。

--target-profile 標誌允許你在不切換到該配置文件的情況下管理另一個配置文件的 Honcho 配置。

子命令:

子命令描述
setup重定向到 hermes memory setup(統一的設置路徑)。
status [--all]顯示當前 Honcho 配置和連接狀態。--all 顯示跨配置文件的概覽。
peers顯示所有配置文件中的對等身份。
sessions列出已知的 Honcho 會話映射。
map [name]將當前目錄映射到一個 Honcho 會話名稱。省略 name 以列出當前映射。
peer顯示或更新對等名稱和辯證推理級別。選項:--user NAME--ai NAME--reasoning LEVEL
mode [mode]顯示或設置回憶模式:hybridcontexttools。省略以顯示當前模式。
tokens顯示或設置上下文和辯證的 token 預算。選項:--context N--dialectic N
identity [file] [--show]種子或顯示 AI 對等身份表示。
enable為當前活動配置文件啟用 Honcho。
disable為當前活動配置文件禁用 Honcho。
sync將 Honcho 配置同步到所有現有配置文件(創建缺失的主機塊)。
migrate從 openclaw-honcho 遷移到 Hermes Honcho 的逐步遷移指南。

hermes memory

hermes memory <subcommand>

設置和管理外部記憶提供者插件。可用提供者:honcho、openviking、mem0、hindsight、holographic、retaindb、byterover、supermemory。同一時間只能激活一個外部提供者。內置記憶(MEMORY.md/USER.md)始終處於激活狀態。

子命令:

子命令描述
setup交互式提供者選擇和配置。
status顯示當前記憶提供者配置。
off禁用外部提供者(僅限內置)。

hermes acp

hermes acp

以 ACP(Agent Client Protocol)stdio 服務器模式啟動 Hermes,用於編輯器集成。

相關入口點:

hermes-acp
python -m acp_adapter

請先安裝支持:

pip install -e '.[acp]'

參見 ACP 編輯器集成ACP 內部原理

hermes mcp

hermes mcp <subcommand>

管理 MCP(Model Context Protocol)服務器配置,並以 MCP 服務器模式運行 Hermes。

子命令描述
serve [-v|--verbose]以 MCP 服務器模式運行 Hermes — 向其他智能體暴露對話。
add <name> [--url URL] [--command CMD] [--args ...] [--auth oauth|header]添加一個 MCP 服務器並自動發現工具。
remove <name>(別名:rm從配置中移除一個 MCP 服務器。
list(別名:ls列出已配置的 MCP 服務器。
test <name>測試與 MCP 服務器的連接。
configure <name>(別名:config切換服務器的工具選擇。

參見 MCP 配置參考使用 Hermes 的 MCPMCP 服務器模式

hermes plugins

hermes plugins [subcommand]

統一的插件管理 —— 在一處管理通用插件、記憶提供者和上下文引擎。運行 hermes plugins 且無子命令時,將打開一個複合交互界面,包含兩個部分:

  • 通用插件 —— 多選複選框,用於啟用/禁用已安裝的插件
  • 提供者插件 —— 單選配置,用於記憶提供者和上下文引擎。按 ENTER 鍵進入單選選擇器。
子命令描述
(無)複合交互界面 —— 通用插件開關 + 提供者插件配置。
install <identifier> [--force]從 Git URL 或 owner/repo 安裝插件。
update <name>拉取已安裝插件的最新更改。
remove <name>(別名:rmuninstall移除已安裝的插件。
enable <name>啟用已禁用的插件。
disable <name>禁用插件但不移除。
list(別名:ls列出已安裝的插件及其啟用/禁用狀態。

提供者插件的選擇將保存至 config.yaml

  • memory.provider —— 激活的記憶提供者(空值 = 僅內置)
  • context.engine —— 激活的上下文引擎("compressor" = 內置默認)

通用插件的禁用列表存儲在 config.yamlplugins.disabled 中。

參見 插件構建一個 Hermes 插件

hermes tools

hermes tools [--summary]
選項描述
--summary打印當前啟用工具的摘要並退出。

未使用 --summary 時,將啟動按平臺劃分的交互式工具配置 UI。

hermes sessions

hermes sessions <subcommand>

子命令:

子命令描述
list列出最近的會話。
browse支持搜索和恢復的交互式會話選擇器。
export <output> [--session-id ID]將會話導出為 JSONL 格式。
delete <session-id>刪除一個會話。
prune刪除舊的會話。
stats顯示會話存儲的統計信息。
rename <session-id> <title>設置或更改會話標題。

hermes insights

hermes insights [--days N] [--source platform]
選項描述
--days <n>分析最近的 n 天(默認:30)。
--source <platform>按來源過濾,例如 clitelegramdiscord

hermes claw

hermes claw migrate [options]

將你的 OpenClaw 設置遷移到 Hermes。從 ~/.openclaw(或自定義路徑)讀取數據,並寫入 ~/.hermes。自動檢測舊版目錄名(~/.clawdbot~/.moldbot)和配置文件名(clawdbot.jsonmoldbot.json)。

選項描述
--dry-run預覽將要遷移的內容,但不寫入任何數據。
--preset <name>遷移預設:full(默認,包含密鑰)或 user-data(不包含 API 密鑰)。
--overwrite在衝突時覆蓋現有的 Hermes 文件(默認:跳過)。
--migrate-secrets在遷移中包含 API 密鑰(使用 --preset full 時默認啟用)。
--source <path>自定義的 OpenClaw 目錄(默認:~/.openclaw)。
--workspace-target <path>工作區指令(AGENTS.md)的目標目錄。
--skill-conflict <mode>處理技能名稱衝突:skip(默認)、overwriterename
--yes跳過確認提示。

遷移內容

遷移涵蓋超過 30 個類別,包括角色設定、記憶、技能、模型提供者、消息平臺、Agent 行為、會話策略、MCP 服務器、TTS 等。項目要麼直接導入到 Hermes 對應項中,要麼歸檔以供手動審查。

直接導入: SOUL.md、MEMORY.md、USER.md、AGENTS.md、技能(4 個源目錄)、默認模型、自定義提供者、MCP 服務器、消息平臺令牌和白名單(Telegram、Discord、Slack、WhatsApp、Signal、Matrix、Mattermost)、Agent 默認設置(推理力度、壓縮、人類延遲、時區、沙箱)、會話重置策略、審批規則、TTS 配置、瀏覽器設置、工具設置、執行超時、命令白名單、網關配置,以及來自 3 個來源的 API 密鑰。

歸檔以供手動審查: 定時任務、插件、鉤子/Webhook、記憶後端(QMD)、技能註冊表配置、UI/身份、日誌、多 Agent 設置、頻道綁定、IDENTITY.md、TOOLS.md、HEARTBEAT.md、BOOTSTRAP.md。

API 密鑰解析 按優先級檢查三個來源:配置值 → ~/.openclaw/.envauth-profiles.json。所有令牌字段支持純字符串、環境變量模板(${VAR})和 SecretRef 對象。

有關完整的配置鍵映射、SecretRef 處理細節以及遷移後檢查清單,請參閱 完整遷移指南

示例

# 預覽將遷移的內容
hermes claw migrate --dry-run

# 完整遷移(包含 API 密鑰)
hermes claw migrate --preset full

# 僅遷移用戶數據(不含密鑰),覆蓋衝突
hermes claw migrate --preset user-data --overwrite

# 從自定義 OpenClaw 路徑遷移
hermes claw migrate --source /home/user/old-openclaw

hermes profile

hermes profile <subcommand>

管理配置文件 —— 多個隔離的 Hermes 實例,每個實例擁有獨立的配置、會話、技能和主目錄。

子命令描述
list列出所有配置文件。
use <name>設置一個持久默認配置文件。
create <name> [--clone] [--clone-all] [--clone-from <source>] [--no-alias]創建新配置文件。--clone 從當前活動配置文件複製配置、.envSOUL.md--clone-all 複製全部狀態。--clone-from 指定源配置文件。
delete <name> [-y]刪除配置文件。
show <name>顯示配置文件詳情(主目錄、配置等)。
alias <name> [--remove] [--name NAME]管理快捷訪問配置文件的包裝腳本。
rename <old> <new>重命名配置文件。
export <name> [-o FILE]將配置文件導出為 .tar.gz 歸檔文件。
import <archive> [--name NAME].tar.gz 歸檔文件導入配置文件。

示例:

hermes profile list
hermes profile create work --clone
hermes profile use work
hermes profile alias work --name h-work
hermes profile export work -o work-backup.tar.gz
hermes profile import work-backup.tar.gz --name restored
hermes -p work chat -q "Hello from work profile"

hermes completion

hermes completion [bash|zsh]

將 shell 補全腳本輸出到 stdout。在 shell 配置文件中源碼該輸出,以實現 Hermes 命令、子命令和配置文件名的 Tab 補全。

示例:

# Bash
hermes completion bash >> ~/.bashrc

# Zsh
hermes completion zsh >> ~/.zshrc

維護命令

命令描述
hermes version打印版本信息。
hermes update拉取最新更改並重新安裝依賴。
hermes uninstall [--full] [--yes]卸載 Hermes,可選地刪除所有配置/數據。

參見