---
title: "Inline Preview"
description: "See generated images, video frames, and speech previews directly in your terminal."
canonical_url: "https://ai-cli.dev/docs/images"
---
# Inline Preview

## How it works

When running in a terminal that supports the [Kitty graphics protocol](https://sw.kovidgoyal.net/kitty/graphics-protocol/), generated images and video frames are displayed inline automatically. Generated speech can also play back in interactive terminals with an accurate waveform preview.

## Supported terminals

- **Kitty**: Full native support.

- **Ghostty**: Full native support.

- **WezTerm**: Full native support.

- **Warp**: Full native support.

- **iTerm2**: Supported via protocol detection.

## Image preview

After generating an image, it appears directly in the terminal output:

```bash
ai image "a mountain landscape"
```

## Video preview

Video previews extract and decode an H.264 keyframe from the midpoint of the generated video using [openh264](https://github.com/cisco/openh264) compiled to WebAssembly. No native dependencies are required.

```bash
ai video "ocean waves"
```

## Audio preview

`audio speak` plays generated speech after saving it and renders a waveform from decoded audio samples. WAV output is decoded directly; MP3 and other encoded formats use a local decoder when available (`ffmpeg`, `mpg123`, `sox`, or `afconvert`).

```bash
ai audio speak "Read this as a friendly update"
```

## Controlling preview

Disable inline preview for a single command:

```bash
ai image "a sunset" --no-preview
ai video "a sunset" --no-preview
ai audio speak "hello" --no-play
ai audio speak "hello" --no-waveform
```

Force image and video preview on in terminals that aren't auto-detected:

```bash
export AI_CLI_PREVIEW=1
```

Disable image and video preview globally:

```bash
export AI_CLI_PREVIEW=0
```

`AI_CLI_PREVIEW` controls visual previews only. Use `--no-play`, `--no-waveform`, `--quiet`, or `--json` to disable audio playback and waveform previews.

> **Tip**:
>
> When multiple images or audio files are generated (via `-n` or multi-model), previews are batched and displayed after all generations complete.
