htmlq
$ htmlq Community Low Riskhtmlq parses HTML from stdin using CSS selectors (like article p, a, or meta[name=description]) and prints matched elements, --text, or --attribute values—letting agents strip megabytes of HTML boilerplate before reading.
brew install htmlq Offline Unix pipe filter (curl ... | htmlq --text 'main') that dramatically reduces token consumption with zero network/MCP overhead.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Zero-noise pipe filter with --text, --attribute, and --remove-nodes, though it emits text/HTML fragments rather than JSON.
- Supports
--text,--attribute,--remove-nodes, and-bbase URL resolution
Strictly offline, read-only HTML parser with zero network access, zero JS execution, and zero credential access.
- Pure offline stdin-to-stdout parser with no writes or network calls
Single static Rust binary via brew, cargo, and GitHub Releases.
- Zero-dependency Rust binary
Slashes HTML payload size by 10x–50x in shell pipelines alongside curl.
- Fast CSS selector extraction (
--text,-a href)
Community Rust tool (mgdm/htmlq, MIT); feature-complete with infrequent releases.
mgdm/htmlqrepository under MIT license
Simple, single-page README and --help.
- Clear examples in
mgdm/htmlqREADME
Security, Auth & Guardrails
None required; operates purely on local stdin/files offline.
Free, MIT open-source Rust binary.
# htmlq Agent Rules - Pipe `curl` HTML through `htmlq --text` or `--remove-nodes script --remove-nodes style` before inspecting web pages. - `htmlq` is strictly static HTML parsing—it does not execute JavaScript on SPAs.
Agent-Ready Command Recipes
Safe Read-Only Queries
curl -fsS https://example.com | htmlq --text 'main, article, body'
Strips tags, scripts, and nav chrome using --text to return compact readable text.
htmlq --attribute href 'main a' < page.html
Extracts only href attribute values (-a href) from matching anchor elements.
Strengths for Agents
- + Purely offline, read-only, millisecond Rust HTML filter.
- +
--textand--attributestrip HTML noise cleanly for agent context savings.
Caveats & Pitfalls
- ! Static HTML only—cannot render client-side React/Vue SPAs.
- ! Does not emit JSON natively.