asciinema / agg

asciinema gif generator
https://docs.asciinema.org/manual/agg/
Apache License 2.0
1.21k stars 44 forks source link
asciinema gif rust terminal

agg - asciinema gif generator

agg is a command-line tool for generating animated GIF files from terminal session recordings.

It supports conversion from asciicast v2 files produced by asciinema recorder. It uses Kornel Lesiński's excellent gifski library to produce optimized, high quality GIF output with accurate frame timing.

Example GIF file generated with agg:

Example GIF file generated with agg

Check out the agg docs for installation and usage overview.

agg is a successor to asciicast2gif.

Building

Building from source requires Rust compiler (1.56.0 or later) and Cargo package manager. You can install both with rustup.

To download source code, build agg binary and install it in $HOME/.cargo/bin run:

cargo install --git https://github.com/asciinema/agg

You need to ensure $HOME/.cargo/bin is in your shell's $PATH.

Alternatively, you can manually download source code and build agg binary with:

git clone https://github.com/asciinema/agg
cd agg
cargo build --release

This produces an executable file in release mode (--release) at target/release/agg. There are no other build artifacts so you can copy the binary to a directory in your $PATH.

Building with Docker

Alternatively, if you have Docker, Podman or another Docker-compatible tool installed you can use it to build agg container image. This doesn't require Rust toolchain installed on your machine.

Build the image with the following command:

docker build -t agg .

Then run agg like this:

docker run --rm -it -u $(id -u):$(id -g) -v $PWD:/data agg demo.cast demo.gif

If you use Podman in root-less mode:

podman run --rm -it -v $PWD:/data agg demo.cast demo.gif

Consulting

If you're interested in customization of agg or any other asciinema component to for your corporate needs, check asciinema consulting services.

License

© 2022 Marcin Kulik.

All code is licensed under the Apache License, Version 2.0. See LICENSE file for details.