{"id":18716170,"url":"https://github.com/carlonluca/cgrc","last_synced_at":"2025-10-08T14:20:59.927Z","repository":{"id":54349588,"uuid":"520270134","full_name":"carlonluca/cgrc","owner":"carlonluca","description":"Rust/C++ implementation of grc.","archived":false,"fork":false,"pushed_at":"2024-07-25T17:57:18.000Z","size":932,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T08:07:32.954Z","etag":null,"topics":["command-line","command-line-tool","command-line-tools","logging"],"latest_commit_sha":null,"homepage":"https://bugfreeblog.duckdns.org/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/carlonluca.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2022-08-01T21:43:58.000Z","updated_at":"2025-03-16T10:19:09.000Z","dependencies_parsed_at":"2024-01-24T21:46:41.194Z","dependency_job_id":"a7e4e3fb-df34-408c-b9ef-665d24cccb80","html_url":"https://github.com/carlonluca/cgrc","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlonluca%2Fcgrc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlonluca%2Fcgrc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlonluca%2Fcgrc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlonluca%2Fcgrc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/carlonluca","download_url":"https://codeload.github.com/carlonluca/cgrc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248572078,"owners_count":21126580,"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","command-line-tool","command-line-tools","logging"],"created_at":"2024-11-07T13:11:47.240Z","updated_at":"2025-10-08T14:20:54.878Z","avatar_url":"https://github.com/carlonluca.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CGRC - C++ Generic Colorizer\n\n_NOTE: the current implementation is written in Rust. Go into the cgrc-rust directory for it._\n\ncgrc is a binary that can filter text to improve formatting in a console. It is based on the excellent [grc tool](https://github.com/garabik/grc), but it is written in C++ with Qt. It should be mostly compatible with it, but only a selection of features that I needed were implemented. The reason why cgrc exists is that grc proved to be too slow for me in a few cases, so I quickly implemented a version for myself in C++. This means that currently only a few configuration files are available, but you can add everything you need. Open a MR if you want to add something to the repo.\n\n## Usage\n\ncgrc should be mostly compatible with grc, so refer to https://github.com/garabik/grc for more info about the configuration file it needs. There are anyway a few changes that I found useful for me. This is the syntax of the command:\n\n```\nUsage: cgrc [options] conf\nConfigurable terminal text formatter\n\ncgrc formats text from stdin according to custom configuration files and outputs the result with ANSI escape codes to stdout. Configuration files includes a set of regular expressions with the related format to be used to the match and the captures.\n\nOptions:\n  -h, --help             Displays help on commandline options.\n  --help-all             Displays help including Qt specific options.\n  --version              Shows the version of the application\n  --list-locations       Shows the location to use for the conf files\n  --list-configurations  List available configurations\n\nArguments:\n  conf                   Configuration file\n```\n\n### List locations\n\ncgrc enumerates configuration files from three different locations:\n\n1. embedded configuration directory;\n2. user directory;\n3. system directory.\n\nThe first location searched by cgrc is the binary itself. The binary includes some typical conf files. These files can be used without placing any configuration file on disk. The user directory is a user-specific directory, typically located in the user's home. The system directory is a directory in the filesystem accessible by any user. By using the `--list-locations` options, you can print the exact locations on your system:\n\n```\nLocations on your system used by cgrc:\n        System location: \"/etc/cgrc\"\n        User location  : \"/home/luca/.config/cgrc\"\n```\n\nLocations may change according to the OS you are using or the installation method. Snap packages, for instance, cannot read regular locations under strict confinement.\n\n### List configurations\n\ncgrc can print a summary of all the configurations currently available:\n\n```\nEmbedded configurations:\n         :/conf/dockerps -\u003e Formats the output of docker ps.\n         :/conf/logcat -\u003e Parser the Android logcat output\n         :/conf/nginx -\u003e Formats the default nginx log output\n         :/conf/ping -\u003e Formats the output of the ping Linux command\n         :/conf/prio -\u003e Formats the output of logs containing typical words associated to priorities\n\nUser configurations:\n         /home/luca/.config/cgrc/conf.dockerps -\u003e ?\n\nSystem configurations:\n        None\n```\n\nThe description is included in the configuration file.\n\n### Run\n\ncgrc reads from stdin and outputs to stdout. Example:\n\n```\nping 192.168.0.2 | cgrc ping\n```\n\nwhere the second \"ping\" is the name of the configuration file to use. In this case, ping is a configuration file embedded in the binary.\n\n## Configuration\n\nRefer to the grc readme for writing configuration files. If you wrote conf files for grc, then it is likely it may also work with cgrc. cgrc also reads a \"desc\" field in the configuration file. This description is reported once the ```--list-configurations``` option is used.\n\n## Installation\n\n### Snap\n\nSnap packages are available for cgrc for architectures amd64, armhf and aarch64. To install:\n\n```sudo snap install cgrc --edge```\n\n### AUR\n\nAn entry is available in the AUR: https://aur.archlinux.org/packages/cgrc.\n\n### Build Yourself\n\ncgrc requires the Qt tools and the Qt base module \u003e= 5.15 (earlier versions are untested). It can only be built using cmake:\n\n```\nmkdir build\ncd build\ncmake ..\nmake\n```\n\n## Examples\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./doc/demo_ping.png\" width=\"50%\"\u003e\n  \u003cimg src=\"./doc/demo_dockerps.png\" width=\"100%\"\u003e\n\u003c/p\u003e\n\n## Configurations\n\nThere are only a few configurations available at the moment, the ones that I use. You can add your own configurations if you want into local files. If you want to share your configurations, please open a MR.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarlonluca%2Fcgrc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarlonluca%2Fcgrc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarlonluca%2Fcgrc/lists"}