Tiny bash utility for coloring terminal output and prompt
The motivating use case was easily stacking styles, which is not possible to do with other tools like node's chalk:
Useful for templating colorful prompts (use -e|--escape [zsh|bash]
for this)
for bash: PS1=$(clc -e bash '<bold:<red:[<yellow:\\u><green:@><blue:\\h><magenta:\\W>]>$ >')
for zsh: PS1=$(clc -e zsh '<bold:<red:[<yellow:%n><green:@><blue:%m><magenta:%1d>]>$ >')
bash <(curl -s https://raw.githubusercontent.com/betafcc/clc/master/clc) '<red:hello <reverse:world>'
dest='/usr/local/bin/clc'; curl -s https://raw.githubusercontent.com/betafcc/clc/master/clc | sudo tee "${dest}" > /dev/null && sudo chmod +x "${dest}"
Then use:
clc '<red:hello <reverse:world>'
clc '<red:hello>'
clc '<green:hello <blue: world>>'
clc '<rgb 255 120 120: hello>'
clc '<rgb 255 120 120: hello>'
clc '<#f66: hello>'
clc '<#66fa73: hello>'
clc '<bg red:hello>'
clc '<bg green:hello <bg blue: world>>'
clc '<bg rgb 255 120 120: hello>'
clc '<bg #66fa73: hello>'
clc '<bold:hello>'
clc '<bold:hello <underline: world>>'
clc '<red + bg blue + underline + bold:hello>'
clc '<red:%<hello world%>>'
- black
- red
- green
- yellow
- blue
- magenta
- cyan
- white
- rgb <0-255> <0-255> <0-255>
- #000 - #fff
- #000000 - #ffffff
- normal
- bold
- dim
- strike
- italic
- underline
- reverse
- invisible
- blink
clc -v
clc --version