Hi, I've been doing some research on recording terminal sessions and found something interesting. A platform called Asciinema. Yup it is as cool as it sounds.
With this you can record whole terminal sessions as ASCII videos. The joke is, these are not video files, they are real text outputs. So here you can do copy & paste 😃 The whole thing is stored in a JSON and played via javascript. Well all well and good, but how does it work?
It is kept really simple. The only thing you need is a Unix like system. Asciinema supports only BSD, Linux and Mac OS.
The installation is quite simple.
FreeBSD:
pkg install py36-asciinema
Debian, Ubuntu etc…:
apt install asciinema
Mac OS:
brew install asciinema
After the installation, you can already get started. Simply create an account on the page and off you go. The creation of an account works so that you simply enter an email address of yourself. You will receive an email with an access link.
When registering and logging in, you always end up on this page.
Every time you want to log in, you enter your email and then get an access link. Just click on it and you are registered or logged in.
The last thing you have to do is to connect Asciinema to your account. You have to enter this command. Important here, you can only connect your program to your account once, because a token is created for each machine.
asciinema auth
We then get a link in the terminal that we click on. This links the account to the program.
To record a terminal session you just have to enter the command.
asciinema rec
When you are done and want to stop recording, just press CTRL-D or type exit.
After that you will be asked if you want to upload the session or not.
~ Asciicast recording finished.
~ Press <Enter> to upload, <Ctrl-C> to cancel.
To upload just press Enter. Otherwise just CTRL-C.
A sample image will look like this.
Nice! 😄