Sponsored Content

Generate anything from your terminal.

Generate text, images, video, and audio, and ask models typed questions about your data. Commands read stdin, write files or JSON, and run any model on AI Gateway.

$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.png (3.2s)
Saved to /Users/you/resp_img_b-2.jpg (4.1s)

Compare models in one command.

Pass comma-separated model IDs to run the same prompt on each model in parallel. Add -n to generate several outputs per model.

  • --concurrency caps parallel requests
  • --json writes outputs, usage, and provider metadata
$ ai image "a sunset" -m "gpt-image-2,flux-2-pro"
 
Saved to /Users/you/resp_img_a-1.png (3.2s)
Saved to /Users/you/resp_img_b-2.jpg (4.7s)

Ask typed questions with ai decide.

Send text, JSON, or images as shared state and ask several Boolean, choice, and score questions in one call. Answers come back as JSON with probabilities, ready for jq or a script.

  • --boolean, --choice, and --score in the same call
  • --questions loads a reusable JSON question file
  • default model: typesafe-ai/jev on AI Gateway
$ cat ticket.txt |
ai decide \
--boolean "refund=Refund requested?" \
--choice "team=Which team?" \
--choices "team=billing,support" \
--score "tone=How positive?" \
--levels "tone=angry,neutral,happy"

Pipe in, pipe out.

Text on stdin becomes prompt context. Binary stdin feeds the image, video, and audio commands, so ai image can pipe straight into ai video.

  • 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

One key for every model type.

Vercel AI Gateway serves text, image, video, speech, transcription, and evaluation models from OpenAI, Anthropic, Google, Black Forest Labs, ByteDance, and more with one API key.

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

Made for scripts and agents.

Run the same commands in a terminal, a CI job, or an agent's tool loop.

$ai text "hello"
001

Inline preview

Images and video frames render in terminals that support the Kitty graphics protocol, and speech plays back after it's saved.

002

Predictable output

Progress and file paths go to stderr. Stdout carries the text, the piped artifact, or JSON metadata, so scripts and agents can parse it.

003

Live model discovery

The model list comes from AI Gateway at run time, so new models work without a CLI update. Use short names like flux-2-pro or full IDs like bfl/flux-2-pro.

004

No config file

Set AI_GATEWAY_API_KEY and run a command. Each type has a default model, and env vars such as AI_CLI_IMAGE_MODEL change it.