asciinema: Amazing Terminal Session Recorder

Aug 05, 2018

In this article I’m going to share my experience using asciinema, a very elegant and useful tool for you to share all your works in a Linux/Unix shell.

The asciinema project consists of some pieces:

  • asciinema: command-line tool for producing the recording artifact, which is named “asciicast”
  • asciinema-player: javascript web player for the asciicast
  • asciinema-server: web app for hosting asciicasts
  • asciicast2gif: tool for transforming from asciicast to a gif file

Benefits using asciinema includes:

  • It helps us memorize all the inputs and outputs shown on the screen, including the timing and color information in an extremely simple way. You can just use it for your working diary or learning history.
  • Instead of manually keying in every single character you see in a youtube video, you can just highlight any command on the asciinema player and copy and paste to reproduce a series of works very easily.
  • You can embed the asciinema player at many places such as your blog, Google Site, or any pages that support <script> tag.

Next, I’ll briefly show what it can do for us. The first part is a self-describing example that shows the most useful combination asciinema rec + asciinema play + asciinema upload:

The latter part is a terminal-to-terminal streaming example which uses the raw recording mode available since v2.0.0: In this example I use the localhost as both the recording host and viewing host, but of course you can replace the viewing host with your friend’s host IP or your customer’s host IP to do such a live streaming!

Leave a comment