Agent Browser logo

Agent Browser

Fast CLI for AI-driven headless browser automation

agent-browser delivers rapid, scriptable headless Chromium automation via a Rust-based CLI with a Node.js fallback, supporting semantic locators, network routing, and full debugging tools.

Agent Browser banner

Overview

agent-browser is a command-line tool that lets AI agents and developers control a headless Chromium instance. The core is written in Rust for speed, while an npm package provides a Node.js fallback for easy installation.

Capabilities

It supports traditional CSS selectors and ARIA-based semantic locators, enabling AI-friendly element identification. The CLI covers navigation, interaction, form handling, network interception, storage manipulation, tracing, and debugging, all without leaving the terminal. Install the bundled Chromium with a single command, and run the tool cross-platform with minimal system dependencies.

Deployment

Use the npm package for quick setup (npm i -g agent-browser) or build from source with Rust for maximum performance. The tool can be scripted in CI pipelines, integrated into AI workflows, or used locally for rapid prototyping.

Highlights

Rust-based core delivers high-performance execution
Node.js fallback enables simple npm installation
Semantic locators (ARIA roles, labels) for AI-friendly selection
Built-in network routing, tracing, and storage control

Pros

  • Very fast due to compiled Rust binary
  • Cross-platform with minimal external dependencies
  • Supports both CSS selectors and AI-oriented semantic locators
  • Comprehensive CLI covering navigation, interaction, and debugging

Considerations

  • Building from source requires a Rust toolchain
  • Limited to Chromium; no multi-browser support
  • Command set is extensive and may have a learning curve
  • No graphical interface; purely command-line driven

Fit guide

Great for

  • Developers building AI agents that need web interaction
  • Test engineers preferring scriptable, headless automation
  • Researchers prototyping web-scraping or data extraction workflows
  • Teams seeking a lightweight alternative to Selenium or Playwright

Not ideal when

  • Projects requiring Firefox, Safari, or other browsers
  • Users who need a visual IDE or GUI for test authoring
  • Environments where installing Rust is prohibited
  • Heavy UI testing that relies on visual diff tools

How teams use it

AI-driven form submission

An AI agent fills and submits web forms automatically, extracting confirmation messages via the CLI.

Headless web scraping with semantic selectors

Scrape dynamic pages using ARIA role and label locators, producing structured data without brittle CSS paths.

Network request mocking in CI

Intercept and mock API calls during automated tests, ensuring deterministic outcomes in continuous integration pipelines.

Debugging page errors in a terminal

Capture console logs, JavaScript errors, and network traces directly from the CLI for rapid troubleshooting.

Tech snapshot

TypeScript57%
Rust40%
Shell2%
JavaScript2%
Batchfile1%

Frequently asked questions

Do I need to install Chromium manually?

Running `agent-browser install` downloads the bundled Chromium automatically; the `--with-deps` flag also installs required system libraries on Linux.

Can I use agent-browser on Windows?

Yes. The npm package provides pre-built binaries for Windows, macOS, and Linux.

Is a Rust toolchain required for all installations?

Only when building from source. The npm distribution includes a compiled binary, so Rust is not needed for typical usage.

How does agent-browser differ from Playwright?

agent-browser focuses on a lightweight CLI optimized for AI agents, offering semantic locators and a Rust core, whereas Playwright provides a full library API.

Can I control multiple tabs or windows?

Yes. Commands like `tab new`, `tab <n>`, and `window new` let you manage multiple tabs and windows within the same session.

Project at a glance

Active
Stars
19,644
Watchers
19,644
Forks
1,149
LicenseApache-2.0
Repo age2 months old
Last commit18 hours ago
Primary languageRust

Last synced 15 hours ago