mirror of
https://github.com/hanzoskill/xai.git
synced 2026-10-30 21:00:51 +00:00
main
xAI / Grok Skill for Bot
Chat with xAI's Grok models from Bot. Supports text chat, vision, and all Grok models including Grok-4.
Installation
skills install xai
# or
cd ~/bot/skills && git clone https://github.com/mvanhorn/bot-skill-xai xai
Setup
Get your API key from console.x.ai, then:
bot config set skills.entries.xai.apiKey "xai-YOUR-KEY"
Or set environment variable:
export XAI_API_KEY="xai-YOUR-KEY"
Usage
Chat with Grok
node scripts/chat.js "What is the meaning of life?"
Use specific model
node scripts/chat.js --model grok-4-0709 "Complex question here"
node scripts/chat.js --model grok-3-mini "Quick question"
Vision (analyze images)
node scripts/chat.js --image photo.jpg "What's in this image?"
System prompts
node scripts/chat.js --system "You are a pirate" "Tell me about ships"
List available models
node scripts/models.js
Available Models
grok-3- Capable general modelgrok-3-mini- Fast and efficientgrok-4-0709- Latest Grok 4grok-4-fast-reasoning- Fast with reasoninggrok-2-vision-1212- Image understandinggrok-2-image-1212- Image generation
Bot Integration
Once installed, you can just say:
- "Ask Grok about [topic]"
- "Use Grok to analyze this image"
- "Have Grok 4 explain [concept]"
License
MIT
Languages
JavaScript
100%