Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/betafcc/clc
Tiny bash utility for coloring terminal output and prompt
https://github.com/betafcc/clc
ansi-colors bash formatting prompt tiny tty
Last synced: 3 months ago
JSON representation
Tiny bash utility for coloring terminal output and prompt
- Host: GitHub
- URL: https://github.com/betafcc/clc
- Owner: betafcc
- License: mit
- Created: 2019-01-17T12:06:29.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-06-13T09:49:34.000Z (over 3 years ago)
- Last Synced: 2024-06-26T00:38:34.194Z (5 months ago)
- Topics: ansi-colors, bash, formatting, prompt, tiny, tty
- Language: Shell
- Size: 585 KB
- Stars: 60
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# clc
Tiny bash utility for coloring terminal output and prompt![](./examples/usage.gif)
The motivating use case was easily stacking styles, which is not possible to do with other tools like [node's chalk](https://github.com/chalk/chalk-cli):
![](./examples/stacking.gif)
Useful for templating colorful prompts (use `-e|--escape [zsh|bash]` for this)
for bash: `PS1=$(clc -e bash ']>$ >')`
for zsh: `PS1=$(clc -e zsh ']>$ >')`
![](./examples/prompt.png)
## Try it
```bash
bash <(curl -s https://raw.githubusercontent.com/betafcc/clc/master/clc) ''
```## Install
```bash
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:
```bash
clc ''
```## More
### Use foreground colors:
```bash
clc ''
clc '>'
clc ''
clc ''
clc '<#f66: hello>'
clc '<#66fa73: hello>'
```### Use background colors:
```bash
clc ''
clc '>'
clc ''
clc ''
```### Use effects:
```bash
clc ''
clc '>'
```### Combine commands:
```bash
clc ''
```### Escape characters with '%':
```bash
clc '>'
```### Available Colors:
- black
- red
- green
- yellow
- blue
- magenta
- cyan
- white
- rgb <0-255> <0-255> <0-255>
- #000 - #fff
- #000000 - #ffffff### Available effects:
- normal
- bold
- dim
- strike
- italic
- underline
- reverse
- invisible
- blink### Version:
```bash
clc -v
clc --version
```