Skip to content

Record/play asciicast files

Available since v0.9

console2svg can interoperate with the asciicast v2 format commonly used by the terminal recording tool asciinema.

Specify the --save-cast option to save execution output in asciicast format (.cast).

Terminal
console2svg capture --save-cast session.cast -- cargo build

The saved .cast file can also be played with normal tools such as asciinema play.

Specify the --embed-cast option to embed asciicast data in the metadata area inside the generated SVG file.

Terminal
console2svg capture --embed-cast -o output.svg -- fastfetch

Use the cast subcommand to render SVGs or videos from existing .cast files.

Terminal
# Output as a static SVG
console2svg cast session.cast -o session.svg
# Output as a video (GIF)
console2svg cast session.cast -v -o session.gif -t monokai

Or specify capture --in.

Terminal
console2svg capture --in session.cast -d macos-pc -o output.svg