AI CLI using OpenAI's open source model.
npm install -g ai-cli
Set your AI Gateway API key in your shell configuration:
# Add to ~/.zshrc or ~/.bashrc
export AI_GATEWAY_API_KEY=your-api-key
Get your API key at https://vercel.com/docs/ai-gateway
ai "whats up bro"
ai hello
echo "explain this code" | ai
ai -m openai/gpt-oss-120b "who is rauchg"
-
-m, --model
- Specify AI model (default: openai/gpt-oss-120b) -
-h, --help
- Show help message
You can use any model available through Vercel AI Gateway by using the -m
flag:
ai -m claude-4-sonnet "who am i"
ai -m openai/gpt-4o "count to 3"
ai -m anthropic/claude-4.1-opus "spend my money"