asciinema Terminal Recording Installation and usage
24 Apr 2017asciinema is a lightweight, purely text-based approach to terminal recording.
To install asciinema
on ubuntu 16.04 run the following command
sudo apt-add-repository ppa:zanchey/asciinema
sudo apt-get update
sudo apt-get install asciinema
sudo locale-gen en_US en_US.UTF-8
sudo dpkg-reconfigure locales
export LC_ALL="en_US.UTF-8"
Start Recording
By running asciinema rec [filename] you start a new recording session
root@b3c403d0dff1:/# asciinema rec test1
~ Asciicast recording started.
~ Hit Ctrl-D or type "exit" to finish.
# ls
bin boot dev etc home lib lib32 lib64 media mnt opt proc root run sbin srv sys test1 tmp usr var
# ps
PID TTY TIME CMD
484 pts/0 00:00:00 sh
485 pts/0 00:00:00 sh
487 pts/0 00:00:00 ps
# exit
~ Asciicast recording finished.
Playback Recording
you can playback the recording
root@b3c403d0dff1:/# asciinema play test1
# ls
bin boot dev etc home lib lib32 lib64 media mnt opt proc root run sbin srv sys test1 tmp usr var
# ps
PID TTY TIME CMD
484 pts/0 00:00:00 sh
485 pts/0 00:00:00 sh
487 pts/0 00:00:00 ps
# exit
root@b3c403d0dff1:/#
We can see that play command replayed the command and also the corresponding output from the test1 file
The output of recording is a json file which keeps on storing the command and corresponding output
Creating an account
To public the results on the cloud
Create a account at https://asciinema.org/login/new
To associate or aunthentica you account on asciinema.org
run the command
root@b3c403d0dff1:/# asciinema auth
Open the following URL in a browser to register your API token and assign any recorded asciicasts to your profile:
https://asciinema.org/connect/6e2e4cr4-hla2-1236e-863e-aje76d5e8b8f
To upload the asciicast
root@b3c403d0dff1:/# asciinema upload test1
https://asciinema.org/a/7bkwd4gyh0keo2c01uqej9syo
Now you can see the session recording reflected on you online account
You can view the recoding at
https://asciinema.org/a/7bkwd4gyh0keo2c01uqej9syo
Rererences
- https://asciinema.org/