CLI screenshots

click-extra produces colored terminal output, and inside this Sphinx documentation the click:run directive executes each CLI and renders its real output at build time, so these pages need no screenshots. A README on GitHub or PyPI, a slide, or a social post cannot run code, so those surfaces need a captured image instead. Here is how to produce one from a click-extra CLI.

Tip

A tool that captures a command by reading its piped output sees a non-interactive stream, and click-extra strips colors there by default, like any CLI that respects a non-TTY stdout. Export FORCE_COLOR=1 in the capture environment (FORCE_COLOR=1 my-cli --help) to keep them. A tool that allocates a real pseudo-terminal (a PTY) receives colors on its own, with no environment variable needed.

Other tools

The wider landscape splits by need: a regenerable static image, an animated demo, or a quick hand-made shot.

Tool

Output

Runs your command?

Install

Diffable source

Best for

rich-codex

SVG, PNG

Yes

uvx (Python)

Yes

Automated, regenerable shots

freeze

SVG, PNG, WebP

Yes (--execute)

Go binary

Yes

Static shots without a Python tool

vhs

GIF, MP4, WebM

Scripted .tape

Go binary

No

Reproducible animated demos

asciinema + agg

GIF, animated SVG

Yes (records)

Rust, npm

Yes (.cast)

Authentic session recordings

Rich export, ansitoimg

SVG, HTML, PNG

No (converts text)

uvx (Python)

Yes (SVG)

Output you already captured

ray.so, Carbon, chalk.ist

PNG, SVG

No (paste)

Web

No

One-off marketing shots

A few specifics the table compresses: freeze is a single Go binary whose --execute "my-cli --help" captures real ANSI output with no Python involved. vhs replays a .tape script rather than recording you, which makes its animations deterministic and re-runnable in CI. asciinema records a genuine session into a plain-text .cast file that diffs in git, then agg renders it to a GIF or svg-term-cli to an animated SVG. Rich’s Console(record=True).export_svg() is the zero-dependency engine that both rich-codex and ansitoimg build on, so reach for it when you already hold the ANSI text and want no capture layer.

GitHub integration

Whichever tool you pick, a README can track the reader’s theme: capture a dark and a light SVG, then switch between them with a GitHub <picture> element keyed on prefers-color-scheme.