A fast, Rust-based command-line tool that colorizes the output of other commands using regex-based rules. Drop-in replacement for grc with better performance.
Shell (curl):
curl -sS https://raw.githubusercontent.com/lazywalker/rgrc/master/script/install.sh | sh
Cargo:
cargo install rgrc --features embed-configs
Homebrew:
brew tap lazywalker/rgrc
brew install rgrc
Arch Linux:
yay -S rgrc
Alpine Linux:
# Enable the testing repository (add edge testing)
doas cp /etc/apk/repositories /etc/apk/repositories.bak
echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" | doas tee -a /etc/apk/repositories
doas apk update
doas apk add rgrc
NixOS:
nix-shell -p rgrc
Debian/Ubuntu:
# Download the latest .deb from releases and install
sudo dpkg -i rgrc_<version>_amd64.deb
# Colorize any command
rgrc ping -c 4 google.com
rgrc docker ps
rgrc df -h
# Set up aliases (recommended)
echo 'eval "$(rgrc --aliases)"' >> ~/.bashrc
source ~/.bashrc
# Then use commands directly
ping -c 4 google.com # automatically colorized
docker ps # automatically colorized
System: df, free, ps, top, vmstat, iostat, uptime, mount
Network: ping, traceroute, netstat, ss, ip, curl, dig
Development: gcc, make, docker, kubectl, git, mvn, go
Files: ls, find, du, fdisk, lsof, stat
See full list in share/ directory
Usage: rgrc [OPTIONS] COMMAND [ARGS...]
Options:
--color, --colour Override color output (on|off|auto)
--aliases Output shell aliases for available binaries
--all-aliases Output all shell aliases
--except CMD,.. Exclude commands from alias generation
--completions SHELL Print shell completion script for SHELL (bash|zsh|fish|ash)
--flush-cache Flush and rebuild cache directory
--config, -c NAME Explicit config file name (e.g., df to load conf.df)
--help, -h Show this help message
--version, -V Show installed rgrc version and exit
Create ~/.config/rgrc/conf.mycommand:
regexp=^ERROR
colours=red,bold
regexp=^WARNING
colours=yellow
regexp=^INFO
colours=green
Add to ~/.rgrc:
mycommand
conf.mycommand
# Bash
rgrc --completions bash > /etc/bash_completion.d/rgrc
# Zsh
rgrc --completions zsh > ~/.zfunc/_rgrc
# Fish
rgrc --completions fish > ~/.config/fish/completions/rgrc.fish
See DEVELOPMENT.md for instructions on adding new commands.
MIT - see LICENSE for details.
Inspired by grc by Radovan GarabĂk and grc-rs by Lars Christensen.