A+B 混合方案 — 本機桌面版 GUI → 遠端主機 Hermes
方案 A:遠端 Dashboard(瀏覽器) · 方案 B:remote-worker profile(SSH 遙控)
這不是二選一 — A 和 B 疊在一起用效果最好。
| 方案 A(Dashboard) | 方案 B(remote-worker) | |
|---|---|---|
| 介面 | 瀏覽器開遠端 Web UI | 桌面版 GUI 聊天框 |
| 體驗 | 完整 Hermes — 工具、記憶、skill 全有 | 像在跟遠端 agent 對話 |
| 適合 | 長時間操作、複雜任務 | 快速下指令、看結果 |
| 安全 | 建議 SSH tunnel | 純 SSH,不需開 port |
遠端開 Hermes Dashboard,本機瀏覽器直接操控。最簡單、功能最完整。
user@local ~ $ ssh user@remote-ip
user@remote ~ $ nohup hermes dashboard --port 9119 --host 0.0.0.0 --no-open \
> ~/.hermes/dashboard.log 2>&1 &
確認啟動成功:
user@remote ~ $ sleep 3 && curl -s http://127.0.0.1:9119 | head -5 …
--host 0.0.0.0 表示任何知道 IP 的人都能連。
除非你有防火牆只允許本機 IP,否則強烈建議下面兩種做法選一種。
如果遠端有 security group / firewall 只放行你 IP:
本機瀏覽器
http://remote-ip:9119
確認防火牆有放行 :9119
不用開防火牆,走 SSH 加密:
本機終端機
ssh -L 9119:localhost:9119 \
user@remote-ip -N
留著別關,瀏覽器開 http://127.0.0.1:9119
~/.ssh/config:LocalForward 9119 localhost:9119
user@remote ~ $ hermes dashboard --stop user@remote ~ $ # 或直接看 PID: user@remote ~ $ lsof -i :9119 | grep LISTEN user@remote ~ $ kill <PID>
在本機 desktop GUI 建一個 profile,所有指令透過 SSH 送去遠端 Hermes 執行、結果接回來顯示。不用離開聊天畫面。
user@local ~ $ hermes profile create remote-worker user@local ~ $ hermes profile list default · remote-worker ← 新的
這個 skill 讓 profile 理解「使用者輸入 → SSH 給遠端 → 回傳結果」的工作流程。
user@local ~ $ mkdir -p ~/.hermes/profiles/remote-worker/skills/remote-exec
cat <<'SKILL' > ~/.hermes/profiles/remote-worker/skills/remote-exec/SKILL.md --- name: remote-exec description: SSH 到遠端主機執行 Hermes 指令並回傳結果 --- # remote-exec 當 user 下達工作指令時: 1. 用 shell 命令 SSH 到遠端主機,執行hermes chat -q "<使用者指令>" -Q2. 把遠端 stdout/stderr 接回來作為回答 ## SSH 連線設定 - 主機:REMOTE_IP- 使用者:REMOTE_USER- 認證:SSH key(需先 ssh-copy-id) ## 注意 - 每個指令都是獨立的一次性呼叫(無 session 狀態) - 結果純文字,不含 tool call 細節 - 如果指令超過 30 秒,放寬 timeout SKILL
然後把 REMOTE_IP 和 REMOTE_USER 換成真實值:
user@local ~ $ sed -i '' 's/REMOTE_IP/your.remote.ip/' \ ~/.hermes/profiles/remote-worker/skills/remote-exec/SKILL.md user@local ~ $ sed -i '' 's/REMOTE_USER/your-username/' \ ~/.hermes/profiles/remote-worker/skills/remote-exec/SKILL.md
這個 profile 預設的 terminal 指令也在本機執行。如果希望「檔案讀寫、目錄列表」也走遠端:
user@local ~ $ hermes --profile remote-worker config set terminal.backend ssh user@local ~ $ hermes --profile remote-worker config set terminal.ssh.host REMOTE_IP user@local ~ $ hermes --profile remote-worker config set terminal.ssh.user REMOTE_USER
打開 Hermes Desktop → 設定 / profile 選單 → 切到 remote-worker。
或 terminal 啟動時指定:
user@local ~ $ hermes --profile remote-worker
現在在聊天框輸入任何指令,Hermes 就會 SSH 到遠端執行 hermes chat -q "..." 並回傳結果。
在 remote-exec skill 中補上執行指令的 exact command:
## 執行模式 遠端執行使用 SSH 一次性呼叫: ssh -t REMOTE_USER@REMOTE_IP 'hermes chat -q "<指令>" -Q 2>&1' --t確保 PTY 分配,避免 SSH 報錯 --Q讓 hermes 安靜模式,只輸出答案 -2>&1連錯誤一起抓回來 ## 多步驟任務 如果 user 要求多步驟任務,將每一步用 SSH 順序執行, 前面的結果作為後面指令的 context 帶入。
兩個方案不衝突 — 桌面版開 remote-worker profile 快速下指令,同時瀏覽器開 Dashboard 做深度操作。
| 時機 | 用哪個 | 為什麼 |
|---|---|---|
| 「檢查狀態、跑一個指令」 | B — 桌面版 profile | 不用離開聊天,10 秒搞定 |
| 「幫我 refactor 那個 module」 | A — Dashboard | 需要完整工具鏈、檔案讀寫、多輪來回 |
| 「每天 09:00 給我報告」 | B + cron | profile 內的 cron job 排 SSH 指令 |
| 「我在外面,用手機看一下主機」 | A — tunnel + 手機瀏覽器 | Dashboard 響應式,手機也能用 |
| 「寫 code,本機編輯遠端跑」 | A+B | Dashboard 寫 code + profile 下 build 指令 |
# Terminal 1 — SSH tunnel for Dashboard ssh -L 9119:localhost:9119 user@remote-ip -N # 瀏覽器開 http://127.0.0.1:9119 # Terminal 2 — local Hermes with remote-worker profile hermes --profile remote-worker # 桌面版 GUI 聊天框 ← 你在這裡
兩個方案都依賴 SSH,先搞定 key-based auth 省去每次打密碼。
user@local ~ $ ssh-keygen -t ed25519 -f ~/.ssh/id_remote_hermes -N "" user@local ~ $ ssh-copy-id -i ~/.ssh/id_remote_hermes user@remote-ip user@local ~ $ cat >> ~/.ssh/config <<'CONF' Host remote-hermes HostName remote-ip User your-username IdentityFile ~/.ssh/id_remote_hermes LocalForward 9119 localhost:9119 CONF
之後全部簡化成:
user@local ~ $ ssh remote-hermes -N # tunnel user@local ~ $ ssh remote-hermes # 登入
更新到最新版:hermes update。Dashboard 是內建功能,不需要額外安裝。
方案 A 用 nohup 啟動 Dashboard 就不受 SSH 斷線影響。方案 B 每個指令獨立的,斷線重連就好。
macOS 加 ~/.ssh/config 的 LocalForward 然後設 launchd。Linux 用 systemd user service 或 autossh。
對。遠端的 hermes chat -q 是在遠端主機上執行的,所以讀寫、執行都是遠端的環境。本機只負責 SSH 轉送指令和結果。