Well, you got this fancy command output from your terminal and want to make an animated image out of it?. Terminalizer is a tool that is gonna help you do this. In this article, we are going to learn how to install and use Terminalizer to generate animated gifs on Ubuntu 16.04, Ubuntu 18.04, CentOS 7. Terminalizer can record your terminal and generate animated gif images.
Installing Terminalizer on Ubuntu 18.04 / Ubuntu 16.04 / CentOS 7 / Arch Linux
To install terminalizer, follow the following procedure.
Step 1. Install Nodejs
Installation of Nodejs on Ubuntu, CentOS, and Arch Linux is available on Install Node.js on CentOS 7 / Ubuntu 16.04 / Arch Linux / macOS
If you’re an Ubuntu user, quick installation of Nodejs can be done by updating your local package index and then install Nodejs and its package manager from the repositories with the following command:
sudo apt-get update -y sudo apt-get install nodejs npm -y
On CentOS, install EPEL repository and enable Nodejs v8 LTS repository as well after which you install Nodejs;
sudo yum install epel-release -y && sudo yum update -y curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash - sudo yum install nodejs -y
For Arch Linux, install Nodejs using:
sudo pacman -S nodejs npm
Install Nodejs with nvm
Nodejs can also be installed and managed using nvm.
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
If you have a different shell like zsh, add the following lines to the end of
export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
To download, compile, and install the latest release of node, do this:
$ nvm install node Downloading and installing node v10.7.0... Downloading https://nodejs.org/dist/v10.7.0/node-v10.7.0-linux-x64.tar.xz... ################################################################### 100.0% Computing checksum with sha256sum Checksums matched! Now using node v10.7.0 (npm v6.1.0) Creating default alias: default -> node (-> v10.7.0) $ nvm use node $ node -v v10.7.0
Or, you can run any arbitrary command in a subshell with the desired version of node:
nvm exec 4.2 node --version
Step 2: Install build tools for Terminalizer
Terminalizer uses some
C++ addons that require building. This needs to be installed before you can start installing and using Terminalizer.
For CentOS and other RHEL derivatives;
sudo yum install gcc-c++ make -y
For Ubuntu and other Debian derivatives;
sudo apt-get install build-essential -y
For Arch Linux / Manjaro execute the following commands on your terminal:
$ sudo pacman -S gcc make cmake
You can confirm the versions of packages installed using
gcc -v and
Step 3. Install Terminalizer on Ubuntu 18.04 / Ubuntu 16.04 / CentOS 7 / Arch Linux
Once all dependencies have been installed, proceed to install Terminalizer on your Ubuntu 18.04 / Ubuntu 16.04 / CentOS 7 / Arch Linux system using
npm package manager. It is recommended to first install
node-gyp using npm to avoid later issues.
$ sudo npm install -g node-gyp /usr/bin/node-gyp -> /usr/lib/node_modules/node-gyp/bin/node-gyp.js + [email protected] added 1 package and updated 6 packages in 4.127s
Its binary will be available on
Now install terminalizer:
$ npm install -g terminalizer ... + [email protected] added 266 packages from 186 contributors in 43.086s
if you encounter issues during installation, try to install Nodejs using nvm method provided earlier instead of installing for a repository.
To start recording your terminal sessions, just type:
$ terminalizer record <session-name>
$ terminalizer record test-demo The recording session is started Press CTRL+D to exit and save the recording
The recording will start in the background and a file called
test-demo.yml is created in the current directory.
You can open it using any editor to edit the configurations and the recorded frames. To replay your recording using the
terminalizer play command.
$ terminalizer play test-demo
When done, you can render the recording as an animated gif using
To generate a web player for a recording file
$ terminalizer generate <recordingFile>
To upload a recording file and get a link for an online player
$ terminalizer share <recordingFile>
config.yml file is stored at root directory the of the project. Execute the below command to copy it to your current directory.
Use any editor to edit the copied config.yml, then use the -c option to override the default one.
$ terminalizer config