pluck is a fast Zig CLI that extracts the main readable text from a URL, local HTML file, or stdin. It uses libxml2 for broken-HTML recovery and a Readability-inspired scoring pipeline implemented in Zig.
- Zig
0.15.2 curlfor URL fetchinglibxml2headers and runtime- Optional for
--render: Node.js plusplaywright
On macOS, run:
./scripts/bootstrap-macos.shzig build
zig build testFor an optimized binary:
zig build -Doptimize=ReleaseSafe
./zig-out/bin/pluck --helppluck https://example.com/post
pluck --file testdata/sample_article.html
cat page.html | pluck --stdin
pluck --json https://example.com/post
pluck --render https://example.com/postFlags:
--json: emit structured JSON--render: enable the optional Playwright sidecar if raw extraction looks poor--timeout <ms>: network and renderer timeout budget--max-bytes <n>: cap fetched/read HTML size--user-agent <value>: override the default user agent
Default output is markdown-ish readable text. --json emits:
titlebylinesite_nameurlexcerpttext_markdowntext_plainlengthrendered
--render does not launch a browser unless the first raw extraction pass looks weak. If you want that path available:
npm install playwrightThe sidecar script lives at scripts/render_page.mjs.
There is a small benchmark helper at
scripts/benchmark.sh that compares pluck against an
optional Node baseline using Mozilla Readability.
- JS-heavy pages need
--render - The extractor aims for behaviorally similar output, not Firefox parity
- Very short pages and app-like layouts can still fail the article heuristic
The public repository is intentionally a release-only history: one snapshot
commit and one annotated vX.Y.Z tag per version. Commit messages describe
user-visible features and fixes rather than the private development process.
The public tree is complete source code and can be built normally.
Release mechanics and the private/public history boundary are documented in
RELEASING.md.
Pluck is available under the MIT License.