ai-cli

Inline Preview

See generated images and video frames directly in your terminal.

How it works

When running in a terminal that supports the Kitty graphics protocol, generated images and video frames are displayed inline automatically.

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 compiled to WebAssembly. No native dependencies are required.

bash
ai video "ocean waves"

Controlling preview

Disable inline preview for a single command:

bash
ai image "a sunset" --no-preview
ai video "a sunset" --no-preview

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

bash
export AI_CLI_PREVIEW=1

Force preview off globally:

bash
export AI_CLI_PREVIEW=0