As well as making your terminal more colorful and productive through the prompt theme, font, and plugins, you can add even more features by using Ruby Gems, such as lolcat, colorls, and catpix.

To use them, ensure you have Ruby installed on your computer, and then you can install each one using the command gem install <GEM_NAME>.

lolcat

This Gem adds a rainbow gradient to anything that you pipe through to it. The image at the top of the post pipes ASCII art text generated with the aarti Gem through lolcat to create a colorful heading in the terminal.

You can combine extra bash commands to animate it, in this case echo to print the string passed to it, -a to animate, and -d for duration.

echo I ❤  Ruby | lolcat -a -d 500

There is a Gem based on lolcat called lolize, which adds the rainbow colour to Ruby output. One use of it is to generate more colourful logs for your Ruby on Rails projects.

The lolize Gem in action coloring Ruby on Rails logs

Artii

The Artii gem generates ASCII art based on text you pass to it as arguments. You can see this demonstrated in the header image at the top of this tutorial. If you pass the output to lolcat you get ascii art text with multiple colors.

artii 'Ruby Gems' --font slant | lolcat

It is based on the Figlet library, which you can also install on a Mac with brew install figlet.

Colorls

This enhances the terminal command ls with color and icons. Below is a screenshot from its Github repo. This configuration is an iTerm2 terminal (Mac OS), with oh-my-zsh with powerlevel9k theme and powerline nerd-font + awesome-config font with the Solarized Dark color theme.

You can make it as easy to use as ls by adding an alias for lc to your ~/.bashrc or ~/.zshrc file.

alias lc="colorls"

Catpix

This converts images to a format that can render on a terminal screen. You can try having an image loaded into your terminal when it starts or when there is an event — for example when your tests pass.

Find out more

These are just some of the Ruby Gems that can enhance your terminal, and learning how they work means you can customize your command line. You could even take it further by adding a special setup for irb and pry, such as irbtools.

Find out more about the Gems on Github

Read more from ryanwhocodes