Terminalizer is tool for recording terminal sessions and turning them into animated gifs. It's a way to demonstrate command line tools or share workflows. Unfortunately, there are a few hoops to jump through to install it on Ubuntu. The issues seem to be with where the global npm installer tries to put the files and the permissions that they have.
asciinema and asciicast2gif produce simpler output but are easier to install.
Here are the steps that worked for me: