hgrep
brew install hgrep
v0.3.9
MIT
Grep with human-friendly search results
5
30-day installs · #10888
8
90-day · #12602
193
365-day · #7452
515
★ GitHub stars · updated 4mo ago
Build dependencies
GitHub topics
bat
grep
pretty-print
ripgrep
syntax-highlighting
Links
- https://github.com/rhysd/hgrep
- GitHub: rhysd/hgrep
- Brew formula source: Formula/h/hgrep.rb
Raw metadata
{
"aliases": [],
"alternatives": [],
"build_dependencies": [
"rust"
],
"categories": [],
"caveats": null,
"conflicts_with": [],
"dependencies": [],
"deprecated": 0,
"deprecation_reason": null,
"desc": "Grep with human-friendly search results",
"disable_reason": null,
"disabled": 0,
"enrichment_fetched_at": "2026-06-20T23:38:38+00:00",
"first_seen": "2026-06-20T23:34:18+00:00",
"full_name": "hgrep",
"github_default_branch": "main",
"github_last_commit_at": "2026-04-25T14:39:49Z",
"github_readme_excerpt": "hgrep: Human-friendly GREP\n==========================\n[![CI][ci-badge]][ci]\n[![crate][crates-io-badge]][crates-io]\n[![Coverage][codecov-badge]][codecov]\n\n[hgrep][] is a grep tool to search files with a given pattern and print the matched code snippets with human-friendly syntax\nhighlighting. This tool brings search results like the code search on GitHub to your local machine. In short, it\u0027s something like\nsearching files with [ripgrep][] and showing results with [bat][].\n\nThis is similar to `-C` option of `grep` command. hgrep is useful to survey the matches with contexts around them. When some\nmatches are near enough, hgrep prints the lines within one code snippet. Unlike `grep -C`, hgrep adopts some heuristics around\nblank lines to determine an efficient number of context lines.\n\n\u003cimg src=\"https://github.com/rhysd/ss/raw/master/hgrep/main.png\" alt=\"screenshot\" width=\"682\" /\u003e\n\nExample:\n\n```sh\n# Use built-in subset of ripgrep (optional)\nhgrep pattern ./dir\n\n# Read results of grep command via stdin\ngrep -nH pattern -R ./dir | hgrep\nrg -nH pattern ./dir | hgrep\n```\n\nhgrep provides two printers to print match results for your use case. Please see [\u0027`bat` printer v.s. `syntect` printer\u0027][bat-vs-syntect]\nsection for the comparison.\n\n- `syntect` printer (default): Our own implementation of printer using [syntect][] library. Performance, output layout, and color\n themes are more optimized\n- `bat` printer: Printer built on top of [bat][]\u0027s pretty printer implementation, which is battle-tested and provides some unique\n features\n\nPlease see [the usage section](#usage) for more details.\n\n## Installation\n\n### Binary releases\n\nVisit [the releases page][releases] and download the zip file for your platform. Unarchive the file and put the executable file\nin some `$PATH` directory. Currently, the following targets are supported. If you want a binary for some other platform, feel free\nto make an issue to request it.\n\n- Linux (x86_64-gnu, x86_64-musl, aarch64-gnu)\n- macOS (x86_64, ",
"github_repo": "rhysd/hgrep",
"github_stars": 515,
"github_topics": [
"bat",
"grep",
"pretty-print",
"ripgrep",
"syntax-highlighting"
],
"homepage": "https://github.com/rhysd/hgrep",
"homepage_og_description": null,
"homepage_og_image": null,
"homepage_title": null,
"installs_30d": 5,
"installs_365d": 193,
"installs_90d": 8,
"keg_only": 0,
"keg_only_reason": null,
"last_seen": "2026-06-20T23:34:18+00:00",
"license": "MIT",
"llm_generated_at": null,
"llm_model": null,
"name": "hgrep",
"oldnames": [],
"one_liner": null,
"optional_dependencies": [],
"rank_30d": 10888,
"rank_365d": 7452,
"rank_90d": 12602,
"raw_hash": "555d7be9a421aa85",
"recommended_dependencies": [],
"revision": 0,
"ruby_source_path": "Formula/h/hgrep.rb",
"tap": "homebrew/core",
"test_dependencies": [],
"uses_from_macos": [],
"version_head": "HEAD",
"version_stable": "0.3.9",
"versioned_formulae": [],
"why_use_this": null
}