fix: Support OAuth for Antigravity/Gemini, make fallback optional

This commit is contained in:
devmatrix 2026-02-16 16:55:55 +00:00
parent 7a6ab55297
commit 341ea9bd98
1 changed files with 59 additions and 41 deletions

View File

@ -1,30 +1,25 @@
#!/bin/bash #!/bin/bash
# Configure API Keys for DevMatrix # 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 "🔐 DevMatrix API Key Configuration"
echo "===================================" echo "==================================="
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: " echo -n "Enter your Kimi API Key: "
read -s KIMI_KEY read -s KIMI_KEY
echo "" echo ""
# Read Antigravity API Key if [ -n "$KIMI_KEY" ]; then
echo -n "Enter your Antigravity API Key: " mkdir -p ~/.openclaw/config
read -s ANTIGRAVITY_KEY
echo "" cat > ~/.openclaw/config/kimi.yaml << EOF
# Create config directory
mkdir -p ~/.openclaw/config
# Save Kimi config
cat > ~/.openclaw/config/kimi.yaml << EOF
provider: kimi provider: kimi
name: "Kimi K2.5" name: "Kimi K2.5"
auth: auth:
@ -40,34 +35,57 @@ models:
routing: routing:
priority: 1 priority: 1
EOF EOF
# Save Antigravity config chmod 600 ~/.openclaw/config/kimi.yaml
cat > ~/.openclaw/config/antigravity.yaml << EOF echo "✅ Kimi configured"
provider: antigravity else
name: "Antigravity" echo "⚠️ Kimi key not provided (you can add later)"
auth: fi
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
echo "" echo ""
echo "✅ API Keys configured!"
# ============================================
# ANTIGRAVITY / GEMINI (Optional)
# ============================================
echo "📍 Antigravity / Gemini Configuration (Optional Fallback)"
echo "" echo ""
echo "Config files created:" echo "Antigravity and Gemini use OAuth (not API keys)."
echo " ~/.openclaw/config/kimi.yaml" echo ""
echo " ~/.openclaw/config/antigravity.yaml" 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 ""
echo "Test with: openclaw models list" echo "Test with: openclaw models list"
echo "" echo ""