Skip to content
/ ufc Public

🎨 The Ultimate Friendly Colorizer 🌈

License

Notifications You must be signed in to change notification settings

joeky888/ufc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’‘ Features

  • Single binary with almost zero setup
  • Command output highlighting
  • Shell completion generating (Bash, Zsh, Fish, Powershell, Elvish)
  • Built-in time mode via --time (like the time command) - Timing statistics when the subprogram exits
  • Built-in watch mode via --watch 3s (like the watch command) - Duration of waiting for executing subcommand periodically. Values can be 1.5h, 2m, 5s, 5 or 1.5h2m5s
  • Boost mode via --boost - Make mass stdout/stderr print faster
  • Written in safe rust

πŸ€” In a nutshell, ufc = grc + time + watch + shell completion + cross platform.

πŸ’» Platform support

  • Support Linux (macOS, FreeBSD and Android Termux should also work)
  • Support Cygwin/Msys2 and git-bash for Windows (CMD and Powershell are supported if the subcommand exists)

⚑️ Benchmark

  • Up to 12x faster than grc (compiled with cargo build --release)
    • Bechmarks on Linux with CPU Intel i5-8250U (4C8T) 3.400GHz, same regex on Alacritty terminal

Benchmark colorizer

journalctl --no-pager Time Ratio Boost Colorful
journalctl --no-pager 1m:02s 1.0 No No
ufc --boost journalctl --no-pager 1m:07s 1.08 Yes Yes
ufc journalctl --no-pager 1m:15s 1.21 No Yes
grc -es journalctl --no-pager 12m:52s 12.45 No Yes

πŸ“– Examples

ufc df -h

df

ufc ping google.com

ping

sudo ufc fdisk -l

fdisk

ufc top

top

🐚 Shell completion (Optional)

Bash: add this line to ~/.bashrc

source <(ufc completion bash)

bash

Zsh: add this line to ~/.zshrc

source <(ufc completion zsh)

zsh

Fish: add this line to config.fish

eval (ufc completion fish)

fish

PowerShell: add this line to profile.ps1

ufc completion powershell | Out-String | Invoke-Expression

powershell

πŸ† Milestones

This porject is still at an early stage of development.

  • Version 1.0.0 should support 10 subcommands
  • Version 2.0.0 should support 20 subcommands
  • Version 3.0.0 should support 30 subcommands

Currently supported commands are

  • df
  • docker (incomplete)
  • dig
  • du
  • env
  • fdisk
  • free
  • id
  • ifconfig
  • journalctl
  • ping
  • top

πŸ“” TODO

  • A built-in timeout command functionality
  • A built-in gamemode
  • Github badges
  • Dark/Light theme switch
  • Add more ValueHints for better shell completion generating
  • Add Crontab mode and Daemon mode (like the crontab command) - Runs the subprogram as a scheduling daemon
  • Colorize from stdout E.g. cat /path/to/file.log | ufc
  • A benchmark script
  • A built-in colored pager
  • Unit test for the fn colored_output()
  • Use async rust and show statistics of cpu and memory usage (Or a metrics exporter)

❀️ Credits

This project is powered and inspired by

  • grc - All syntax files are modified from grc (Regex definitions in Rust and Python are incompatible)
  • termcolor - Library for cross-platform terminal color
  • manpage - All completions and docs are copied from manpage
  • cobra/clap - Completion generating
  • fancy-regex - Library for regular expressions
  • fish (Issue#7451)
  • ohmyzsh
  • ugc - My previous work in Golang

πŸ“œ Licence

Public domain

About

🎨 The Ultimate Friendly Colorizer 🌈

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages