9 unstable releases
Uses new Rust 2024
| new 0.5.0-beta.1 | Feb 4, 2026 |
|---|---|
| 0.4.0 | Jun 1, 2025 |
| 0.4.0-beta.1 | Mar 3, 2024 |
| 0.3.0 | Jun 3, 2023 |
| 0.1.0 | Jun 1, 2021 |
#310 in Visualization
500KB
11K
SLoC
term-transcript CLI
This crate provides command-line interface for term-transcript. It allows capturing
terminal output to SVG and testing the captured snapshots.
Installation
Install with
cargo install --locked term-transcript-cli
# This will install `term-transcript` executable, which can be checked
# as follows:
term-transcript --help
See the Book for more installation options.
Usage
- The
capturesubcommand captures output from stdin, renders it to SVG and outputs SVG to stdout. - The
execsubcommand executes one or more commands in the shell, captures their outputs, renders to an SVG image and outputs it 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 the Book for more detailed overview of command-line args and options.
Examples
This example creates a snapshot of the rainbow script and then tests it.
The snapshot itself is tested, too! It also shows that SVG output by the program is editable; in the snapshot, this is used to highlight command-line args and to change color of comments in the user inputs.
The test command can compare colors as well:
Another snapshot created by capturing help output from a pseudo-terminal
(the --pty flag):
Using PTY enables coloring output by default and formatting dependent on the terminal size.
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in term-transcript by you, as defined in the Apache-2.0 license,
shall be dual licensed as above, without any additional terms or conditions.
Dependencies
~16–32MB
~585K SLoC