{"id":13895016,"url":"https://github.com/arsham/blush","last_synced_at":"2025-04-05T06:08:56.804Z","repository":{"id":38434439,"uuid":"134265692","full_name":"arsham/blush","owner":"arsham","description":"Grep with colours","archived":false,"fork":false,"pushed_at":"2023-09-03T19:23:19.000Z","size":157,"stargazers_count":553,"open_issues_count":0,"forks_count":18,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-29T05:08:22.588Z","etag":null,"topics":["go","golang","grep","terminal-app"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/arsham.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2018-05-21T12:23:36.000Z","updated_at":"2025-01-17T06:42:46.000Z","dependencies_parsed_at":"2024-06-20T15:32:19.602Z","dependency_job_id":"5377f112-f51b-4f72-bd30-f7536f88e96a","html_url":"https://github.com/arsham/blush","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arsham%2Fblush","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arsham%2Fblush/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arsham%2Fblush/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arsham%2Fblush/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arsham","download_url":"https://codeload.github.com/arsham/blush/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247294540,"owners_count":20915340,"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":["go","golang","grep","terminal-app"],"created_at":"2024-08-06T18:01:56.111Z","updated_at":"2025-04-05T06:08:56.784Z","avatar_url":"https://github.com/arsham.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# Blush\n\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/arsham/dbtools)](https://pkg.go.dev/github.com/arsham/dbtools)\n![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/arsham/dbtools)\n[![Build Status](https://github.com/arsham/dbtools/actions/workflows/go.yml/badge.svg)](https://github.com/arsham/dbtools/actions/workflows/go.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![Coverage Status](https://codecov.io/gh/arsham/blush/branch/master/graph/badge.svg)](https://codecov.io/gh/arsham/blush)\n[![Go Report Card](https://goreportcard.com/badge/github.com/arsham/blush)](https://goreportcard.com/report/github.com/arsham/blush)\n\nWith Blush, you can highlight matches with any colours of your choice.\n\n![1](https://user-images.githubusercontent.com/428611/164768864-e9713ac3-0097-4435-8bcb-577dbf7b9931.png)\n\n1. [Install](#install)\n2. [Usage](#usage)\n   - [Note](#note)\n   - [Normal Mode](#normal-mode)\n   - [Dropping Unmatched](#dropping-unmatched)\n   - [Piping](#piping)\n3. [Arguments](#arguments)\n   - [Notes](#notes)\n4. [Colour Groups](#colour-groups)\n5. [Colours](#colours)\n6. [Complex Grep](#complex-grep)\n7. [Suggestions](#suggestions)\n8. [License](#license)\n\n## Install\n\nYou can grab a binary from [releases](https://github.com/arsham/blush/releases)\npage. If you prefer to install it manually you can get the code and install it\nwith the following command:\n\n```bash\n$ go install github.com/arsham/blush@latest\n```\n\nMake sure you have `go\u003e=1.18` installed.\n\n## Usage\n\nBlush can read from a file or a pipe:\n\n```bash\n$ cat FILENAME | blush -b \"print in blue\" -g \"in green\" -g \"another green\"\n$ cat FILENAME | blush \"some text\"\n$ blush -b \"print in blue\" -g \"in green\" -g \"another green\" FILENAME\n$ blush \"some text\" FILENAME\n```\n\n### Note\n\nAlthough this program has a good performance, but performance is not the main\nconcern. There are other tools you should use if you are searching in large\nfiles. Two examples:\n\n- [Ripgrep](https://github.com/BurntSushi/ripgrep)\n- [The Silver Searcher](https://github.com/ggreer/the_silver_searcher)\n\n### Normal Mode\n\nThis method shows matches with the given input:\n\n```bash\n$ blush -b \"first search\" -g \"second one\" -g \"and another one\" files/paths\n```\n\nAny occurrence of `first search` will be in blue, `second one` and `and another one`\nare in green.\n\n![2](https://user-images.githubusercontent.com/428611/164768874-bf687313-c103-449b-bb57-6fdcea51fc5d.png)\n\n### Dropping Unmatched\n\nBy default, unmatched lines are not dropped. But you can use the `-d` flag to\ndrop them:\n\n![3](https://user-images.githubusercontent.com/428611/164768875-c9aa3e47-7db0-454f-8a55-1e2bff332c69.png)\n\n## Arguments\n\n| Argument      | Shortcut | Notes                                           |\n| :------------ | :------- | :---------------------------------------------- |\n| N/A           | -i       | Case insensitive matching.                      |\n| N/A           | -R       | Recursive matching.                             |\n| --no-filename | -h       | Suppress the prefixing of file names on output. |\n| --drop        | -d       | Drop unmatched lines                            |\n\nFile names or paths are matched from the end. Any argument that doesn't match\nany files or paths are considered as regular expression. If regular expressions\nare not followed by colouring arguments are coloured based on previously\nprovided colour:\n\n```bash\n$ blush -b match1 match2 FILENAME\n```\n\n![4](https://user-images.githubusercontent.com/428611/164768879-f9b73b2c-b6bb-4cf5-a98a-e51535fa554a.png)\n\n### Notes\n\n- If no colour is provided, blush will choose blue.\n- If you only provide file/path, it will print them out without colouring.\n- If the matcher contains only alphabets and numbers, a non-regular expression is applied to search.\n\n## Colour Groups\n\nYou can provide a number for a colour argument to create a colour group:\n\n```bash\n$ blush -r1 match1 -r2 match2 -r1 match3 FILENAME\n```\n\n![5](https://user-images.githubusercontent.com/428611/164768882-5ce57477-e9d5-4170-ac10-731e9391cbee.png)\n\nAll matches will be shown as blue. But `match1` and `match3` will have a\ndifferent background colour than `match2`. This means the numbers will create\ncolour groups.\n\nYou also can provide a colour with a series of match requests:\n\n```bash\n$ blush -r match1 match3 -g match2 FILENAME\n```\n\n## Colours\n\nYou can choose a pre-defined colour, or pass it your own colour with a hash:\n\n| Argument  | Shortcut |\n| :-------- | :------- |\n| --red     | -r       |\n| --green   | -g       |\n| --blue    | -b       |\n| --white   | -w       |\n| --black   | -bl      |\n| --yellow  | -yl      |\n| --magenta | -mg      |\n| --cyan    | -cy      |\n\nYou can also pass an RGB colour. It can be in short form (--#1b2, -#1b2), or\nlong format (--#11bb22, -#11bb22).\n\n![6](https://user-images.githubusercontent.com/428611/164768883-154b4fd9-946f-43eb-b3f5-ede6027c3eda.png)\n\n## Complex Grep\n\nYou must put your complex grep into quotations:\n\n```bash\n$ blush -b \"^age: [0-9]+\" FILENAME\n```\n\n![7](https://user-images.githubusercontent.com/428611/164768886-5b94b8fa-77e2-4617-80f2-040edce18660.png)\n\n## Suggestions\n\nThis tool is made to make your experience in terminal a more pleasant. Please\nfeel free to make any suggestions or request features by creating an issue.\n\n## License\n\nUse of this source code is governed by the MIT License. License file can be\nfound in the [LICENSE](./LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farsham%2Fblush","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farsham%2Fblush","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farsham%2Fblush/lists"}