Add some FUN to your CLI with GRC
Admittedly, I am way too excited about stumbling upon this tool while researching another project. As I’ve gotten along in may career, I find myself at the CLI less and less. So, when I do have the opportunity to roll up my sleeves and get access to the CLI, I like to have some fun at the same time ;)
Install and configure the GRC (Generic Colouriser) to add a little color to existing CLI commands.
GRC is available via GitHub as well as packaged for many LINUX distributions. In the case of Ubuntu or Debian and derivatives, installing is as simple as using in the APT package manager:
# apt-get install grc
GRC is also available for Mac OS via Homebrew:
% brew install grc
GRC consists of 2 main tools:
- grcat — the main command
- grc — acts as frontend for grcat
The main command is grcat, which acts as a filter, i.e. taking standard input, colorizing it, and writing to standard output. grc will execute the specified command with optional parameters piping its stdout into grcat.
By default, grc will be installed with a number of configurations for many popular commands. While the number of configurations will vary amongst packages for different distributions, the following configurations are delivered in the default installation via Homebrew for Mac OS:
You can get started immediately by prepending any of the above commands with grc. For example:
% grc traceroute -n google.com
Beyond manually prepending the commands listed above with grc, you can additionally configure your shell with some of the pre-delivered env scripts. The grc README file explains how to do this in detail — including how to add custom configurations for additional commands.
The GRC command is a fun way to add some color to existing CLI tools. Enjoy!