Skip to main content
Gologin Agent Browser CLI turns Gologin Cloud Browser into a persistent, scriptable runtime for AI agents. It provides compact page snapshots, ref-based interaction, session memory, and shell-friendly output. Unlike writing Puppeteer/Playwright code from scratch, this CLI gives agents a ready-made command surface for browser automation — no boilerplate, no session management code.

Why cloud browser

Local browser automation has hard limits for agent workflows:
  • Local browsers are easier to detect
  • No profile-based fingerprinting
  • No persistent cloud browser profiles
  • No built-in proxy layer
  • Hard to standardize across agents and environments
Agent Browser CLI takes the opposite approach:
  • Cloud browser runtime instead of a local process
  • Gologin profiles as the session identity layer
  • Proxy-aware sessions
  • Anti-detect capabilities inherited from Gologin
  • A persistent daemon that keeps sessions alive across CLI calls

Install

Or run without global install:
Requires Node.js >= 18.

Credentials

Get a token

  1. Sign up or log in at gologin.com
  2. Open API & MCP in the dashboard
  3. Open the API tab
  4. Click New Token
  5. Copy the generated access token

Config file

~/.gologin-agent-browser/config.json

Architecture

Two parts:
  1. gologin-agent-browser CLI — parses commands, auto-starts daemon, prints compact output
  2. Persistent local daemon — owns live browser sessions, connects to Gologin Cloud Browser through Playwright connectOverCDP, keeps the active page in memory, builds snapshots, resolves refs, tracks session metadata
Transport is local only:
  • Unix socket at ${TMPDIR:-/tmp}/gologin-agent-browser.sock
  • Localhost HTTP on 127.0.0.1:${GOLOGIN_DAEMON_PORT:-44777}
If you do not provide a profile ID, the daemon creates a temporary Gologin cloud profile through the API.

How refs work

snapshot prints a compact page view and assigns refs like @e1, @e2, @e3 to interactive elements. You act on them directly:
Refs are best-effort and should be regenerated after navigation or major DOM changes. On dynamic pages, find is usually a better fallback than stale refs.

Quick start


Agent loop example

A typical AI agent loop:

Full command reference

Diagnostics

Session management

Page reading

Interaction

Keyboard and scroll

Tabs

Cookies and storage

Advanced

Aliases


Use cases and examples

Check if your site passes anti-detect tests

Log into a web app and extract dashboard data

Fill out a multi-step form

Take screenshots of competitor pages

Search on a site that blocks scraping

Some sites require JavaScript execution, login, or interaction before showing results. Use the browser to search:

Save and restore session state

Export cookies and storage to reuse across sessions:

Parallel sessions

Use explicit --session IDs for independent cloud tasks. Clean up with close --all or sessions --prune --older-than-ms.

Proxy rules

  • Preconfigured profiles: proxy is set on the profile via Gologin dashboard or API
  • Temporary profiles: support no proxy or custom proxy host/port
  • --proxy-country is only available for preconfigured profiles

npm package

gologin-agent-browser-cli

Source code

GologinLabs/agent-browser