Is there colorizer utility that can take command output and colorize it accordingly to pre-defined scheme

colorscommand lineunix

I already know that I can colorize output with grep and with a couple of different ways. I want to have something like supercat, but for commands (and not that dead).

The application Supercat colors any input text based on the type of
file and a set of rules associated with the file type. The rules are
used to match strings found in the input text and can be specified
using simple characters or strings, regular expressions and special
time-formatting rules.

Lets say, I'm writing magiccommand gcc blah blah, this magic command understands that it has to colorify gcc output and chooses one template. Now, I'm willing to magiccommand mvn foo bar and that command takes another appropriate rule. Bonus points for readable rules — no "s/^GET.*$/\x1b[31m&\x1b[0m/" sed insanity.

Best Answer

You could use a tool like grcat/grc (where the first is the tool, and the second the front end).

grc will execute command command with optional parameters [args] piping its stdout or stderr into grcat, with apropriate configuration file.

For example

enter image description here