The AI SDK for your terminal.

Generate text, images, video, and audio. Evaluate typed questions. Composable commands, shell pipelines, and hundreds of models for people and agents.

$npm install -g ai-cli
command ai image
ready
$ ai image "a sunset" -m "openai/gpt-image-2,bfl/flux-2-pro"
 
Saved to /Users/you/resp_img_a-1.<format> (3.2s)
Saved to /Users/you/resp_img_b-2.<format> (4.1s)

Multi-model comparison.

Run the same prompt across multiple models in parallel. Compare outputs side by side to find the best result. Combine with -n to generate multiple per model.

  • comma-separated model IDs for parallel generation
  • configurable concurrency limits
  • per-job timing and structured JSON output
$ ai image "a sunset" -m "gpt-image-2,flux-2-pro"
 
Saved to /Users/you/resp_img_a-1.<format> (3.2s)
Saved to /Users/you/resp_img_b-2.<format> (4.7s)

One input. Many judgments.

Use AI SDK evaluation models to ask focused questions about the same input in one call. Get typed answers and probabilities your scripts can use directly.

  • Boolean, Choice, and Score questions together
  • text, JSON objects, and arrays as shared state
  • SDK results with probabilities, metadata, and usage
$ cat ticket.txt |
ai evaluate \
--boolean "refund=Refund requested?" \
--choice "team=Which team?" \
--choices "team=billing,support" \
--score "tone=How positive?" \
--levels "tone=angry,neutral,happy"

Pipe everything.

Pipe text in as context, turn images into video, transcribe audio, or send typed judgments to jq. Compose AI with the commands you already use.

  • text stdin becomes prompt context
  • binary stdin for image, video, and audio workflows
  • chain: ai image | ai video, or pipe text to ai audio speak
$ git diff | ai text "explain these changes"
 
These changes refactor the auth module:
 
1. Splits session logic into its own file
2. Adds token expiry validation
3. Removes deprecated OAuth1 flow
 
$ ai image "a dragon" | ai video "animate this"
Saved to /Users/you/resp_video.mp4
 
$ echo "Ship the changelog" | ai audio speak
Saved to /Users/you/resp_speech.mp3

Hundreds of models, one key.

Access text, image, video, speech, transcription, and evaluation models from OpenAI, Anthropic, Google, Black Forest Labs, ByteDance, and more through Vercel AI Gateway.

  • short names resolve automatically: flux-2-pro, gpt-5.5, tts-1
  • live model listing from the gateway
  • per-type defaults configurable via env vars
$ ai models --type audio
 
Speech models (8):
 
openai
tts-1
gpt-4o-mini-tts
 
Transcription models (4):
 
openai
whisper-1
...and more

Built for composability.

Generate content and make structured decisions in scripts, CI pipelines, agent toolchains, or your terminal.

$ai text "hello"
001

Inline preview

Generated images, video frames, and speech previews display directly in your terminal. Visual previews use the Kitty graphics protocol where supported, including images returned as JPEG or WebP.

002

Agent-native output

Predictable behavior for scripts and agents. Selected records on stdout, generated artifacts in files or pipes, and JSON metadata for automation.

003

Live model discovery

Models are fetched directly from the AI Gateway — no hardcoded lists to maintain. Use short names or full provider/model IDs.

004

Zero config

No config files, no init command, no setup wizard. Set an API key environment variable and start generating. Defaults work out of the box.