Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

term-transcript CLI

term-transcript CLI app provides an almost feature-complete alternative to the library. It allows capturing, printing and testing terminal snapshots.

Usage

Launch the CLI app with the --help option for more details about arguments for each subcommand. See also the FAQ for some tips and troubleshooting advice.

exec subcommand

term-transcript exec sends one or more inputs to the customizable shell (e.g., sh) and captures the produced outputs, including ANSI styling, into a snapshot. The snapshot uses the SVG format by default, however, this can be customized (see the Custom Template section for details).

Tip

See Examples for various representation options that can be customized via command-line arguments.

capture subcommand

term-transcript capture is quite similar to term-transcript exec, but instead of instantiating a shell, it captures input from another command via shell pipelining.

Example of term-transcript capture usage

term-transcript print parses a previously captured transcript and outputs it to stdout, applying the corresponding styles as necessary.

Example of term-transcript print usage

test subcommand

term-transcript test reproduces inputs recorded in a captured transcript and compares outputs to the ones recorded in the transcript.

Example of term-transcript test usage

If there’s a test failure a diff will be produced highlighting the changes. This includes discrepancies in ANSI styling if the --precise arg is provided, like in the snapshot below.

Example of term-transcript test output with output mismatch

Tip

See also using the library for CLI testing. This provides a more customizable alternative (e.g., allows to generate snapshots the first time the tests are run).

Installation options

Downloads

Important

The binaries are updated on each push to the git repo branch. Hence, they may contain more bugs than the release binaries mentioned above.

PlatformArchitectureDownload link
Linuxx86_64, GNU Download
macOSx86_64 Download
macOSarm64 Download
Windowsx86_64 Download