Skip to content

A fast and memory-safe stdout colorizer for a general DX better experience.

License

Notifications You must be signed in to change notification settings

rafaelrcamargo/cout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logo

🎨 COUT - Colored Output

A fast and memory-safe stdout colorizer for a general DX better experience.

GitHub GitHub tag (latest SemVer) GitHub last commit

⚙️ Build

Build the project with Rust and can be built with cargo:

cargo build --release

After the build, the binary will be located in target/release/cout. And for a easier use, you can add the binary to your PATH environment variable.

export PATH=$PATH:$(pwd)/target/release/cout

🔬 Usage

cout can be used with any bash command, just pipe the output to cout and it will colorize it, for example:

ls -la | cout # Use the built-in default profile
cargo -V | cout info # Use the built-in info profile
nmap google.com | cout nmap # Use a custom profile

📝 Profiles

cout has a default built-in profile and a info example of a custom profile which can be used as a template for your own custom profiles.

The profiles are located in the config directory of your OS, for example:

# 🐧 Linux
~/.config/cout/

# 🍎 MacOS
~/Library/Application Support/cout/

# 🪟 Windows
%APPDATA%\cout\

And the profiles are written in TOML format, for example:

patterns = [
  ["[0-9]{4}-[0-9]{2}-[0-9]{2}", "blue"], # Dates
  ["[0-9]{2}:[0-9]{2}:[0-9]{2}", "brightblue"], # Time
  ["(DEBUG|INFO|WARN|ERROR|FATAL)", "black"], # Log levels
  ['''[0-9]+\.[0-9]+\.[0-9]+''', "green"], # SemVer
]

The patterns array is a list of regex patterns and colors, the colors can be any of the ANSI colors.

📋 Examples

Here are some usages of cout:

📥 Ping 📤

ping ping colored

🔍 Nmap 🔎

nmap nmap colored

Note: cout is not a replacement for the original command, it just colorizes the output in a generic way for a better DX with broader compatibility.

🔓 License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

About

A fast and memory-safe stdout colorizer for a general DX better experience.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages