Hermes Agent 安裝教學:從零到上手5分鐘全攻略
Hermes Agent作為2026年最受矚目的開源AI代理框架,安裝過程極其簡化,一行指令即可完成所有環境配置與部署。這份完整教學涵蓋Windows、macOS、Linux三大平台,包含常見踩雷排除與進階生產環境設定,讓香港開發者快速部署個人AI助手。
Hermes Agent最低需求:
作業系統:Linux(Ubuntu 20.04+)、macOS 12+ 或 Windows(WSL2)
Python:3.11+(自動安裝)
記憶體:4GB+ RAM(8GB推薦)
儲存空間:2GB+(技能庫隨使用增長)
網路:穩定連線(下載依賴與模型)
香港用戶注意:家用寬頻足夠,建議使用Hostinger或Vultr VPS(月費HK$50起)避免Token延遲。
這是最簡單途徑,官方腳本自動處理Python虛擬環境、Node.js、ripgrep、ffmpeg等20+依賴。
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
1. 啟用WSL2(5分鐘):
# 以系統管理員身分開PowerShell
wsl --install
# 重開機後從Microsoft Store安裝Ubuntu 22.04
2.進入Ubuntu終端,執行上述curl指令
安裝完成標誌:
✓ Hermes Agent v0.8.0+ installed successfully
✓ Global 'hermes' command available
✓ Configuration wizard ready: hermes setup
適用需要自訂環境或離線部署:
# 1. 安裝Python 3.11(Ubuntu範例)
sudo apt update && sudo apt install python3.11 python3.11-venv python3-pip git curl
# 2. 克隆儲存庫(重要:包含子模組)
git clone --recurse-submodules https://github.com/NousResearch/hermes-agent.git
cd hermes-agent
# 3. 建立虛擬環境
python3.11 -m venv venv
source venv/bin/activate # Windows: venvScriptsactivate
# 4. 安裝依賴
pip install -e ".[all]"
pip install -e "./tinker-atropos"
npm install
# 5. 建立設定目錄
mkdir -p ~/.hermes/{cron,sessions,logs,memories,skills}
cp cli-config.yaml.example ~/.hermes/config.yaml
# 6. 建立全域指令
sudo ln -sf "$(pwd)/venv/bin/hermes" /usr/local/bin/hermes
執行首次設定,所有選項都有安全預設:
hermes setup
關鍵設定說明:
1. LLM Provider [OpenRouter/Anthropic/OpenAI] → 輸入1(OpenRouter免費額度足夠)
2. API Key → 貼上你的 sk-or-v1-xxx(OpenRouter官網取得)
3. 預設模型 → qwen2.5-coder:7b(免費高效)
4. 記憶體容量 → 4096(預設足夠)
5. 啟用Telegram閘道?[Y/n] → Y(香港最方便)
香港用戶最愛的無縫體驗:
# 1. 建立Bot(Telegram搜尋 @BotFather)
/newbot → 取名HermesHK → 取得TOKEN
# 2. 取得User ID(搜尋 @userinfobot)
直接傳送訊息給機器人,複製回傳的數字
# 3. 設定環境變數
echo "TELEGRAM_TOKEN=你的TOKEN" >> ~/.hermes/.env
echo "TELEGRAM_USER_ID=你的ID" >> ~/.hermes/.env
# 4. 啟動閘道
hermes gateway start telegram
測試指令:Telegram傳送 /status,應回傳「Hermes Agent v0.8.0 已啟動」
# docker-compose.yml
version: '3.8'
services:
hermes:
image: python:3.11-slim
container_name: hermes-agent
volumes:
- ./hermes-agent:/app
- hermes_data:/data
- ./config:/root/.hermes
environment:
- PYTHONPATH=/app
- HERMES_CONFIG_DIR=/root/.hermes
ports:
- "8000:8000" # Web UI(選用)
command: sh -c "pip install -e . && hermes gateway start"
restart: unless-stopped
healthcheck:
test: ["CMD", "hermes", "status"]
interval: 30s
timeout: 10s
retries: 3
volumes:
hermes_data:
執行:docker-compose up -d
| 問題 | 解決方案 |
|---|---|
curl: command not found |
sudo apt install curl |
hermes: command not found |
source ~/.bashrc 或重開終端 |
| Telegram不回應 | 檢查 .env 檔案語法,無空格 |
| OpenRouter連不上 | 香港用 mirror 網路模式,非 NAT |
| 記憶體不足 | VPS升級至2GB RAM或關閉語音功能 |
| WSL2網路異常 | wsl --shutdown 後重開PowerShell |
# 診斷工具(必跑)
hermes doctor
# 檢查狀態
hermes status
# 進入互動模式
hermes chat
# 列出技能
hermes skills list
# 查看記憶體使用
hermes memory stats
Hermes Agent v0.8.0 (stable)
3 LLM providers configured
118 skills loaded
Memory: 2.1MB / 4GB (52%)
Gateways: Telegram, Discord
# 匯出OpenClaw記憶
cp ~/.claw/sessions/* ~/.hermes/sessions/
cp ~/.claw/skills/* ~/.hermes/skills/
# Hermes自動轉換格式
hermes migrate openclaw
#!/bin/bash
# hermes-vps-deploy.sh(香港Vultr優化)
apt update && apt upgrade -y
apt install htop ufw curl git -y
ufw allow 22 && ufw allow 443 && ufw enable
# 一鍵安裝+Telegram
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
hermes setup --non-interactive --telegram
# 開機啟動
crontab -l > mycron
echo "@reboot /home/ubuntu/.local/bin/hermes gateway start telegram" >> mycron
crontab mycron
echo "Hermes Agent 已部署!傳送 /status 到Telegram測試"
Hermes Agent安裝完成後,你的AI將開始自我學習之旅。首次使用重點培養專屬技能,越用越符合你的遊戲開發、課程設計或奢侈品行銷需求,真正實現「專屬AI秘書」。立即部署,開啟智慧自動化新紀元!
可以瀏覽/報讀 「香港AI學院」的 「Hermes Agent AI教學課程」以了解及學習更多Hermes Agent各種設定、功能、技巧和應用。