Colorizing wrapper generator for shell commands, with many pre-defined wrappers

3 years after

          (c) 2013-2015 Reuben Thomas <[email protected]>
          (c) 2004-2010 v9/fakehalo <[email protected]>


cw is a colorer for command-line programs. It is designed to be transparent: when you type 'du', 'df', 'ping', etc. in your shell the output is automatically colored according to a definition script, but when the commands are used non-interactively (e.g. in another script) their output is not colored, so as not to confuse programs that process their output. Text patterns are defined as lexical classes, and assigned colors. The arguments to the original program and OS under which it is running can be tested. cw includes over 50 definition scripts, and it's easy to write more.

cw is distributed under the GNU General Public License version 3, or, at your option, any later version.


Install cw using LuaRocks from :

luarocks install cw

Note: you must already have automake installed.

To use cw, you need to prepend its definition directory to the PATH environment variable. You should do this in your shell's interactive startup file (you don't want cw being run by background commands). For example, for bash and other Bourne-compatible shells, add the following line to your ~/.bashrc:

if [ -n "$PS1" ]; then PATH=cw-definitions-path:$PATH; export PATH; fi

The test of $PS1 ensures that the shell is really interactive.


Start a new shell and try some commands, which should now be colored! See cw(1) (the cw man page) for more information, including details of definition scripts.

Alternatives to cw

cw doesn't try to replace some dedicated coloring wrappers and programs, such as:

ccal: colorgcc: colordiff: colormake: freecolor:

There are also other programs like cw that you may prefer:

Crayonizer: acoc:

Related Repositories



Source code to omnibus edition of _The Busy Coder's Guide to Android Development ...



Source Code to _The Busy Coder's Guide To Advanced Android Development_ ...



Source Code to _The Busy Coder's Guide To Android Development_ ...



CuSha is a CUDA-based vertex-centric graph processing framework that uses G-Shar ...



Raspberry Pi CW Transmitter ...

Top Contributors

rrthomas blueyed


-   v2.0.4 zip tar
-   v2.0.3 zip tar
-   v2.0.2 zip tar
-   v2.0.1 zip tar
-   v2.0.0 zip tar
-   release-v2.0.1 zip tar
-   release-v2.0.0 zip tar