Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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
```