captivus/chrome-agent

CLI that gives AI coding agents direct access to Chrome via the DevTools Protocol. Many agents and humans can share one browser, each with isolated event subscriptions.

What it solves

AI coding agents need to see and interact with browsers to test code, debug automation, and inspect page state. The usual approach uses browser MCP tools with a persistent server and protocol negotiation, which adds overhead. chrome-agent gives agents direct access to Chrome's DevTools Protocol (CDP) with no abstraction layer, so every command, event, and domain Chrome exposes is available—not a curated subset. Multiple agents and humans can share the same browser simultaneously, each with isolated event subscriptions, so one agent can drive while another observes network traffic without interference.

How it works

chrome-agent is a command-line tool that launches and manages Chrome instances with CDP enabled. It uses two channels:

  • One-shot mode: sends a single CDP command (like Page.navigate or Runtime.evaluate) and prints the JSON response. Good for spot checks, screenshots, and quick queries (~50–80 ms per call).
  • Attach mode: opens a persistent connection to stream events (like Page.loadEventFired or Network.requestWillBeSent) to stdout as JSON lines. Subscriptions are isolated per session.

The CLI passes method names and parameters straight to the browser, so it tracks whatever version of Chrome is running—not its own release. The help command reads the live protocol schema from the browser, so documentation stays current. A registry tracks running instances, and a pattern (glob) system lets you target one or many at once. For agents, browsers launch on a virtual display (so they don't steal your screen) and auto-clean up when the agent session ends.

Who it's for

Developers building or using AI coding agents that need browser automation—Claude Code, Codex, or custom harnesses. It's also useful for test coordinators, browser automation engineers, and anyone who wants direct, low-overhead CDP access without a heavy browser automation framework. The README mentions adoption at companies like Microsoft, Bosch, Red Hat, and Databricks.

Highlights

  • Full CDP protocol access with zero abstraction—every command, event, and domain Chrome supports just works.
  • Tracks the running browser's version, so new CDP features appear without upgrading chrome-agent.
  • Multi-agent concurrency: shared browser with isolated event subscriptions—no interference between participants.
  • Agent-aware launching: browsers go to a virtual display and are tied to the agent's session, auto-stopping if the agent exits.
  • Session save/restore: snapshot a running browser (profile, tabs, cookies, observers) and bring it back later, even after a reboot.
  • Tab completion (zsh) that reads live instance names and CDP method/event names from the running browser.
  • Lightweight: only depends on websockets, cryptography, and keyring—no Playwright or browser downloads.

Related

  • Project
  • Project
  • Project
  • Project