Created
April 12, 2026 09:21
-
-
Save halu0915/6bb7bf911a1f146df9b4e03623d3cff6 to your computer and use it in GitHub Desktop.
Hermes Agent 一鍵安裝腳本 (macOS)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Hermes Agent 一鍵安裝腳本(macOS) | |
| # 用法:bash install-hermes.sh | |
| echo "🤖 Hermes Agent 一鍵安裝" | |
| echo "=========================" | |
| HERMES_HOME="$HOME/.hermes" | |
| # 1. 檢查 Python 3.11 | |
| echo "" | |
| echo "📦 步驟 1/5:檢查 Python..." | |
| if ! command -v python3.11 &>/dev/null; then | |
| echo " 安裝 Python 3.11..." | |
| brew install python@3.11 | |
| else | |
| echo " ✅ Python 3.11 已安裝" | |
| fi | |
| # 2. Clone Hermes | |
| echo "" | |
| echo "📦 步驟 2/5:下載 Hermes Agent..." | |
| if [ -d "$HERMES_HOME/hermes-agent" ]; then | |
| echo " ✅ Hermes 已存在,跳過" | |
| else | |
| mkdir -p "$HERMES_HOME" | |
| git clone https://github.com/NousResearch/hermes-agent.git "$HERMES_HOME/hermes-agent" | |
| echo " ✅ 下載完成" | |
| fi | |
| # 3. Setup venv and install | |
| echo "" | |
| echo "📦 步驟 3/5:安裝依賴..." | |
| cd "$HERMES_HOME/hermes-agent" | |
| python3.11 -m venv venv | |
| source venv/bin/activate | |
| pip install -r requirements.txt 2>&1 | tail -3 | |
| echo " ✅ 依賴安裝完成" | |
| # 4. Create config | |
| echo "" | |
| echo "📦 步驟 4/5:建立設定檔..." | |
| if [ ! -f "$HERMES_HOME/config.yaml" ]; then | |
| cat > "$HERMES_HOME/config.yaml" << 'YAML' | |
| model: | |
| default: "qwen/qwen3.5-397b-a17b" | |
| provider: "openrouter" | |
| language: "zh-TW" | |
| YAML | |
| echo " ✅ config.yaml 建立完成" | |
| else | |
| echo " ⏭️ config.yaml 已存在" | |
| fi | |
| # 5. Prompt for API keys | |
| echo "" | |
| echo "📦 步驟 5/5:設定 API Key..." | |
| if [ ! -f "$HERMES_HOME/.env" ]; then | |
| echo "" | |
| read -p " 請輸入 OpenRouter API Key(到 openrouter.ai 取得): " OPENROUTER_KEY | |
| read -p " 請輸入 Telegram Bot Token(從 @BotFather 取得): " BOT_TOKEN | |
| cat > "$HERMES_HOME/.env" << ENVFILE | |
| OPENROUTER_API_KEY=$OPENROUTER_KEY | |
| TELEGRAM_BOT_TOKEN=$BOT_TOKEN | |
| ENVFILE | |
| echo " ✅ .env 建立完成" | |
| else | |
| echo " ⏭️ .env 已存在" | |
| fi | |
| # Create SOUL.md | |
| if [ ! -f "$HERMES_HOME/SOUL.md" ]; then | |
| cat > "$HERMES_HOME/SOUL.md" << 'SOUL' | |
| # Hermes Agent — AI 助理 | |
| ## 身份 | |
| 你是個人 AI 助理,使用繁體中文溝通。 | |
| ## 性格 | |
| - 簡潔有力,不廢話 | |
| - 數據導向,結論先行 | |
| - 專業但親切 | |
| SOUL | |
| echo " ✅ SOUL.md 建立完成" | |
| fi | |
| echo "" | |
| echo "=========================================" | |
| echo "✅ Hermes Agent 安裝完成!" | |
| echo "" | |
| echo "啟動方式:" | |
| echo " cd ~/.hermes/hermes-agent && source venv/bin/activate && cd ~/.hermes && python -m gateway.run" | |
| echo "" | |
| echo "或建立啟動捷徑:" | |
| echo " echo 'alias hermes-start=\"cd ~/.hermes/hermes-agent && source venv/bin/activate && cd ~/.hermes && python -m gateway.run\"' >> ~/.zprofile" | |
| echo " source ~/.zprofile" | |
| echo " hermes-start" | |
| echo "" | |
| echo "Telegram Bot 啟動後就能在 Telegram 對話了。" | |
| echo "=========================================" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment