How to Properly Document Terminal Outputs: Asciinema Install & Setup
Asciinema is one of the best bits of software I’ve seen recently for frequent terminal users. It’s goal is simple: Make recording simple, available on any machine, and share quicker than normal videos. It does that, and it even allows for embedding on sites, like I did with my k6 setup guide.
Install #
Installing on Linux #
Arch Linux
pacman -S asciinema
Debian
sudo apt-get install asciinema
Fedora For Fedora < 22:
sudo yum install asciinema
For Fedora >= 22:
sudo dnf install asciinema
Gentoo Linux
emerge -av asciinema
NixOS / Nix
nix-env -i asciinema
openSUSE
zypper in asciinema
Ubuntu
sudo apt-add-repository ppa:zanchey/asciinema
sudo apt-get update
sudo apt-get install asciinema
Installing on MacOS #
Using Homebrew:
brew install asciinema
Sadly, there’s no Windows edition here, but you can install via python using pip3 install asciinema .
Command Usage & Example #
# Used to start the record
asciinema rec
Then, either press CTRL+D or type exit in the console.
This will then give you the option to either save locally as a .cast file, or to share on the asciinema website. This’ll generate a handy link to send to whoever you’d like. Here’s one I made earlier!
If you’re anything like me, this’ll make you think of quite a few docs written here and there you can go back to and show really what a command output should look like without strange text formatting. The only thing I wish is that you could live stream your terminal using this. Now that would make shadowing sessions much better.