ai-cli

Commands

Full reference for all ai-cli commands and flags.

image

Generate images from a prompt.

bash
ai image "a sunset over mountains"
ai image "edit this" < photo.png

Options

-m, --model

string

Model ID. Comma-separated for multi-model.

-o, --output

path

Output file path or directory.

-n, --count

numberdefault: 1

Number of images per model.

-p, --concurrency

numberdefault: 4

Max parallel generations.

--size

WxH

Image size (e.g. 1024x1024).

--aspect-ratio

W:H

Aspect ratio (e.g. 16:9).

--quality

standard | hd

Quality level (OpenAI models only).

--style

vivid | natural

Style (OpenAI models only).

--no-preview

boolean

Disable inline image preview.

-q, --quiet

boolean

Suppress progress output.

--json

boolean

Output metadata as JSON.


video

Generate video from a prompt or image.

bash
ai video "a spinning triangle"
ai image "a dragon" | ai video "animate this"

Options

-m, --model

string

Model ID. Comma-separated for multi-model.

-o, --output

path

Output file path or directory.

-n, --count

numberdefault: 1

Number of videos per model.

-p, --concurrency

numberdefault: 2

Max parallel generations.

--aspect-ratio

W:H

Aspect ratio (e.g. 16:9).

--duration

seconds

Duration in seconds.

--no-preview

boolean

Disable inline video frame preview.

-q, --quiet

boolean

Suppress progress output.

--json

boolean

Output metadata as JSON.


text

Generate text from a prompt.

bash
ai text "explain quantum computing"
ai text "summarize this" < notes.txt

Options

-m, --model

string

Model ID (creator/model). Comma-separated for multi-model.

-o, --output

path

Output file path or directory.

-f, --format

md | txtdefault: md

Output format.

-n, --count

numberdefault: 1

Number of generations per model.

-p, --concurrency

numberdefault: 4

Max parallel generations.

-s, --system

string

System prompt.

--max-tokens

number

Maximum tokens to generate.

-t, --temperature

number

Temperature (0–2).

-q, --quiet

boolean

Suppress progress output.

--json

boolean

Output metadata as JSON.


models

List available models from the AI Gateway.

bash
ai models
ai models --type image
ai models --creator openai --json

Options

--type

text | image | video

Filter by modality.

--creator

string

Filter by creator (e.g. openai, google).

--json

boolean

Output as JSON with descriptions.

Models are fetched live from the AI Gateway.


Timeouts

Requests that exceed the per-command timeout are aborted automatically:

CommandTimeout
text120 seconds
image120 seconds
video300 seconds

Video generation uses a longer timeout because models typically need more processing time.

Exit codes

CodeMeaning
0Success
1All generations failed
2Partial failure (some succeeded, some failed)