尚未收集仓库信息。
尚未检测到更新。GitHub 发布版本后会显示在这里。
Best headless browser for AI agents. Lite, Fast, High-Compatibility. Built in Rust
翻译准备中
正在加载完整 README。
查看完整 README ↗Moli is a production-ready headless browser for AI agents. Its on-demand layout and rendering design combines a complete browser runtime with a lightweight resource footprint.
Moli helps your AI agent fetch and extract web pages, search the web, and automate browser tasks.
Use it through the CLI, CDP, WebDriver Classic, or WebDriver BiDi.
Moli supports Linux, macOS, and Windows.
Give this prompt to your AI agent:
Install the skills under https://github.com/lexmount/moli/tree/main/skills,
follow their instructions to download and install the latest prebuilt Moli
binary, then use moli-webfetch to fetch https://example.com and show me the
result.
On Linux or macOS:
curl --proto '=https' --tlsv1.2 -fsSL \
https://github.com/lexmount/moli/releases/latest/download/moli-installer.sh | sh
On Windows, run in PowerShell:
powershell -ExecutionPolicy ByPass -c "irm https://github.com/lexmount/moli/releases/latest/download/moli-installer.ps1 | iex"
Render the page as Markdown with Moli's default completion strategy:
moli fetch \
--dump markdown \
--wait done \
https://example.com
Or directly return a compact, model-friendly semantic tree:
moli fetch \
--dump semantic_tree_text \
--wait-selector body \
https://example.com
For visual output, enable on-demand layout and write a viewport PNG, a full-document PNG, or a paginated PDF:
moli fetch --layout --dump screenshot https://example.com > page.png
moli fetch --layout --dump screenshot_full https://example.com > full-page.png
moli fetch --layout --dump pdf https://example.com > page.pdf
To export a page after an explicit interaction, combine --eval (or
--eval-file) with --dump. The expression runs after page readiness;
promises are awaited, and any pending navigation is followed before export.
Its return value is discarded without serialization. An exception fails the
command without emitting a dump.
moli fetch --eval 'document.querySelector("button.show-details").click()' \
--dump markdown https://example.com
Only the supplied expression performs interactions. Without --dump,
--eval retains its expression-value output behavior.
Run fetch --help for the complete option list, including output formats,
page-load/response waits, profiles, proxy settings, resource policies, and
tracing options.
# Basic automation server for DOM-first workloads
moli serve
# Enable real geometry, coordinate input, and screenshot/screencast surfaces
moli serve --layout
# Also fetch optional image, font, audio, video, media, and text-track resources
moli serve --layout --resource
The same endpoint serves all three protocols: CDP, WebDriver Classic, and WebDriver BiDi. Playwright can connect directly over CDP:
import { chromium } from "playwright";
const browser = await chromium.connectOverCDP("http://127.0.0.1:9222");
const context = browser.contexts()[0];
const page = context.pages()[0] ?? await context.newPage();
await page.goto("https://example.com");
console.log(await page.locator("body").innerText());
await browser.close();
The WebMCP playground includes a CLI to list and call any site's native WebMCP tools, plus booking, restaurant, and pizza demos.
Three qualities matter most for agent workloads, and Moli brings them together:
What most browser automation tasks actually need is page structure, not a continuously rendered visual world. Moli treats the native DOM and style state as the single source of truth, triggering layout or software paint only for operations that genuinely require them.
| Agent request | What Moli does |
|---|---|
| Extract HTML/Markdown, query the DOM, run JS, inspect network/storage | Reads browser runtime state directly — does not trigger layout or paint |
| Read an element's box, hit-test coordinates, send coordinate input | Runs one layout calculation and retains only the latest frozen layout tree |
| Capture a screenshot | Rebuilds from the current DOM/style, replaces the frozen tree, renders a fresh frame, and discards its paint state after use |
| Poll a screencast | Compares generation metadata only; clean state emits no frame, while changed state rebuilds and emits one fresh frame |
Moli still includes the complete set of capabilities: V8, CSS, layout, text shaping, hit-testing, software paint, and more. The only difference is when visual work runs and how long its results are retained. This cost model is especially well suited to crawling, browser-use agents, retrieval pipelines, evaluation environments, and reinforcement-learning workloads.
以上为 README 的开头部分。其余内容请阅读原文。 查看完整 README ↗