domdistill — Free Open-Source DOM-to-Action Distiller CLI for AI Agents
domdistill — Jina AI Reader for AI Agents: Distill any page's raw HTML into a compact action tree + Markdown in one command. Skip pasting 2,223 tokens of markup into the chat — get the same page as 1,080 tokens of actions and structure, offline and free, with no browser and no API key.
Install in one minute — see the install commands below. Source and README: github.com/creatorops-studio/domdistill. 100% local — no network calls at all in the free build.
Legal by design: it never fetches pages, never runs JavaScript, and never bypasses anti-bot / Cloudflare — it only distills HTML you already obtained legally.
An action tree, not a wall of markup
Links, buttons, inputs, headings, landmarks and tables — with accessible names (aria-label, labelledby, label-for, wrapping label) — as compact JSON. Scripts, styles, hidden elements and tracking pixels are pruned before the agent ever sees them. Paragraph prose goes to Markdown, not into the tree.
# 1. Distill a page into an action tree
domdistill distill page.html
# 2. Just the actions, as a list
domdistill list-actions page.html
# 3. Just the main content, as Markdown
domdistill markdown page.html
# 4. Check a page is distillable before spending tokens on it
domdistill validate page.html
# 5. Prune the tree to a token budget you set
domdistill distill page.html --format tree --budget 500
A token budget that tells the truth
--budget 500 prunes the tree to fit and reports exactly what it dropped (fields truncated, leaves dropped, subtrees dropped). If it cannot fit, the report says so — the budget is a real mechanism, not a claim.
Legal by design — no fetching, no bypass
domdistill has no network code at all: no HTTP client, no browser, no proxy, no anti-bot bypass, no CAPTCHA solving. It distills HTML you already obtained legally. It does not run JavaScript and says so plainly when a page is a JS shell.
That is a red line, not a feature: Pro will never include anti-bot bypass, stealth fingerprinting, CAPTCHA solving, or proxy rotation — in free or in Pro.
Install in one minute
Install straight from GitHub with a Rust toolchain (cargo) — the crate is not on crates.io yet:
cargo install --git https://github.com/creatorops-studio/domdistill
Prefer a ready-made binary? Download the Release v0.1.0 binary for Linux x86_64 (2,000,064 B) from github.com/creatorops-studio/domdistill/releases/tag/v0.1.0.
Measured numbers, not marketing
Measured 5 December 2026 on Linux x86_64, release build, with domdistill benchmark. Timings are 3 runs of distilling the sample page (examples/page.html); the range is shown. Tokens ≈ characters / 4 (standard approximation); the Playwright snapshot is the canonical accessibility snapshot for the same page, kept verbatim in src/bench.rs so the comparison is reproducible.
| What was measured | Result |
|---|---|
| Token cost for one page — action tree | 1,080 tokens vs 2,223 tokens (raw HTML) — 2.1× saving |
| Token cost for one page — Markdown | 631 tokens vs 2,223 tokens (raw HTML) — 3.5× saving |
| Token cost vs a Playwright accessibility snapshot | 1,080 tokens vs 1,442 tokens — 1.3× saving |
| Distill the sample page | 0.60–0.99 ms |
| Peak RSS | ~4.3 MB |
| Binary size (release, stripped) | 2,000,064 B (1.91 MiB) |
Honest note: 2.1× is below our 3× target, and 1.3× vs a Playwright snapshot is a modest win — the README says so and explains why. domdistill does not replace a browser: it is the small offline step after you already have the HTML — no Chromium to boot, no cloud call, deterministic output, and a token budget the others do not offer.
Built for AI agents first
MCP server with three tools (distill_html, list_actions, extract_markdown). Add this to your MCP config — no browser, no cloud:
{
"mcpServers": {
"domdistill": {
"command": "domdistill",
"args": ["mcp"]
}
}
}
The sample page in the repo measures 2,223 tokens of raw HTML → 1,080 tokens of action tree (2.1×, measured) and 631 tokens of Markdown (3.5×). Example agent flow: save the page's HTML legally (browser / Playwright / curl) → distill_html with a budget → work from the tree, not the raw markup. The MCP tools take the HTML as an argument; they never fetch anything themselves.
Built with: Rust, a single static binary, and an MCP server — clap + scraper + serde_json.
Free, offline, MIT
Single static binary, no cloud, no account. Free core is 80% of a real distiller; Pro (coming later, $10–29/month) adds batch distilling, JS rendering and a Cloud API. Pro will never include anti-bot bypass.
Frequently asked questions
Is domdistill really free?
Yes — MIT licensed, free core forever. Pro is a separate paid tier for batch/JS-rendering/API features.
Does it fetch pages?
No. It has no network code. Give it HTML you already have (file or stdin).
Does it work offline?
Yes. 100% local; no network calls at all in the free build.
What if the page is rendered by JavaScript?
Render it with a real browser (Playwright) first, then feed the resulting HTML to domdistill. The tool says so when it finds nothing distillable.
Does it bypass anti-bot / Cloudflare?
No — never, in free or in Pro. That is a red line.
How do I use it with Claude Code?
Add the MCP server block from the repo README to your MCP config; the agent gets distill_html, list_actions, extract_markdown.
How do I install it?
Run cargo install --git https://github.com/creatorops-studio/domdistill (needs a Rust toolchain), or download the Release v0.1.0 binary for Linux x86_64 (2,000,064 B) from the v0.1.0 release. The crate is not on crates.io yet.
Distill a page into actions in one command.
Free, offline, MIT licensed — get the source on GitHub. No browser, no fetching, no anti-bot bypass — ever.