agent-browser README

The project's README from github.com/vercel-labs/agent-browser. As one markdown file: README.md.

agent-browser

Browser automation for AI agents: open pages, read them as an accessibility tree, and act on elements from the shell.

Vercel Labs Product npm version: agent-browser License: Apache-2.0 npm downloads per month: agent-browser skills.sh

agent-browser is a native Rust CLI that gives an AI agent a browser it can drive one command at a time. snapshot returns the page as compact text with a ref such as @e1 for each element. The agent acts on a ref, reads the page again to check the result, and repeats. The browser stays open between commands, so each step is one short shell call.

Install

npm install -g agent-browser
agent-browser install           # download Chrome for Testing (first time only)

Project installs, building from source, upgrade, and doctor are covered in Installation.

Quick start

agent-browser open example.com
agent-browser snapshot -i       # interactive elements, each with a ref
agent-browser click @e1         # act on a ref from that snapshot
agent-browser get url           # check the result
agent-browser close

The snapshot for example.com:

- link "Learn more" [ref=e1]

The full walkthrough is in the quick start.

How it works

The CLI sends each command to a background daemon that starts on the first command and controls the browser over the Chrome DevTools Protocol. Each --session gets its own daemon and browser. By default, the daemon closes a headless browser and exits after one hour without commands, saving state first when session persistence is configured.

Chrome for Testing is the default browser. You can also attach to a running Chrome with --cdp or --auto-connect (CDP mode), select the Lightpanda or Obscura engine with --engine, drive Mobile Safari in the iOS Simulator, or use a cloud browser provider such as Browserbase, Browserless, Browser Use, Kernel, or AgentCore.

See the Firefox engine guide.

For AI agents

The CLI ships skills that match its version:

agent-browser skills get core                 # the core loop, refs, waiting, and common workflows
agent-browser skills get core --ref commands  # one reference, such as the full command list
agent-browser skills get core --full          # adds the full command reference and templates
agent-browser skills list                     # specialized skills: electron, slack, dogfood, and more

Install the discovery skill into an agent harness from skills.sh:

npx skills add vercel-labs/agent-browser

The installed skill is a thin stub that tells the agent to load agent-browser skills get core, so its instructions always match the installed CLI. Or add this to your AGENTS.md:

Use `agent-browser` for browser automation. Before the first use, run
`agent-browser skills get core` and follow it.

For MCP clients, agent-browser mcp starts an MCP server over stdio. See MCP server.

Commands

Run agent-browser --help for the full list, or agent-browser <command> --help for one command.

Group Commands Docs
Navigate and read open, back, forward, reload, read, snapshot, get, is Core, Snapshots
Interact click, dblclick, fill, type, press, keyboard, hover, focus, select, check, uncheck, scroll, drag, upload, mouse, find Core, Find elements
Wait wait Wait
Capture screenshot, pdf, record, download, diff Recording, Diffing, Files
Page and network state cookies, storage, network, set, clipboard, eval, pushstate Network, Settings
Tabs, frames, and dialogs tab, frame, dialog Tabs and frames
Debug and performance console, errors, highlight, inspect, trace, profiler, vitals, react, a11y Debugging, Profiler, React
Sessions and auth session, state, auth, profiles, confirm, deny Sessions, Security
Agents and integrations skills, mcp, webmcp, flow, chat, batch, plugin Skills, WebMCP, Plugins
Observe stream, dashboard Streaming, Dashboard
Setup install, upgrade, doctor, connect, close Installation

Flags, environment variables, and agent-browser.json are documented in Configuration.

Platforms

Native binaries ship for macOS (ARM64, x64), Linux (ARM64, x64, glibc and musl), and Windows (x64). The npm package picks the right binary for the host.

Development

Building from source requires Node.js 24 or later, pnpm 11 or later, and Rust:

pnpm install
pnpm build:source               # builds the dashboard and the native CLI
pnpm link --global
agent-browser install

Run the Rust checks from cli/:

cargo fmt -- --check
cargo clippy
cargo test
cargo test e2e -- --ignored --test-threads=1   # launches real headless Chrome

AGENTS.md lists the files to update with each change, the docs checks, and the release process.

Documentation

License

Apache-2.0

agent-browser (vercel-labs/agent-browser)

Searching Database…

What is this?agent-browser is a browser automation CLI purpose-built for AI agents, shipped as a fast native Rust binary that drives Chrome for scripted or agentic web interaction.
Is this a library I import, or a standalone CLI/MCP tool?It is a standalone command-line binary (not a code library) that you invoke directly or wire up as an MCP tool for agents; it drives a managed Chrome instance via a background daemon.
How do I install and start using it?Install the native binary globally (recommended), via Homebrew on macOS, via Cargo, or build from source, then run its install command to fetch Chrome for Testing before issuing CLI commands like click, fill, or navigate.
Does it need Chrome, Node, or Rust installed first?It needs Chrome, which it can auto-download via 'agent-browser install', or it detects an existing Chrome, Brave, Playwright, or Puppeteer install; Node.js 24+/pnpm 11+ and Rust are only needed if you build from source.
Are there any gotchas with waiting or accessibility checks?The networkidle wait condition can fail to resolve on pages using SSE, WebSockets, polling, or long-polling, and accessibility audits are not available on Safari or iOS WebDriver sessions, only on CDP-based Chrome.
Does this work on macOS, Windows, and Linux the same way?Yes, it runs on macOS, Windows, and Linux, but on Linux you must install extra system libraries so Chrome can launch correctly.
What is WebMCP and why does it matter here?WebMCP is an experimental feature, enabled by default, that lets agent-browser discover and surface tools exposed by a page itself, announcing them automatically in CLI/MCP responses so an agent can call page-native actions.
Can it run accessibility checks on a page?Yes, it embeds the axe-core engine to run full accessibility audits offline, returning violations with impact, rule id, selectors, and fix guidance, or structured JSON for automation.
Does it offer anything for React apps specifically?Yes, launching with --enable react-devtools embeds the React DevTools hook so you can introspect React component state, plus framework-agnostic Web Vitals metrics work on any app.
Can I batch multiple browser actions into one call?Yes, batch execution lets you pass multiple commands as quoted arguments or piped JSON via stdin, avoiding per-command process startup overhead for multi-step workflows.
Size
41.2 MB
Stars
54.8K
Age
10mo
Commits · 90 Days