skulldc

agent-browser is a Rust CLI that lets AI agents drive a browser from the shell

The Apache-2.0 agent-browser CLI from vercel-labs turns web pages into compact accessibility-tree snapshots with element refs, so an agent can act on a page one short shell call at a time.

What it is

agent-browser is a native Rust CLI, published by vercel-labs under the Apache-2.0 license, that gives an AI agent a browser it can drive one command at a time. The README describes the loop: 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.

The repository was created on 2026-01-11. In the GitHub trending snapshot it had 48058 stars, 815 of them gained in the last day, and 3281 forks; those figures are a point-in-time snapshot.

Install and first steps

The README gives the npm route, with a one-time download of Chrome for Testing:

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

Homebrew users run brew install agent-browser and then agent-browser install; on Linux, agent-browser install --with-deps also installs the browser’s system libraries. The quick start then looks like this:

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

Refs describe the page at the time of the snapshot, so after navigation or a DOM change the agent has to take a new snapshot before using refs again. CSS selectors, text, XPath and semantic locators also work. The README makes a point about failure reporting: a click fails, instead of reporting success, when the target is hidden, disabled, outside the viewport, or covered by another element such as a consent banner.

How it works

Each command goes 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.

Chrome for Testing is the default browser, but the CLI can also attach to a running Chrome with --cdp or --auto-connect, switch to the Lightpanda or Obscura engine with --engine, drive Mobile Safari in the iOS Simulator, or use cloud browser providers such as Browserbase, Browserless, Browser Use, Kernel or AgentCore.

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

Agent integration

The CLI ships skills that match its installed version, read with agent-browser skills get core. The README says the installable discovery skill is a thin stub that tells the agent to load that command, so its instructions always match the installed CLI. For MCP clients, agent-browser mcp starts an MCP server over stdio.

The command set is broad: navigation and reading, interaction, waiting, screenshots and PDF capture, cookies, storage and network state, tabs and frames, debugging and profiling, and session and auth handling. The documentation lists an auth vault, domain allowlists, action policies and content boundaries under its security section.

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


Source: vercel-labs/agent-browser on GitHub