# Install htmlq with Homebrew, apk, MacPorts, Nix, pacman, scoop

Uses CSS selectors to extract bits content from HTML files. Version 0.4.0 via Homebrew; verified from local package data.

## Install

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

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install htmlq
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install htmlq
```

  Evidence: 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
```

  Evidence: 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
```

  Evidence: 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
```

  Evidence: 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
```

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

## Package facts

- **Package key:** brew:htmlq
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/htmlq>
- **Version:** 0.4.0
- **Source summary:** Uses CSS selectors to extract bits content from HTML files
- **Homepage:** <https://github.com/mgdm/htmlq>
- **Repository:** <https://github.com/mgdm/htmlq>
- **Upstream docs:** <https://github.com/mgdm/htmlq>
- **License:** MIT
- **Source archive:** <https://github.com/mgdm/htmlq/archive/refs/tags/v0.4.0.tar.gz>
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- htmlq (cli)
- htmlq (alias)

## Build dependencies

- rust

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_big_sur, arm64_linux, arm64_monterey, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, big_sur, catalina, monterey, sonoma, ventura

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 0.4.0
- Local data: ok
- Upstream repository: https://github.com/mgdm/htmlq
- Upstream latest detected: v0.4.0 (current)
- info: No package-manager update timestamp was available.
## Project history and usage

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.

### Project history

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.

### Adoption history

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.

### How it is used

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.

### Why package nerds care

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.

### Timeline

- 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.

### Sources

- <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/>


## Security Notes

narrow executable package without higher-risk signals.

- **Geiger risk:** green / low
- narrow executable package without higher-risk signals

## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** htmlq
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## Other Package-Manager Records

- 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


## Related links

- [Source-control packages](https://www.automicvault.com/pkg/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://www.automicvault.com/pkg/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [rust](https://www.automicvault.com/pkg/brew/rust/) - Build dependency declared by Homebrew.
- [comrak](https://www.automicvault.com/pkg/brew/comrak/) - Shares av.db curated category or tags: cli, developer-tools, markup, rust.
- [discount](https://www.automicvault.com/pkg/brew/discount/) - Shares av.db curated category or tags: cli, developer-tools, html, markup.
- [html-xml-utils](https://www.automicvault.com/pkg/brew/html-xml-utils/) - Shares av.db curated category or tags: cli, developer-tools, html, markup.
- [html2markdown](https://www.automicvault.com/pkg/brew/html2markdown/) - Shares av.db curated category or tags: cli, developer-tools, html, markup.
- [html2text](https://www.automicvault.com/pkg/brew/html2text/) - Shares av.db curated category or tags: cli, developer-tools, html, markup.
- [htmlcleaner](https://www.automicvault.com/pkg/brew/htmlcleaner/) - Shares av.db curated category or tags: cli, developer-tools, html, markup.
- [htmlcompressor](https://www.automicvault.com/pkg/brew/htmlcompressor/) - Shares av.db curated category or tags: cli, developer-tools, html, markup.
- [htmlcxx](https://www.automicvault.com/pkg/brew/htmlcxx/) - Shares av.db curated category or tags: cli, developer-tools, html, markup.
- [cascadia](https://www.automicvault.com/pkg/brew/cascadia/) - Both packages work with overlapping file formats or content types. Shared terms: cli, css, css-selectors, developer, developer-tools.
- [hoedown](https://www.automicvault.com/pkg/brew/hoedown/) - Both packages work with overlapping file formats or content types. Shared terms: cli, developer, developer-tools, html, markup.
- [mdq](https://www.automicvault.com/pkg/brew/mdq/) - Both packages touch the same language runtime or ecosystem. Shared terms: cli, developer, developer-tools, query, rust.

## Combined YAML source

View the package source record on GitHub. [combined/htmlq.yml](https://github.com/automic-vault/db/blob/main/combined/htmlq.yml)


## Sources

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