diff --git a/configure_api_keys.sh b/configure_api_keys.sh index 9f4bcbc..a018558 100644 --- a/configure_api_keys.sh +++ b/configure_api_keys.sh @@ -1,30 +1,25 @@ #!/bin/bash # Configure API Keys for DevMatrix -# Run this to add your Kimi and Antigravity API keys +# Supports: Kimi (API key) and Antigravity/Gemini (OAuth) echo "🔐 DevMatrix API Key Configuration" echo "===================================" echo "" -echo "You will need:" -echo " 1. Kimi API Key (from https://kimi.moonshot.cn/)" -echo " 2. Antigravity API Key (from your provider)" -echo "" -# Read Kimi API Key +# ============================================ +# KIMI API KEY +# ============================================ +echo "📍 Kimi Configuration (Primary AI)" +echo "Get your API key from: https://kimi.moonshot.cn/" +echo "" echo -n "Enter your Kimi API Key: " read -s KIMI_KEY echo "" -# Read Antigravity API Key -echo -n "Enter your Antigravity API Key: " -read -s ANTIGRAVITY_KEY -echo "" - -# Create config directory -mkdir -p ~/.openclaw/config - -# Save Kimi config -cat > ~/.openclaw/config/kimi.yaml << EOF +if [ -n "$KIMI_KEY" ]; then + mkdir -p ~/.openclaw/config + + cat > ~/.openclaw/config/kimi.yaml << EOF provider: kimi name: "Kimi K2.5" auth: @@ -40,34 +35,57 @@ models: routing: priority: 1 EOF - -# Save Antigravity config -cat > ~/.openclaw/config/antigravity.yaml << EOF -provider: antigravity -name: "Antigravity" -auth: - type: api_key - key: "$ANTIGRAVITY_KEY" -models: - primary: - id: "mixtral-8x7b" - max_tokens: 32000 - secondary: - id: "qwen2.5-coder" - max_tokens: 32000 -routing: - priority: 2 -EOF - -# Set permissions -chmod 600 ~/.openclaw/config/*.yaml + + chmod 600 ~/.openclaw/config/kimi.yaml + echo "✅ Kimi configured" +else + echo "⚠️ Kimi key not provided (you can add later)" +fi echo "" -echo "✅ API Keys configured!" + +# ============================================ +# ANTIGRAVITY / GEMINI (Optional) +# ============================================ +echo "📍 Antigravity / Gemini Configuration (Optional Fallback)" echo "" -echo "Config files created:" -echo " ~/.openclaw/config/kimi.yaml" -echo " ~/.openclaw/config/antigravity.yaml" +echo "Antigravity and Gemini use OAuth (not API keys)." +echo "" +echo "Choose an option:" +echo " 1) Set up Gemini CLI (free, recommended)" +echo " 2) Set up Antigravity (if you have access)" +echo " 3) Skip for now (Kimi only)" +echo "" +echo -n "Choice (1/2/3): " +read CHOICE + +case $CHOICE in + 1) + echo "" + echo "Setting up Gemini CLI..." + echo "This will open a browser for OAuth login." + echo "" + openclaw plugins enable google-gemini-cli-auth 2>/dev/null || true + openclaw models auth login --provider google-gemini-cli --set-default + echo "✅ Gemini CLI configured" + ;; + 2) + echo "" + echo "Setting up Antigravity..." + echo "This will open a browser for OAuth login." + echo "" + openclaw plugins enable google-antigravity-auth 2>/dev/null || true + openclaw models auth login --provider google-antigravity --set-default + echo "✅ Antigravity configured" + ;; + 3|*) + echo "⚠️ Skipping fallback AI (Kimi only)" + ;; +esac + +echo "" +echo "===================================" +echo "✅ Configuration complete!" echo "" echo "Test with: openclaw models list" echo ""