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
- The
execsubcommand executes one or more commands in the shell, captures their outputs, renders to an SVG image and outputs it to stdout. - The
capturesubcommand captures output from stdin, renders it to SVG and outputs SVG to stdout. - The
testsubcommand allows testing snapshots from the command line. - The
printsubcommand parses an SVG snapshot and outputs it to the command line.
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.
print subcommand
term-transcript print parses a previously captured transcript and outputs it to stdout,
applying the corresponding styles as necessary.
test subcommand
term-transcript test reproduces inputs recorded in a captured transcript and compares outputs
to the ones recorded in the transcript.
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.
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
- Use a pre-built binary for popular targets (x86_64 for Linux / macOS / Windows
and AArch64 for macOS) from the
masterbranch. - Use a pre-built binary for popular targets from GitHub Releases.
- Use the app Docker image.
- Build from sources using Rust /
cargo.
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.