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
- 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
Credentials
| Variable | Required | Description |
|---|---|---|
GOLOGIN_TOKEN | Yes (for open) | Gologin API token |
GOLOGIN_PROFILE_ID | Optional | Default profile ID |
GOLOGIN_DAEMON_PORT | Optional | Daemon port (default: 44777) |
GOLOGIN_CONNECT_BASE | Optional | Cloud Browser endpoint |
Get a token
- Sign up or log in at gologin.com
- Open API & MCP in the dashboard
- Open the API tab
- Click New Token
- Copy the generated access token
Config file
~/.gologin-agent-browser/config.json
Architecture
Two parts:gologin-agent-browserCLI — parses commands, auto-starts daemon, prints compact output- 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
- Unix socket at
${TMPDIR:-/tmp}/gologin-agent-browser.sock - Localhost HTTP on
127.0.0.1:${GOLOGIN_DAEMON_PORT:-44777}
How refs work
snapshot prints a compact page view and assigns refs like @e1, @e2, @e3 to interactive elements. You act on them directly:
find is usually a better fallback than stale refs.
Quick start
Agent loop example
A typical AI agent loop:Full command reference
Diagnostics
| Command | Description |
|---|---|
doctor | Check daemon health and connectivity |
Session management
| Command | Description |
|---|---|
open <url> | Open URL in a cloud browser session |
close | Close the current session |
sessions | List active sessions |
current | Show current session info |
Page reading
| Command | Description |
|---|---|
snapshot | Compact text snapshot with element refs |
screenshot <path> | Save page screenshot |
pdf <path> | Save page as PDF |
get <kind> [target] | Get page properties |
Interaction
| Command | Description |
|---|---|
click <ref> | Click an element |
dblclick <ref> | Double-click |
type <ref> <text> | Type text (appends) |
fill <ref> <text> | Fill input (replaces) |
hover <ref> | Hover over element |
select <ref> <value> | Select dropdown value |
check <ref> / uncheck <ref> | Toggle checkbox |
focus <ref> | Focus an element |
find ... | Semantic element search |
Keyboard and scroll
| Command | Description |
|---|---|
press <key> [target] | Press a keyboard key |
scroll <direction> [pixels] | Scroll the page |
scrollintoview <ref> | Scroll element into view |
Navigation
| Command | Description |
|---|---|
back | Go back |
forward | Go forward |
reload | Reload the page |
wait <target|ms> | Wait for element or timeout |
Tabs
| Command | Description |
|---|---|
tabs | List open tabs |
tabopen [url] | Open a new tab |
tabfocus <index> | Switch to a tab |
tabclose [index] | Close a tab |
Cookies and storage
| Command | Description |
|---|---|
cookies | Export cookies |
cookies-import <file> | Import cookies |
cookies-clear | Clear cookies |
storage-export [path] | Export localStorage |
storage-import <file> | Import localStorage |
storage-clear | Clear localStorage |
Advanced
| Command | Description |
|---|---|
eval <expression> | Evaluate JavaScript in page |
upload <ref> <file...> | Upload files |
Aliases
| Alias | Maps to |
|---|---|
goto, navigate | open |
tabnew | tabopen |
tabswitch | tabfocus |
js | eval |
key | press |
scrollinto | scrollintoview |
quit, exit | close |
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-countryis only available for preconfigured profiles
Related
- Gologin Web Access CLI — unified CLI (scraping + browser)
- Local Agent Browser CLI — local Orbita alternative
- Cloud Browser Getting Started — Puppeteer/Playwright examples
- AI Skills — plug-and-play skills for Claude Code
npm package
gologin-agent-browser-cli
Source code
GologinLabs/agent-browser