Automic VaultAutomic Vault

brew

Install hgrep with Homebrew, MacPorts, Nix

Grep with human-friendly search results. Version 0.3.9 via Homebrew; verified from local package data.

install

Additional install commands

macOS

Homebrewverified · 100%
brew install hgrep

local Homebrew formula metadata

MacPortsverified · 94%
sudo port install hgrep

MacPorts ports tree · textproc/hgrep/Portfile · source: api.github.com

Linux

Nixverified · 92%
nix profile install nixpkgs#hgrep

nixpkgs package indexes · pkgs/by-name/hg/hgrep/package.nix · source: api.github.com

overview

Package summary

Grep with human-friendly search results

Commands and aliases

  • hgrep

history

Project history and usage

hgrep is a Rust command-line search presenter that aims to make local grep results look more like code-search output: matched regions are shown as syntax-highlighted snippets with useful surrounding context.

Its niche is deliberately narrow. Rather than replacing grep or ripgrep outright, it wraps a built-in subset of ripgrep or reads `grep -nH` and `rg -nH` output from standard input, then formats results with syntect or bat-backed printers.

Project history

The public release line begins with v0.1.x tags in October 2021. The README describes the original product idea as combining ripgrep-style search with bat-style highlighted display, while keeping a pipe-friendly mode for existing grep workflows.

The 0.2 and 0.3 series show the project tightening around terminal ergonomics: generated shell completions and man pages, binary release archives, static Linux builds, macOS and Windows support, and improved handling of color capability and encodings.

Adoption history

The official README documents installation through release binaries, Homebrew, MacPorts, NetBSD pkgsrc/pkgin, Debian-style `.deb` packages, and Cargo. That packaging spread matches hgrep's role as a small terminal utility rather than a library platform.

The project also exposes feature flags so users can keep the built-in ripgrep search, the syntect printer, or the bat printer, which made it practical for package maintainers and source builders to tune dependency weight.

How it is used

Typical use is either `hgrep pattern path` for its built-in ripgrep subset or `rg -nH pattern path | hgrep` when the user wants full ripgrep behavior and hgrep only as the display stage.

hgrep is most useful when raw grep output has too little context: it groups nearby matches, chooses context around blank lines, applies syntax highlighting, and can generate shell completions or a manual page for packaged installs.

Why package nerds care

For package-manager users, hgrep is an example of the Rust CLI ecosystem's composable-search style: ripgrep supplies fast traversal and matching, bat/syntect supply readable code presentation, and the final binary stays scriptable.

It is also interesting as a dependency-shaping package. Builders can choose feature combinations to trade install time, binary size, and formatting behavior instead of carrying every optional printer path.

Timeline

  • 2021: v0.1.x public tags establish the Rust CLI release line.
  • 2021: v0.2.0 follows within weeks, continuing rapid terminal-search iteration.
  • 2023: v0.3.0 updates syntect and bat integration and adds manual-page generation.
  • 2024: v0.3.7 adds broader text-encoding support, including BOM-based detection.
  • 2025: v0.3.9 adds Arm Windows release artifacts and additional language/theme support.

Related projects

  • ripgrep is the closest search-engine relative: hgrep can embed a subset of ripgrep or consume `rg -nH` output.
  • bat and syntect are presentation relatives: hgrep uses them as alternative syntax-highlighted output paths.
  • Traditional grep remains part of the workflow because hgrep can read `grep -nH` output from standard input.

Sources

  • Changelog: https://github.com/rhysd/hgrep/blob/master/CHANGELOG.md
  • README: https://github.com/rhysd/hgrep#readme
  • Repository tags: https://github.com/rhysd/hgrep/tags

security posture

Risk level: green

narrow executable package without higher-risk signals.

Risk classifier

green risk · low confidence · appliance

Why

  • narrow executable package without higher-risk signals

Signals

  • metadata:no-higher-risk-signals

Install behavior

  • No Homebrew post-install hook is recorded in formula metadata.
  • Homebrew bottle metadata is available for 6 platform targets.
  • Build metadata lists 1 build dependencies.

Recommended review

Before unattended agent use, check whether the tool reads plaintext credentials, writes remote state, publishes artifacts, or shells out to plugins.

executables

Installed executables

CommandKindExposureNote
hgrepcliglobal executable

freshness

Version and freshness

These signals separate page generation age, package-manager activity, and upstream release comparison. Version lag is warned only when an evidence URL and comparable versions are present.

page generated2026-07-08
manager version0.3.9
manager updated
local dataok
upstreamcurrent
latest detectedv0.3.9

https://github.com/rhysd/hgrep

  • infoNo package-manager update timestamp was available.low confidence

install metadata

Package metadata

Package keybrew:hgrep
Version0.3.9
Package managerHomebrew
Package manager pagehttps://formulae.brew.sh/formula/hgrep
Homepagehttps://github.com/rhysd/hgrep
Repositoryhttps://github.com/rhysd/hgrep
Upstream docshttps://github.com/rhysd/hgrep#readme
LicenseMIT
Source archivehttps://github.com/rhysd/hgrep/archive/refs/tags/v0.3.9.tar.gz
Build dependenciesrust
Bottleavailable (on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux)
Homebrew post-installnot defined
Servicenone declared

registry facts

Source database details

Source DatabaseHomebrew formula API
Taphomebrew/core
Full Namehgrep
Version Scheme0
Revision0
Head VersionHEAD
Bottle Stable Root URLhttps://ghcr.io/v2/homebrew/core
Deprecatedno
Disabledno
Keg Onlyno
URL Keys
  • head
  • stable

source database matches

Other package-manager records

Matches are pulled from external package-manager indexes and kept separate from local Automic Vault package links.

Nix95%

hgrep

nix profile install nixpkgs#hgrep
  • normalized package name match
  • Matched by: Hgrep
nixpkgs package indexes · api.github.com · nixpkgs package indexes: pkgs/by-name/hg/hgrep/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
MacPorts95%

hgrep

sudo port install hgrep
  • normalized package name match
  • Matched by: Hgrep
MacPorts ports tree · api.github.com · MacPorts ports tree: textproc/hgrep/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

source trail

Generated from repository data

This page is generated by av-web from the private package SQLite artifact built by scripts/generate-pkg-sqlite.py.

Used sources

  • Geiger risk classifier
  • Nucleus package database
  • av.db category and tag curation
  • cross-ecosystem install command graph
  • curated package history
  • external package-manager database matches
  • package relationship graph
  • package version freshness
  • package-page enrichment