macOS
brew install hgreplocal Homebrew formula metadata
sudo port install hgrepMacPorts ports tree · textproc/hgrep/Portfile · 来源: api.github.com
安装
brew install hgreplocal Homebrew formula metadata
sudo port install hgrepMacPorts ports tree · textproc/hgrep/Portfile · 来源: api.github.com
nix profile install nixpkgs#hgrepnixpkgs package indexes · pkgs/by-name/hg/hgrep/package.nix · 来源: api.github.com
概览
Grep with human-friendly search results
历史
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.
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.
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.
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.
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.
安全态势
narrow executable package without higher-risk signals.
绿色 风险 · 低 置信度 · appliance
在无人值守的代理使用前,请检查该工具是否读取明文凭据、写入远程状态、发布制品或调用插件。
可执行文件
| 命令 | 类型 | 暴露范围 | 备注 |
|---|---|---|---|
hgrep | 可执行文件 | 已索引可执行文件 | 从本地可执行文件索引发现。 |
新鲜度
这些信号区分页生成时间、软件包管理器活动和上游发布比较。只有存在证据 URL 和可比较版本时,才会提示版本落后。
安装元数据
| 软件包键 | brew:hgrep |
|---|---|
| 版本 | 0.3.9 |
| 软件包管理器 | Homebrew |
| 主页 | https://github.com/rhysd/hgrep |
| 仓库 | https://github.com/rhysd/hgrep |
| Bottle | 未记录 |
| 服务 | 未声明 |
源数据库匹配
匹配项来自外部软件包管理器索引,并与本地 Automic Vault 软件包链接分开显示。
hgrep
nix profile install nixpkgs#hgrephgrep
sudo port install hgrep来源线索
此页面由 av-web 从 scripts/generate-pkg-sqlite.py 生成的私有软件包 SQLite 工件提供。
View the package source record on GitHub.