All Projects → dalance → pipecolor

dalance / pipecolor

Licence: MIT License
A terminal filter to colorize output

Programming Languages

rust
11053 projects
Makefile
30231 projects

Projects that are alternatives of or similar to pipecolor

Onhold
🔊 Play sounds while and after shell jobs complete
Stars: ✭ 146 (+758.82%)
Mutual labels:  pipeline, command-line-tool
Ttyplot
a realtime plotting utility for terminal/console with data input from stdin
Stars: ✭ 532 (+3029.41%)
Mutual labels:  pipeline, command-line-tool
elasticsearch-ingest-attachment-plugin-example
Example of how to use ElasticSearch ingest-attachment plugin using JavaScript
Stars: ✭ 19 (+11.76%)
Mutual labels:  pipeline
minimist2
TypeScript/JavaScript ES6 rewrite of popular Minimist argument parser
Stars: ✭ 20 (+17.65%)
Mutual labels:  command-line-tool
editorconfig-cli
📝🔧 initialize .editorconfig in your terminal
Stars: ✭ 26 (+52.94%)
Mutual labels:  command-line-tool
gogs-bash
Bash Script for Interacting with the GOGS API
Stars: ✭ 31 (+82.35%)
Mutual labels:  command-line-tool
gitlab-merger-bot
GitLab Merger Bot
Stars: ✭ 23 (+35.29%)
Mutual labels:  pipeline
electron-open-url
Open URL with Electron window from command line or Node.js program
Stars: ✭ 16 (-5.88%)
Mutual labels:  command-line-tool
nycurl
A web server that fetches data from the New York Times and formats it for display in the terminal.
Stars: ✭ 27 (+58.82%)
Mutual labels:  command-line-tool
coronavirus-stats
Automatically scrape data and statistics on Coronavirus to make them easily accessible in CSV format
Stars: ✭ 47 (+176.47%)
Mutual labels:  pipeline
go
Go-based command-line tool for the remove.bg API
Stars: ✭ 91 (+435.29%)
Mutual labels:  command-line-tool
dropEst
Pipeline for initial analysis of droplet-based single-cell RNA-seq data
Stars: ✭ 71 (+317.65%)
Mutual labels:  pipeline
JT1078Gateway
基于Pipeline实现的JT1078Gateway支持TCP/UDP,目前只支持http-flv、ws-flv、hls三种拉流方式
Stars: ✭ 50 (+194.12%)
Mutual labels:  pipeline
Pomodoro-Calculator
A pretty command line tool to calculate the number of pomodoros available between two points in time.
Stars: ✭ 20 (+17.65%)
Mutual labels:  command-line-tool
bistro
A library to build and execute typed scientific workflows
Stars: ✭ 43 (+152.94%)
Mutual labels:  pipeline
Deep-Inside
Command line tool that allows you to explore IoT devices by using Shodan API.
Stars: ✭ 22 (+29.41%)
Mutual labels:  command-line-tool
hoard
cli command organizer written in rust
Stars: ✭ 71 (+317.65%)
Mutual labels:  command-line-tool
Zeiver
A Scraper, Downloader, & Recorder for static open directories.
Stars: ✭ 14 (-17.65%)
Mutual labels:  command-line-tool
goto
Goto - The Good Way to Program
Stars: ✭ 14 (-17.65%)
Mutual labels:  command-line-tool
cfdns
Command line tool for manipulating DNS of CloudFlare hosted domains
Stars: ✭ 20 (+17.65%)
Mutual labels:  command-line-tool

pipecolor

A terminal filter to colorize output

Actions Status Crates.io codecov

Description

pipecolor is a terminal filter to colorize output. You can customize the colorize rule by regular expression.

Demo

demo

Install

Download from release page, and extract to the directory in PATH.

Alternatively you can install by cargo.

cargo install pipecolor

Put the colorize rule file to ~/.pipecolor.toml.

sample/pipecolor.toml in this repository is an example.

Usage

pipecolor can receive input through pipe, and colorize the output.

$ cat sample/access_log | pipecolor -c ./sample/pipecolor.toml

Filenames can be specified.

$ pipecolor -c ./sample/pipecolor.toml sample/maillog

If output is redirected to a file, colorization is disabled automatically. You can force to colorize by pipecolor --mode always.

Colorize rule

See the example rule sample/pipecolor.toml.

[[lines]]
    pat  = "^(.*?) .*? .*? \\[(.*?)\\] \".*?\" .*? .*? \".*?\" \"(.*?)\""
    colors = ["White", "LightGreen", "LightBlue", "Green"]
    [[lines.tokens]]
        pat   = "GET"
        colors = ["LightCyan"]
    [[lines.tokens]]
        pat   = "POST"
        colors = ["LightYellow"]
    [[lines.tokens]]
        pat   = "HEAD"
        colors = ["LightMagenta"]

lines.pat is a regular expression to specify colorize lines. If the expression is matched, the matched line is colorize to colors specified by lines.colors.

lines.colors is an array of colors, the first color is used to colorize the whole line. The rest colors are used to colorize the captured group in the expression. In the example, the whole line is colorized to White, the first group captured by (.*?) is colorized to LightGreen.

lines.tokens specifies the special tokens to be colorized in the matched line.

If no token is required, tokens can be empty list.

[[lines]]
    pat  = "^(.*?) .*? .*? \\[(.*?)\\] \".*?\" .*? .*? \".*?\" \"(.*?)\""
    colors = ["White", "LightGreen", "LightBlue", "Green"]
    tokens = []

Available colors

The available colors are below.

  • Black
  • Blue
  • Cyan
  • Default
  • Green
  • LightBlack
  • LightBlue
  • LightCyan
  • LightGreen
  • LightMagenta
  • LightRed
  • LightWhite
  • LightYellow
  • Magenta
  • Red
  • White
  • Yellow
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].