Beautiful GIFs straight from your terminal
/ 3 min read
Table of contents
TLDR
# Installnpm install -g terminalizer
# Save the global configterminalizer init
# Start a recording named testterminalizer record -k test
# Render the recording into test.gifterminalizer render test -o test.gifWhy you’d want it
This is more of a toy — you can always just record a region of your screen and convert it to a GIF — but here you get to do all of it right in the terminal.
On top of that, you can upload a recording to their site and send someone a link.
Installation and first run
To install it, you’ll need npm on your machine. Install it for all users:
npm install -g terminalizerFor Mac, brew won’t help, but on Arch you can use the builds from AUR.
# if you use yayyay -S nodejs-terminalizerThat’s it, everything’s ready — go ahead and run it:
terminalizer record -k testA new session will start in the current window. Poke around in it, connect over ssh — whatever you like — and when you’re done, just hit exit to stop the recording. You’ll end up with a preliminary file in the current directory that you can render into a GIF (in our case we recorded test, so a test.yaml file will show up):
terminalizer render test -o test.gifNice work! A test.gif file with your terminal recording has appeared in the current folder!
The main catch is that you’ll see your old, unconfigured terminal — forget about starship.rs, Oh-My-Posh or any other niceties. If you want to use the full power of terminalizer, you’ll need to configure it.
Configuration
By default, terminalizer takes the config from the current directory, or, if there isn’t one, from the ~/.config/terminalizer folder.
You can generate the default config with
terminalizer initIn the terminal you’ll see something like
The global config directory is created at/Users/bob/.config/terminalizerFrom then on, every terminalizer run will use this config. But each time you make a recording, a YAML file is generated that contains both the full config and the recorded frames — so when you’re dialing in your settings, it’s easier to edit that file than to change the global config and re-run the recording every time.
command
First things first, replace the launch command with your shell
# Specify a command to be executed# like `/bin/bash -l`, `ls`, or any other commands# the default is bash for Linux# or powershell.exe for Windowscommand: zshIn my case, I replaced null with zsh
env
The next parameter worth a look is env:
# Export additional ENV variablesenv: recording: trueBy default, when terminalizer starts, it sets the recording=true environment variable in the shell. That’s handy, for example, for skipping certain commands. For instance, every terminal of mine runs the pfetch tool.
To keep the output clean, my ~/.zshrc checks for the recording variable so that pfetch doesn’t show up inside terminalizer:
if [ -z "$recording" ]; then pfetchfiThe rest of the parameters are described well enough in the docs — whether it’s adding a watermark or tweaking the margins. Just don’t forget to point it at the fonts you have installed in your terminal.
Problems
Since we’re dealing with a pure JS tool, things can go wrong during installation (and sometimes while it’s running).
EACCESS
During installation you might run into something like this:
npm ERR! code EACCESnpm ERR! syscall mkdirnpm ERR! path /usr/local/lib/node_modulesnpm ERR! errno -13npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules'npm ERR! [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules'] {npm ERR! errno: -13,npm ERR! code: 'EACCES',npm ERR! syscall: 'mkdir',npm ERR! path: '/usr/local/lib/node_modules'npm ERR! }npm ERR!npm ERR! The operation was rejected by your operating system.npm ERR! It is likely you do not have the permissions to access this file as the current usernpm ERR!npm ERR! If you believe this might be a permissions issue, please double-check thenpm ERR! permissions of the file and its containing directories, or try runningnpm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:npm ERR! /home/zhurik/.npm/_logs/2025-03-14T09_48_06_223Z-debug-0.logIt’s a common problem, and the fix generally lives in the docs.
But if you can’t be bothered digging into it or reinstalling node and npm, you can just tell npm which folder to drop global packages into:
mkdir -p ~/.npm-global/lib
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' | tee -a ~/.profile
source .profileVoilà — everything installs and just works.