/agents-cli:browser [profiles|start|refs|click|type|screenshot|done]from agents-cli
Drives a real browser via CDP for navigation, clicking, typing, and screenshots. Profiles persist login state across sessions so agents authenticate once and stay logged in.
Ships in agents-cli. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Control a real browser via CDP. Profiles persist login state, so agents log in once and stay authenticated. Screenshots auto-resize to save tokens.
browser is the standalone @phnx-labs/browser-cli (agents setup browser installs it). agents browser was removed; call browser directly.
Every action command targets a task. Bind the task once per shell, then drop the flag:
export AGENTS_BROWSER_TASK=$(browser start --profile work)
browser refs
browser click 42
browser screenshot
start writes the resolved task name (e.g. swift-crab-falcon-a3f92b1c) to stdout; human commentary goes to stderr — $(...) capture stays clean.
For per-call overrides, pass --task <name>. Env vars are per-process, so parallel agents in different shells never collide.
Use your real browser. Same fingerprint, same IP, nothing to detect:
browser profiles create work --browser chrome
export AGENTS_BROWSER_TASK=$(browser start --profile work --url https://linkedin.com)
browser refs
browser click 5
Log in once to a profile — the session persists. Every future task is already authenticated:
browser profiles create social --browser chrome
export AGENTS_BROWSER_TASK=$(browser start --profile social)
# Log in manually or via automation
browser done
# Next time — already logged in
export AGENTS_BROWSER_TASK=$(browser start --profile social --url https://twitter.com)
Profiles are identities. Create one per account group:
browser profiles create social --browser chrome # Twitter, LinkedIn
browser profiles create email --browser chrome # Gmail, work email
browser profiles create finance --browser chrome # Banking, trading
An agent using social can't see your finance cookies.
Each agent gets its own task. Tasks share the window but own separate tabs:
# Agent 1 — research
export AGENTS_BROWSER_TASK=$(browser start --profile work --url https://arxiv.org)
browser tabs
# Agent 2 (different shell) — monitoring
export AGENTS_BROWSER_TASK=$(browser start --profile work --url https://dashboards.example.com)
browser tabs # only sees its own tabs
# Completing one doesn't affect the other
browser done # closes only this agent's tabs
Cookie persistence comes first. A profile keeps its login cookies across sessions, so the goal is: log in once (by hand or agent-driven), and the profile stays authenticated — no credential handling on the hot path. Check state before assuming a re-login is needed:
browser profiles logins # per profile: SERVICE | ACCOUNT | CREDS
ACCOUNT is the signed-in identity (from saved logins, read plaintext — no decryption);
CREDS shows whether the profile's secrets bundle holds login creds for that service.
When a session lapses, drive the login with the credential resolved inside the
browser layer so the plaintext never crosses stdout or your transcript. Store creds in
the profile's bundle under the <SERVICE>_USERNAME / <SERVICE>_PASSWORD convention:
browser profiles create acme --browser comet --secrets acme-login
secrets add acme-login GITHUB_USERNAME
secrets add acme-login GITHUB_PASSWORD
# Log in — the agent drives the form and handles 2FA/selectors adaptively:
export AGENTS_BROWSER_TASK=$(browser start --profile acme --url https://github.com/login)
browser refs # find the field refs
browser type <user-ref> --secret acme-login/GITHUB_USERNAME # value never printed
browser type <pass-ref> --secret acme-login/GITHUB_PASSWORD
browser click <submit-ref>
browser screenshot # inspect: 2FA? captcha? done?
If a 2FA/OTP or "unusual activity" checkpoint appears, the agent screenshots it and asks
the human (or reads the OTP from a connected mailbox) — the CLI never auto-solves it.
For a script that genuinely needs the raw value, run it under
secrets exec <bundle> -- <command> so the value reaches only that process (the old
secrets get <bundle> <KEY> form is removed). Prefer type --secret so nothing lands
in the transcript.
Note: --secrets also injects the bundle as env vars into the browser process at
launch (useful for extensions/CDP tooling that read env) — that is separate from web
login, which needs the form-fill flow above.
Connect to BrowserBase, Steel, or any CDP service:
browser profiles create cloud --browser chrome \
--endpoint "wss://connect.browserbase.com?apiKey=..."
Three flags work together for Electron desktop apps:
browser profiles create canva --browser custom \
--binary "/Applications/Canva.app/Contents/MacOS/Canva" \
--electron \
--target-filter "url:https://www.canva.com/"
--browser custom plus --binary tells the launcher how to start the app with --remote-debugging-port.--electron switches the runtime into single-window mode: tabs are never created with Target.createTarget (most production Electron apps reject it); navigation reuses the existing window.--target-filter picks the visible WebContents. Electron apps frequently expose several type: page CDP targets — background services, OAuth windows, and file:// shells — and the first one CDP returns is almost never the UI. Use url:<substring> or title:<substring>.Without --target-filter, a skip-invisible heuristic excludes about:blank, file://, and URLs matching _desktop-background-service / _internal / _background. That covers most apps; use the filter for the ones it doesn't.
Show a local HTML artifact by navigating a persistent browser task at it, not by
shelling open <file>. A raw open spawns a brand-new tab every call with no handle —
re-showing an updated doc leaves a pile of duplicate tabs the user has to close. A
browser task holds one tab and refreshes it in place, and navigate returns a
stable tab id you can re-target:
# The user picks their default once; agents do not pass --profile.
browser use work
# bind a task on the user's default browser profile
export AGENTS_BROWSER_TASK=$(browser start)
# show the doc — reuses the SAME tab every time (refresh in place), one tab total
browser navigate --url "file:///abs/path/to/review.html"
# ... regenerate the doc, then re-show it — no second tab:
browser navigate --url "file:///abs/path/to/review.html"
On a remote interactive host, run the same commands over agents ssh <host> (copy the
file there first) so the user's own browser shows it:
scp review.html <host>:/tmp/review.html
agents ssh <host> "browser navigate --url file:///tmp/review.html"
Fall back to a single open (agents ssh <host> 'open <file>') only when the host
has no drivable browser profile (browser profiles list is empty and
browser start can't auto-pick one) — a one-shot open beats no display, but it is the
tab-spam path, so prefer navigate whenever a profile exists.
browser drives over the Chrome DevTools Protocol, so it supports the Chromium family
only: Chrome, Comet, Chromium, Brave, Edge. Safari and Firefox are not supported.
Arc is a special case — installable but NOT drivable. Arc answers
Browser.getVersion (so a connection appears to succeed) but exposes zero CDP page
targets via every discovery method, and it crashes the moment a new tab is requested
(Target.createTarget). browser therefore refuses to drive an Arc profile with a clear
error instead of crashing the user's Arc window — browser profiles seed still
creates an arc-local profile for completeness, but pick a drivable browser to actually
automate:
browser profiles create work --browser comet # or chrome / chromium / brave
export AGENTS_BROWSER_TASK=$(browser start --url https://example.com)
browser refs # Get clickable elements
browser click 3 # Click element ref 3
browser type 5 --text "search query" # Type into element ref 5
browser press Enter # Press Enter key
browser screenshot # Take screenshot (auto-saved)
browser done # Close task's tabs
browser tab add --url https://github.com # Open new tab (becomes current)
browser tab focus github # Switch by URL substring
browser tabs # List all tabs
browser tab close # Close all tabs
browser status # Show all profiles and tasks
browser tasks # List just tasks
All action commands read the task from $AGENTS_BROWSER_TASK unless --task <name> is passed.
| Task | Command |
|---|---|
| Create profile | browser profiles create <name> --browser chrome |
| Start task | browser start --profile <name> [--url <url>] |
| Navigate | browser navigate --url <url> |
| Get elements | browser refs |
| Click | browser click <ref> |
| Type | browser type <ref> --text "text" |
| Press key | browser press Enter |
| Hover | browser hover <ref> |
| Scroll | browser scroll --dx 0 --dy 1000 (negatives scroll up/left) |
| Screenshot | browser screenshot |
| Evaluate JS | browser evaluate --expression "document.title" (or --file ./script.js) |
| New tab | browser tab add --url <url> |
| Switch tab | browser tab focus <hint> |
| Complete task | browser done |
| Status | browser status |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub phnx-labs/agi-cli --plugin agents-cli8 skills in this plugin
/agents-cliRun and manage many AI coding agents (Claude Code, Codex, Cursor, Gemini/Antigravity, Grok, Kimi, OpenCode, Droid, …) from one CLI — the `agents` command. Use this to run multiple coding agents in parallel, manage multiple Claude Code accounts, keep working when I hit my usage limit, resume a session on another machine, or pin the agent CLI version. Triggers on: run multiple coding agents in parallel, manage multiple Claude Code accounts, I hit my usage limit, resume a session on another machine, pin the agent CLI version./devicesRegister and connect to your machines over Tailscale SSH with agents-cli. Use this skill to sync devices from the tailnet, list them, open a shell on another machine, or see agent sessions running across your whole fleet./runOther plugins' skills for the same job