Moli: a Rust headless browser that skips rendering until an agent asks for pixels
Best headless browser for AI agents. Lite, Fast, High-Compatibility. Built in Rust
At a glance
- What is it?
- Moli is an Apache-2.0 headless browser from lexmount built around on-demand layout and paint. It targets AI agents and crawlers that mostly need DOM structure, and it pays for visual work only when a request needs geometry or a screenshot.
- Who is it for?
- Adopt Moli if your workload is DOM-first: extraction, crawling, retrieval, browser-use agents, or evaluation harnesses where most requests never need a rendered frame. Do not adopt it if you depend on a specific Chromium rendering quirk, on browser extensions, or on a protocol or CLI flag that its documentation does not yet list.
- Can I use it commercially?
- Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository received new commits within the last day.
- What is it written in?
- Mainly Rust, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.
Star history
- lexmount/moli23,811 ★ · +21,911
| Repository | 2026-09-11 | 2026-11-15 |
|---|---|---|
| lexmount/moli | 1.9k | 23.8k |
21,911 Stars in the last 65 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
The problem Moli targets: agents that pay for rendering they never read
Most browser automation for agents ends in text. The agent wants the page's structure, its DOM, its network activity, or the result of a script, and it rarely wants a picture. A conventional headless browser still carries a rendering pipeline that keeps a visual state alive, and that state is maintained whether or not anyone looks at it. Moli's premise, stated in its README, is that what most automation tasks need is page structure, not a continuously rendered visual world. The project treats the native DOM and style state as the single source of truth and triggers layout or software paint only for operations that genuinely require them. The intended audience is narrow and named in the README: crawling, browser-use agents, retrieval pipelines, evaluation environments, and reinforcement-learning workloads. If you are building a screenshot service or a visual regression suite, you are not the target, and the cost model works against you.
On-demand layout and paint: what actually runs per request
The mechanism is a cost model rather than a missing feature set. The README says Moli is full-featured, with real JavaScript, DOM, CSS, networking, storage, layout and screenshots; layout and pixels are generated only when needed. The README gives a per-request table. Extracting HTML or Markdown, querying the DOM, running JavaScript, and inspecting network or storage read browser runtime state directly and do not trigger layout or paint. Reading an element's box, hit-testing coordinates, or sending coordinate input runs one layout calculation and keeps only the latest frozen layout tree. A screenshot rebuilds from the current DOM and style, replaces the frozen tree, renders a fresh frame, and discards its paint state after use. Polling a screencast compares generation metadata only; clean state emits no frame, while changed state rebuilds and emits one fresh frame. That last row is the interesting design decision, because it means screencast polling is cheap when nothing changed and expensive only when something did. The trade-off is that a screenshot is always a rebuild, so repeated captures of an unchanged page do not get cheaper the way they might in a browser that caches composited output.
One binary, three automation protocols, and a CLI that dumps trees
Moli ships as a unified automation binary. The README states that the same endpoint serves CDP, WebDriver Classic, and WebDriver BiDi, and that Playwright can connect directly over CDP. The documented Playwright example uses `chromium.connectOverCDP("http://127.0.0.1:9222")`, takes the first context and page, navigates, and reads `page.locator("body").innerText()`. That is a deliberate compatibility choice: instead of writing a Playwright driver, Moli exposes the CDP endpoint Playwright already knows how to attach to. On the extraction side, the CLI documents Markdown, semantic tree text, screenshot, screenshot_full and pdf dumps, selector and page-load/response waits, and tracing options. The README also says Moli supports Linux, macOS, and Windows.
Getting it running: installer, fetch flags, and serve modes
The README offers two installation paths. The agent-oriented one is a prompt: install the skills under `https://github.com/lexmount/moli/tree/main/skills`, follow their instructions to download and install the latest prebuilt binary, then use `moli-webfetch` to fetch a URL. The direct path on Linux or macOS is `curl --proto '=https' --tlsv1.2 -fsSL https://github.com/lexmount/moli/releases/latest/download/moli-installer.sh | sh`, and on Windows it is `powershell -ExecutionPolicy ByPass -c "irm https://github.com/lexmount/moli/releases/latest/download/moli-installer.ps1 | iex"`. Both commands pipe a script from the latest release into a shell. For extraction, `moli fetch --dump markdown --wait-until done https://example.com` returns Markdown under the default completion strategy, and `moli fetch --dump semantic_tree_text --wait-selector body https://example.com` returns a compact semantic tree. Visual output requires an explicit flag: `moli fetch --layout --dump screenshot https://example.com > page.png`, with `screenshot_full` and `pdf` as the other documented dump values. For automation, `moli serve` starts a DOM-first server, `moli serve --layout` enables real geometry, coordinate input, and screenshot and screencast surfaces, and `moli serve --layout --resource` additionally fetches optional image, font, audio, video, media, and text-track resources. The README points to `fetch --help` for the full option list covering output formats, waits, profiles, proxy settings, resource policies, and tracing.
The rendering gap is the limitation, not a footnote
Moli's paint path is software paint. The README calls it software paint and describes screenshots as rebuilding from the current DOM and style and rendering a fresh frame. The on-demand model means visual state is not continuously maintained. For a pipeline that captures one screenshot per page, that is fine. For a workload that needs frame-accurate capture, smooth screencast at video rates, or visual output that matches a specific Chromium build's rasterization, it is a real risk. The second limitation is surface area. The README says the same endpoint serves three protocols, but it does not list which CDP domains are implemented. Code that reaches for an uncommon domain may find it absent. Third, the default is DOM-first: if you forget `--layout`, geometry-dependent operations are not the mode you are in. The project is also young, with v1.1.19 through v1.1.21 released between 2026-10-21 and 2026-11-03, so the API and CLI flags are still moving.
Where Moli sits next to Playwright and Puppeteer
Playwright and Puppeteer drive a full Chromium. They inherit Chromium's rendering, its extension model, and a decade of CDP surface, and they maintain a rendered visual state for the life of the page. Moli inverts the default: it keeps the DOM and style state and treats layout and paint as operations you request. That is the actual difference in approach, and it cuts both ways. If your test suite asserts against a screenshot baseline produced by Chromium, Moli is not a drop-in substitute, because the renderer is not the same. If your agent's job is to read pages, the inversion is the point: structure-first operations skip layout and paint entirely, and the README states that layout and pixels are generated only when needed. The compatibility bridge is CDP. Because Playwright can `connectOverCDP` to Moli's endpoint, a team can keep its Playwright client code and change what is listening on port 9222. That is the migration path the README implies, and it is worth testing early because it is also where protocol gaps would surface.
Maintenance, releases, and the Apache-2.0 terms
The repository is not archived and the last push was on 2026-11-02, a day before the v1.1.21 release on 2026-11-03. Three patch releases landed between 2026-10-21 and 2026-11-03, which tells you the project is being actively patched and that minor-version churn is likely. For an operator, that means the upgrade cost is not zero: CLI flags and protocol behaviour are the kind of surface that moves in patch releases this early, so pinning a version and reading release notes before bumping is the practical posture. The licence is Apache-2.0, which permits commercial use, modification, and redistribution provided you keep the licence and notices and comply with its patent and attribution terms. That is a permissive licence and a common choice for infrastructure, but it is not legal advice and the terms should be read against how you distribute the binary. Long-term support windows, a security response process, and a compatibility matrix across the three protocols are open questions you would need to answer from the repository itself.
Editorial conclusion
Adopt Moli if your workload is DOM-first: extraction, crawling, retrieval, browser-use agents, or evaluation harnesses where most requests never need a rendered frame. Do not adopt it if you depend on a specific Chromium rendering quirk, on browser extensions, or on a protocol or CLI flag that its documentation does not yet list. Before committing, verify three things against your own pages: that `moli fetch --dump markdown --wait-until done` produces the output your pipeline expects, that `moli serve --layout --resource` exposes the CDP surface your client actually calls, and that the Apache-2.0 terms and the release cadence of the v1.1.x line match how you ship.
Frequently asked questions
How do I install Moli on macOS?
Use the direct installer, which downloads the latest release script and runs it: curl --proto '=https' --tlsv1.2 -fsSL https://github.com/lexmount/moli/releases/latest/download/moli-installer.sh | sh. On Windows the documented equivalent runs in PowerShell and pipes the installer script into iex.
Do I need Chrome or a separate driver installed to use Moli?
Moli is installed as its own prebuilt binary, and the same endpoint serves CDP, WebDriver Classic and WebDriver BiDi. Playwright can connect over CDP to the server started with moli serve.
How do I take a screenshot with Moli?
Add --layout to enable on-demand layout for visual output, then choose the dump format: screenshot for a viewport PNG, screenshot_full for the full document, or pdf for a paginated document.
What does moli serve expose and on which port?
moli serve starts an automation server whose single endpoint speaks CDP, WebDriver Classic and WebDriver BiDi. The Playwright example connects to http://127.0.0.1:9222, and --layout adds geometry, coordinate input and the screenshot and screencast surfaces.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/lexmount-moli)[](https://hysenlabs.com/projects/lexmount-moli)Star history chart for your README
[](https://hysenlabs.com/projects/lexmount-moli)Was this useful?