Skip to main content

Colorize your output using RegEx

Project description


PyPI version Build Status Coverage Status

A tool for colorizing the output of a terminal.


ChromaTerm (ct) reads from standard input and colors it according to user-configurable rules.

Think of ChromaTerm like grep; just pipe things into it. However, unlike other programs which line-buffer, ct works with interactive applications, like ssh. In fact, I have ssh() { /usr/bin/ssh $* | ct; } in my .bash_profile to give my sessions color.

Here's an example using the rules in the default configuration file:

alt text


pip3 install chromaterm

If you have the legacy version of ChromaTerm, be sure to uninstall it first.

# If installed using HomeBrew
brew uninstall chromaterm

# If installed from source
git clone -b legacy
cd ChromaTerm/src/ && ./configure && make uninstall


By default, ChromaTerm reads .chromaterm.yml in your home directory. As an example, run the following:

echo "Jul 14 12:28:19  Message from Completed successfully" | ct

The default config file is copied to your home directory if it's not there.

Highlight Rules

All of the highlight rules are placed under the rules array in the configuration file. Here's an example config file:

- description: My first rule colors the foreground
  regex: hello.+world
  color: f#ff0000

- description: Background "there" and foreground "buddy" with different colors.
  regex: Hey (there), (buddy)
    1: b#ff0000
    2: b#123123


Optional. It's purely for your sake.


The RegEx engine used is Python's re.


The color is a hex string prefixed by b for background (e.g. b#123456) and f for foreground (e.g. f#abcdef).

You can color the foreground and background simultaneously by separating them with a space, like b#123456 f#abcdef.

A color can be applied per regex group (see the 2nd example rule).


If you've got any questions or suggestions, please open up an issue (always appreciated).

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for chromaterm, version 0.4.1
Filename, size File type Python version Upload date Hashes
Filename, size chromaterm-0.4.1-py3-none-any.whl (21.4 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size chromaterm-0.4.1.tar.gz (15.5 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page