nicobailon/surf-cli

The CLI for AI agents to control Chrome. Zero config, agent-agnostic, battle-tested.

What it solves

Surf provides a simple, agent-agnostic CLI for AI agents to control a Chrome browser. It eliminates the need for complex setups, proprietary API keys, or specific AI provider lock-in, allowing agents to interact with the web as a human would—using existing browser logins and sessions.

How it works

Surf operates as a CLI tool that communicates with a Chrome extension via a Unix socket. It uses a native messaging host to bridge the CLI and the browser. This architecture allows it to be used by any tool that can execute shell commands (such as Claude Code, GPT, or custom shell scripts).

Key technical features include:

  • Accessibility Tree Integration: Uses stable element references (e1, e2, etc.) from the accessibility tree, making interactions more resilient to DOM changes than traditional CSS selectors.
  • Session Management: Implements a session system to allow multiple independent agents to operate concurrent browser tabs without interfering with each other.
  • Remote Access: Supports remote browser control over Tailscale, using mutual Ed25519 challenge-response for secure authentication.
  • Smart Defaults: Automatically resizes screenshots to save tokens and captures screenshots after actions to reduce round-trips for the agent.

Who it’s for

Developers building AI agents that need to browse the web, perform research, or interact with web applications without the overhead of managing headless browser clusters or complex API integrations.

Highlights

  • Agent-Agnostic: Works with any LLM or agent framework that can run CLI commands.
  • Zero Config: Quick installation via npm and a Chrome extension.
  • Semantic Locators: Find and interact with elements by ARIA role, text, or label.
  • Harnesses Browser Cookies: Query AI services like ChatGPT, Gemini, and Perplexity using existing browser logins instead of API keys.
  • Iframe Support: Ability to switch between frames to interact with nested content.
  • Network Capture: Automatically logs network requests for filtering and replaying API calls.

Related

  • Project
  • Project
  • Project
  • Project
  • Project