Generate anything from your terminal.

A tiny CLI for generating text, images, video, and audio with dead-simple commands. Pipe content in and out. Compare models side by side. See results inline.

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

Pipe everything.

Pipe text in as context, pipe images into video generation, turn text into speech, or transcribe piped audio. Raw output on stdout when piped, file saves when interactive.

  • 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, and transcription 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.

Not a chatbot. A generation tool that fits into any workflow — scripts, CI pipelines, agent toolchains, or just 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.

002

Agent-native output

Predictable behavior for scripts and agents. Raw stdout when piped, file saves when interactive. JSON metadata mode for CI pipelines.

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.