---
title: "Commands"
description: "Full reference for all ai-cli commands and flags."
canonical_url: "https://ai-cli.dev/docs/commands"
---
# Commands

## image

Generate images from a prompt.

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

### Options

#### `-m, --model`

Type: `string`

Model ID. Comma-separated for multi-model.

#### `-o, --output`

Type: `path`

Output file path or directory.

#### `-n, --count`

Type: `number` | Default: `1`

Number of images per model.

#### `-p, --concurrency`

Type: `number` | Default: `4`

Max parallel generations.

#### `--timeout`

Type: `seconds` | Default: `300`

Request timeout in seconds. Must be a positive integer.

#### `--size`

Type: `WxH`

Image size (e.g. `1024x1024`). Not supported by Gemini image models — use
`--aspect-ratio` instead.

#### `--aspect-ratio`

Type: `W:H`

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

#### `--quality`

Type: `standard | hd`

Quality level (OpenAI models only).

#### `--style`

Type: `vivid | natural`

Style (OpenAI models only).

#### `--no-preview`

Type: `boolean`

Disable inline image preview.

#### `-q, --quiet`

Type: `boolean`

Suppress progress output.

#### `--json`

Type: `boolean`

Output metadata as JSON.

***

## video

Generate video from a prompt or image.

```bash
ai video "a spinning triangle"
ai video "a cinematic landscape" --resolution 1920x1080
ai image "a dragon" | ai video "animate this"
```

### Options

#### `-m, --model`

Type: `string`

Model ID. Comma-separated for multi-model.

#### `-o, --output`

Type: `path`

Output file path or directory.

#### `-n, --count`

Type: `number` | Default: `1`

Number of videos per model.

#### `-p, --concurrency`

Type: `number` | Default: `2`

Max parallel generations.

#### `--timeout`

Type: `seconds` | Default: `300`

Request timeout in seconds. Must be a positive integer.

#### `--aspect-ratio`

Type: `W:H`

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

#### `--resolution`

Type: `WxH`

Video resolution (e.g. `1920x1080` for 1080p). Supported resolutions vary
by model.

#### `--duration`

Type: `seconds`

Duration in seconds.

#### `--no-preview`

Type: `boolean`

Disable inline video frame preview.

#### `-q, --quiet`

Type: `boolean`

Suppress progress output.

#### `--json`

Type: `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`

Type: `string`

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

#### `-o, --output`

Type: `path`

Output file path or directory.

#### `-f, --format`

Type: `md | txt` | Default: `md`

Output format.

#### `-n, --count`

Type: `number` | Default: `1`

Number of generations per model.

#### `-p, --concurrency`

Type: `number` | Default: `4`

Max parallel generations.

#### `--timeout`

Type: `seconds` | Default: `120`

Request timeout in seconds. Must be a positive integer.

#### `-s, --system`

Type: `string`

System prompt.

#### `--max-tokens`

Type: `number`

Maximum tokens to generate.

#### `-t, --temperature`

Type: `number`

Temperature (0–2).

#### `-q, --quiet`

Type: `boolean`

Suppress progress output.

#### `--json`

Type: `boolean`

Output metadata as JSON.

***

## audio

Generate speech from text or transcribe audio to text.

```bash
ai audio speak "Hello from AI Gateway"
ai audio transcribe recording.mp3
cat voice-note.mp3 | ai audio transcribe -o transcript.txt
```

### audio speak

#### `-m, --model`

Type: `string`

Speech model ID. Comma-separated for multi-model.

#### `-o, --output`

Type: `path`

Output file path or directory.

#### `-f, --format`

Type: `string` | Default: `mp3`

Audio output format.

#### `--voice`

Type: `string`

Voice to use for speech generation.

#### `--instructions`

Type: `string`

Instructions for speech generation.

#### `--speed`

Type: `number`

Speech speed.

#### `--language`

Type: `code`

Language code, such as `en` or `fr`, or `auto`.

#### `-n, --count`

Type: `number` | Default: `1`

Number of generations per model.

#### `-p, --concurrency`

Type: `number` | Default: `4`

Max parallel generations.

#### `--timeout`

Type: `seconds` | Default: `120`

Request timeout in seconds. Must be a positive integer.

#### `-q, --quiet`

Type: `boolean`

Suppress progress output.

#### `--json`

Type: `boolean`

Output metadata as JSON.

#### `--no-play`

Type: `boolean`

Disable audio playback after generation.

#### `--no-waveform`

Type: `boolean`

Disable accurate terminal waveform preview.

`audio speak` accepts text from an argument or stdin:

```bash
echo "Ship the changelog" | ai audio speak -o changelog.mp3
cat announcement.txt | ai audio speak --format wav -o announcement.wav
```

### audio transcribe

#### `-m, --model`

Type: `string`

Transcription model ID. Comma-separated for multi-model.

#### `-o, --output`

Type: `path`

Output file path or directory.

#### `-f, --format`

Type: `md | txt` | Default: `txt`

Transcript output format.

#### `-n, --count`

Type: `number` | Default: `1`

Number of transcriptions per model.

#### `-p, --concurrency`

Type: `number` | Default: `4`

Max parallel transcriptions.

#### `--timeout`

Type: `seconds` | Default: `120`

Request timeout in seconds. Must be a positive integer.

#### `-q, --quiet`

Type: `boolean`

Suppress progress output.

#### `--json`

Type: `boolean`

Output metadata as JSON.

`audio transcribe` accepts a local path, `file://` URL, `http(s)://` URL, or piped audio:

```bash
ai audio transcribe meeting.mp3
ai audio transcribe https://example.com/call.wav
cat recording.mp3 | ai audio transcribe
```

***

## models

List available models from the AI Gateway, or show detailed info for one model.

```bash
ai models
ai models --type image
ai models --creator openai --json
ai models claude-opus-4.6
ai models anthropic/claude-opus-4.6 --json
```

### Arguments

#### `[model]`

Type: `string`

Model ID or short name. Shows a detail card with context window, max
output, pricing (input, output, cache read/write, web search), release
date and per-provider latency, throughput and uptime.

### Options

#### `--type`

Type: `text | image | video | audio | speech | transcription`

Filter by modality (list mode only).

#### `--creator`

Type: `string`

Filter by creator (e.g. `openai`, `google`) (list mode only).

#### `--json`

Type: `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:

| Command            | Timeout     |
| ------------------ | ----------- |
| `text`             | 120 seconds |
| `image`            | 300 seconds |
| `video`            | 300 seconds |
| `audio speak`      | 120 seconds |
| `audio transcribe` | 120 seconds |

Image and video generation use a longer timeout because models typically need more processing time.

Use `--timeout <seconds>` to allow a longer request without changing models. The value must be a positive integer:

```bash
ai image --timeout 600 "a detailed sprite atlas"
```

## Exit codes

| Code | Meaning                                       |
| ---- | --------------------------------------------- |
| `0`  | Success                                       |
| `1`  | All generations failed                        |
| `2`  | Partial failure (some succeeded, some failed) |
