Record and share your terminal sessions with asciinema

Aug 10, 2021 by Thibault Debatty | 183 views

Sysadmin

https://cylab.be/blog/161/record-and-share-your-terminal-sessions-with-asciinema

If you want to share a terminal session, you can record a video of your terminal window, and share it on something like YouTube or vimeo. Or you can can use asciinema! asciinema actually only records the text input and output of your terminal (stdin, stdout and stderr). This means that the recordings are extremely light (it only contains text and timing), while the text remains perfectly readable. You can also easily share and embed your recordings on your website using some javascript code.

Moreover, this embedded player has an additional benefit: it is possible to pause and copy-paste text directly from the player. You can give it a try on the session below:

Install

The easiest way to install asciinema is using pip:

sudo pip3 install asciinema

Record

To start a recording, simply type

asciinema rec

This will start a new shell from which the input and output will be recorded. You can end the recording with exit or ctrl + D.

Trick, you can also automatically remove idle time with the option -i:

asciinema rec -i 2

You can find all other options in the online documentation: https://asciinema.org/docs/usage

Share

When the recording is finished, you will get to choose between saving the recording locally and uploading the recording to asciinema.org.

If you choose to upload, you will receive a link that allows to watch and share your recording: