Asciinema is a very simple tool to records a terminal session, this could be usefull to write an article or during a technical presentation, let's see how it works.
brew install asciinema asciinema -h # to see the available commands
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'
asciinema rec << type the commands you want to record >>
Then, simply type "Ctrl-d" to exit and "Enter" to save the file on https://asciinema.org/,
you juste have to type your email to have a free account.
There are several ways for integration :
This is a link to access to the player, that allows to go forward or backward in the presentation, and to make copy/paste !
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 !