DEV Community

Cover image for Let's try Asciinema
jdxlabs
jdxlabs

Posted on • Updated on

Let's try Asciinema

Why Asciinema ?

Asciinema is a very simple tool to record a terminal session, this could be useful to write an article or during a technical presentation, let's see how it works.

Installation

brew install asciinema

asciinema -h
# to see the available commands
Enter fullscreen mode Exit fullscreen mode

If you have the same problem than me, it will ask you to configure the locale, this can be fixed by this line in your .bashrc :

alias asciinema='LC_ALL=en_US.UTF-8 asciinema'
Enter fullscreen mode Exit fullscreen mode

Usage

asciinema rec
<< type the commands you want to record >>
Enter fullscreen mode Exit fullscreen mode

Then, simply type "Ctrl-d" to exit and "Enter" to save the file on https://asciinema.org/,

you just have to type your email to have a free account.

There are several ways for integration :

asciinema share

I took the Embed image link option, for markdown,

you can hit "Make public" to allow public access :
asciicast

This is a link to access to the player, that allows to go forward or backward in the presentation, and to make copy/paste !

My feedback

Unfortunately if you want to have the player directly in the webpage, you have to make some html/css/js configuration on your page (so it's not possible on dev.to for instance, unless it's integrated, perhaps in the future).

There is also the tool asciicast2gif that allows to export to a gif file, so it can be integrated anywhere, but I don't think it's convenient, because you don't have the player, it's just a loop, and it takes time to process.

The link option is still a great option because it's easy to use, and can be integrated in any html or markdown document (directly in Dev.to or Google Slides for instance).

Asciinema works well, is pretty fast and can be used for some demos you want to do on terminal, feel free to try it too !

Oldest comments (0)