Files
ClaudeCode-Custom-Skills/skills/claw-setup/scripts/fetch-models.sh
Claude Code 2072e16bd1 feat: Add Claw Setup skill for AI Agent deployment
End-to-end professional setup of AI Agent platforms:
- OpenClaw (full-featured, 215K stars)
- NanoBot (Python, lightweight)
- PicoClaw (Go, ultra-light)
- ZeroClaw (Rust, minimal)
- NanoClaw (WhatsApp focused)

Features:
- Platform selection with comparison
- Security hardening (secrets, network, systemd)
- Interactive brainstorming for customization
- AI provider configuration with 12+ providers
- Model fetching from provider APIs
- Custom model input support

Providers supported:
Anthropic, OpenAI, Google, OpenRouter, Groq,
Cerebras, Together AI, DeepSeek, Mistral, xAI, Ollama

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 03:44:25 -05:00

112 lines
3.6 KiB
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# fetch-models.sh - Fetch available models from AI providers
# Usage: ./fetch-models.sh [provider]
set -e
GREEN='\033[0;32m'
BLUE='\033[0;34m'
NC='\033[0m'
echo -e "${BLUE}╔═══════════════════════════════════════════════════════════════╗${NC}"
echo -e "${BLUE}║ AI PROVIDER MODEL FETCHER ║${NC}"
echo -e "${BLUE}╚═══════════════════════════════════════════════════════════════╝${NC}"
fetch_openrouter() {
if [ -n "$OPENROUTER_API_KEY" ]; then
echo -e "\n${GREEN}📦 OpenRouter Models:${NC}"
curl -s https://openrouter.ai/api/v1/models \
-H "Authorization: Bearer $OPENROUTER_API_KEY" | \
jq -r '.data[] | " • \(.id)"' | head -30
else
echo -e "\n⚠ OPENROUTER_API_KEY not set"
fi
}
fetch_openai() {
if [ -n "$OPENAI_API_KEY" ]; then
echo -e "\n${GREEN}📦 OpenAI Models:${NC}"
curl -s https://api.openai.com/v1/models \
-H "Authorization: Bearer $OPENAI_API_KEY" | \
jq -r '.data[] | select(.id | test("gpt|o1|o3")) | " • \(.id)"' | sort -u
else
echo -e "\n⚠ OPENAI_API_KEY not set"
fi
}
fetch_groq() {
if [ -n "$GROQ_API_KEY" ]; then
echo -e "\n${GREEN}📦 Groq Models:${NC}"
curl -s https://api.groq.com/openai/v1/models \
-H "Authorization: Bearer $GROQ_API_KEY" | \
jq -r '.data[].id' | sed 's/^/ • /'
else
echo -e "\n⚠ GROQ_API_KEY not set"
fi
}
fetch_ollama() {
echo -e "\n${GREEN}📦 Ollama Models (local):${NC}"
if curl -s http://localhost:11434/api/tags >/dev/null 2>&1; then
curl -s http://localhost:11434/api/tags | jq -r '.models[].name' | sed 's/^/ • /'
else
echo " ⚠️ Ollama not running on localhost:11434"
fi
}
fetch_together() {
if [ -n "$TOGETHER_API_KEY" ]; then
echo -e "\n${GREEN}📦 Together AI Models:${NC}"
curl -s https://api.together.xyz/v1/models \
-H "Authorization: Bearer $TOGETHER_API_KEY" | \
jq -r '.data[].id' | head -20 | sed 's/^/ • /'
else
echo -e "\n⚠ TOGETHER_API_KEY not set"
fi
}
fetch_anthropic() {
echo -e "\n${GREEN}📦 Anthropic Models (static list):${NC}"
echo " • claude-opus-4-5-20250219"
echo " • claude-sonnet-4-5-20250219"
echo " • claude-3-5-sonnet-20241022"
echo " • claude-3-5-haiku-20241022"
echo " • claude-3-opus-20240229"
}
fetch_google() {
if [ -n "$GOOGLE_API_KEY" ]; then
echo -e "\n${GREEN}📦 Google Gemini Models:${NC}"
curl -s "https://generativelanguage.googleapis.com/v1/models?key=$GOOGLE_API_KEY" | \
jq -r '.models[].name' | sed 's|models/||' | sed 's/^/ • /'
else
echo -e "\n⚠ GOOGLE_API_KEY not set"
fi
}
# Main logic
case "${1:-all}" in
openrouter) fetch_openrouter ;;
openai) fetch_openai ;;
groq) fetch_groq ;;
ollama) fetch_ollama ;;
together) fetch_together ;;
anthropic) fetch_anthropic ;;
google) fetch_google ;;
all)
fetch_anthropic
fetch_openai
fetch_google
fetch_openrouter
fetch_groq
fetch_together
fetch_ollama
;;
*)
echo "Usage: $0 [openrouter|openai|groq|ollama|together|anthropic|google|all]"
exit 1
;;
esac
echo -e "\n${GREEN}✅ Model fetch complete${NC}"