# 使用 Homebrew, apk, MacPorts, Nix, pacman, scoop 安装 htmlq

查看 htmlq 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:htmlq
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install htmlq
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install htmlq
```

  证据: MacPorts ports tree: www/htmlq/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add htmlq
```

  证据: Alpine Linux edge package indexes: htmlq from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- Nix (92%):

```sh
nix profile install nixpkgs#htmlq
```

  证据: nixpkgs package indexes: pkgs/by-name/ht/htmlq/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S htmlq
```

  证据: Arch Linux sync databases: htmlq from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

### Windows

- Scoop (92%):

```sh
scoop install main/htmlq
```

  证据: Scoop official bucket manifest trees: bucket/htmlq.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

## 软件包事实

- **软件包键:** brew:htmlq
- **软件包管理器:** Homebrew
- **版本:** 0.4.0
- **来源摘要:** Uses CSS selectors to extract bits content from HTML files
- **主页:** <https://github.com/mgdm/htmlq>
- **仓库:** <https://github.com/mgdm/htmlq>
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- htmlq (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 0.4.0
## 项目历史与用法

htmlq is a Rust command-line tool that applies CSS selectors to HTML input, deliberately positioning itself as 'like jq, but for HTML.' Its package-manager appeal is direct: it gives shell users a compact selector-based extractor for scraping, inspection, and pipeline work.

### 项目历史

The upstream README describes htmlq as a tool that extracts pieces of HTML files with CSS selectors. Michael Maclean's project post says it grew out of web-scraping work where Python and BeautifulSoup were workable but slow to start repeatedly inside shell-oriented loops.

The public release stream is small and concentrated: tags show v0.2.0 and v0.3.0 in September 2021 and v0.4.0 in January 2022. That pattern matches a focused utility whose interface stabilized around selector extraction, text output, attribute extraction, and shell installation paths.

### 采用历史

The README lists Cargo, FreeBSD pkg, Homebrew, and Scoop installation paths, while the input package facts also record Alpine, MacPorts, Nix, Arch, and Scoop packaging. That spread is notable for a small Rust CLI because it shows adoption by users who want jq-like HTML querying without writing per-task scripts.

### 使用方式

htmlq is used in pipelines that fetch or read HTML and then select elements with CSS selectors. It is adjacent to `jq` workflows, but chooses web-native selectors instead of JSON paths, making it useful for one-off scraping, documentation checks, and command-line extraction from generated HTML.

### 为什么软件包爱好者会关心

For package nerds, htmlq is a neat example of the Rust single-binary CLI wave: a narrowly scoped tool, easy to install through Cargo or OS package managers, with a name and interface that map an existing Unix mental model from JSON to HTML.

### 时间线

- 2021: v0.2.0 was tagged in September.
- 2021: v0.3.0 was tagged later the same month.
- 2022: v0.4.0 was tagged in January.
- Package-manager era: The README and input package facts record Cargo, FreeBSD pkg, Homebrew, Scoop, Alpine, MacPorts, Nix, and Arch availability.

### Related projects

- htmlq is conceptually related to `jq`, but targets HTML rather than JSON. Its implementation space is adjacent to scraper libraries such as BeautifulSoup and command-line HTML/XML tools such as `pup`, `xmllint`, and selector-aware web scraping utilities.

### 来源

- <https://api.github.com/repos/mgdm/htmlq/commits/1361c8c46811dd7b961c3fe9c6b04f9318a345e8>
- <https://api.github.com/repos/mgdm/htmlq/commits/5cae41f69bebd28a6ea6dea25fd8ab66f408f706>
- <https://api.github.com/repos/mgdm/htmlq/tags?per_page=20>
- <https://formulae.brew.sh/formula/htmlq>
- <https://github.com/mgdm/htmlq>
- <https://github.com/mgdm/htmlq/releases>
- <https://mgdm.net/weblog/htmlq-revisited/>


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals

## 其他软件包管理器记录

- Nix - htmlq: normalized package name match | nixpkgs package indexes: pkgs/by-name/ht/htmlq/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- apk - htmlq - 0.4.0-r1: normalized package name match | Alpine Linux edge package indexes: htmlq from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Like jq, but for HTML | https://github.com/mgdm/htmlq
- pacman - htmlq - 0.4.0-3: normalized package name match | Arch Linux sync databases: htmlq from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Like jq, but for HTML | https://github.com/mgdm/htmlq
- MacPorts - htmlq: normalized package name match | MacPorts ports tree: www/htmlq/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Scoop - main/htmlq: normalized package name match | Scoop official bucket manifest trees: bucket/htmlq.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1


## Combined YAML source

View the package source record on GitHub. [combined/htmlq.yml](https://github.com/mxcl/pkgdb/blob/main/combined/htmlq.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
