{"id":24756336,"url":"https://github.com/dalance/pipecolor","last_synced_at":"2025-04-04T18:06:05.512Z","repository":{"id":31272518,"uuid":"127103610","full_name":"dalance/pipecolor","owner":"dalance","description":"A terminal filter to colorize output","archived":false,"fork":false,"pushed_at":"2025-03-10T20:27:02.000Z","size":642,"stargazers_count":69,"open_issues_count":6,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T17:07:34.555Z","etag":null,"topics":["command-line-tool","pipeline","rust","terminal"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dalance.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"dalance"}},"created_at":"2018-03-28T07:46:53.000Z","updated_at":"2025-03-10T20:26:58.000Z","dependencies_parsed_at":"2024-02-06T21:38:09.261Z","dependency_job_id":"b34fa643-ede0-437d-971a-332931b47075","html_url":"https://github.com/dalance/pipecolor","commit_stats":{"total_commits":164,"total_committers":3,"mean_commits":"54.666666666666664","dds":0.5060975609756098,"last_synced_commit":"f75c3f6d77a117d897aa55e119117a6e2d7e6ffb"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalance%2Fpipecolor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalance%2Fpipecolor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalance%2Fpipecolor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalance%2Fpipecolor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dalance","download_url":"https://codeload.github.com/dalance/pipecolor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247226213,"owners_count":20904465,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line-tool","pipeline","rust","terminal"],"created_at":"2025-01-28T13:50:54.206Z","updated_at":"2025-04-04T18:06:05.493Z","avatar_url":"https://github.com/dalance.png","language":"Rust","funding_links":["https://github.com/sponsors/dalance"],"categories":[],"sub_categories":[],"readme":"# pipecolor\nA terminal filter to colorize output\n\n[![Actions Status](https://github.com/dalance/pipecolor/workflows/Regression/badge.svg)](https://github.com/dalance/pipecolor/actions)\n[![Crates.io](https://img.shields.io/crates/v/pipecolor.svg)](https://crates.io/crates/pipecolor)\n\n## Description\n\n**pipecolor** is a terminal filter to colorize output.\nYou can customize the colorize rule by regular expression.\n\n## Demo\n\n![demo](https://github.com/dalance/pipecolor/blob/master/sample/pipecolor.gif)\n\nThis demonstration uses `./sample/demo.toml` configuration.\n\n## Install\nDownload from [release page](https://github.com/dalance/pipecolor/releases/latest), and extract to the directory in PATH.\n\nAlternatively you can install by [cargo](https://crates.io).\n\n```\ncargo install pipecolor\n```\n\nPut the colorize rule file to `~/.pipecolor.toml`.\n\n`sample/pipecolor.toml` in this repository is an example.\n\n## Usage\n\n**pipecolor** can receive input through pipe, and colorize the output.\n\n```\n$ cat sample/access_log | pipecolor -c ./sample/pipecolor.toml\n```\n\n\u003ca\u003e\u003cimg src=\"https://rawgit.com/dalance/pipecolor/master/sample/access_log.svg\"/\u003e\u003c/a\u003e\n\nFilenames can be specified.\n\n```\n$ pipecolor -c ./sample/pipecolor.toml sample/maillog\n```\n\n\u003ca\u003e\u003cimg src=\"https://rawgit.com/dalance/pipecolor/master/sample/maillog.svg\"/\u003e\u003c/a\u003e\n\nIf output is redirected to a file, colorization is disabled automatically.\nYou can force to colorize by `pipecolor --mode always`.\n\n### Colorize rule\n\nSee the example rule `sample/pipecolor.toml`.\n\n```\n[[lines]]\n    pat  = \"^(.*?) .*? .*? \\\\[(.*?)\\\\] \\\".*?\\\" .*? .*? \\\".*?\\\" \\\"(.*?)\\\"\"\n    colors = [\"White\", \"LightGreen\", \"LightBlue\", \"Green\"]\n    [[lines.tokens]]\n        pat   = \"GET\"\n        colors = [\"LightCyan\"]\n    [[lines.tokens]]\n        pat   = \"POST\"\n        colors = [\"LightYellow\"]\n    [[lines.tokens]]\n        pat   = \"HEAD\"\n        colors = [\"LightMagenta\"]\n```\n\n`lines.pat` is a regular expression to specify colorize lines.\nIf the expression is matched, the matched line is colorize to colors specified by `lines.colors`.\n\n`lines.colors` is an array of colors, the first color is used to colorize the whole line.\nThe rest colors are used to colorize the captured group in the expression.\nIn the example, the whole line is colorized to `White`, the first group captured by `(.*?)` is colorized to `LightGreen`.\n\n`lines.tokens` specifies the special tokens to be colorized in the matched line.\n\nIf no token is required, `tokens` can be omitted.\n\n```\n[[lines]]\n    pat  = \"^(.*?) .*? .*? \\\\[(.*?)\\\\] \\\".*?\\\" .*? .*? \\\".*?\\\" \\\"(.*?)\\\"\"\n    colors = [\"White\", \"LightGreen\", \"LightBlue\", \"Green\"]\n```\n\n### Available colors\n\nThe available colors are below.\n\n- Black\n- Blue\n- Cyan\n- Default\n- Green\n- LightBlack\n- LightBlue\n- LightCyan\n- LightGreen\n- LightMagenta\n- LightRed\n- LightWhite\n- LightYellow\n- Magenta\n- Red\n- White\n- Yellow\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdalance%2Fpipecolor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdalance%2Fpipecolor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdalance%2Fpipecolor/lists"}