rebrand: agent-browser-stealth → chrome-use, de-fork, reset to v1.0.0
Release binaries / Build macOS ARM64 (push) Has been cancelled
Release binaries / Build macOS x64 (push) Has been cancelled
Release binaries / Build Linux ARM64 (push) Has been cancelled
Release binaries / Build Linux musl ARM64 (push) Has been cancelled
Release binaries / Build Linux musl x64 (push) Has been cancelled
Release binaries / Build Linux x64 (push) Has been cancelled
Release binaries / Build Windows x64 (push) Has been cancelled
Release binaries / Attach binaries to GitHub Release (push) Has been cancelled

Standalone product rename across the whole repo (issue: project identity):

- Binary/package/repo/skill/docs: agent-browser[-stealth] → chrome-use
  (single binary name `chrome-use`; old aliases agent-browser/abs dropped).
- Version: 0.27.0-fork.51 → 1.0.0 (drop the upstream-fork counter).
- Native-messaging host: com.agent_browser.connect → com.leeguoo.chrome_use
  (CLI + ab-connect extension in lockstep — this is a breaking handshake change,
  extension bumped 0.4.2 → 0.5.0, needs a Web Store republish).
- Config dir: ~/.agent-browser → ~/.chrome-use.
- README/zh: reframed from "stealth fork of agent-browser" to a standalone
  product with a small `originally based on vercel-labs/agent-browser` credit.
- Kept AGENT_BROWSER_* env vars working (63 vars across the codebase; renaming
  them would break every existing script/skill for no user-facing gain).

Build green, 802 unit tests pass, fmt + clippy clean. Upstream attribution to
vercel-labs/agent-browser preserved.
This commit is contained in:
leeguooooo
2026-06-12 12:56:21 +09:00
parent b4c1707a01
commit 61060486f4
89 changed files with 1897 additions and 1926 deletions
+24 -24
View File
@@ -1,12 +1,12 @@
---
name: agentcore
description: Run agent-browser on AWS Bedrock AgentCore cloud browsers. Use when the user wants to use AgentCore, run browser automation on AWS, use a cloud browser with AWS credentials, or needs a managed browser session backed by AWS infrastructure. Triggers include "use agentcore", "run on AWS", "cloud browser with AWS", "bedrock browser", "agentcore session", or any task requiring AWS-hosted browser automation.
allowed-tools: Bash(agent-browser:*), Bash(agent-browser-stealth:*), Bash(abs:*), Bash(npx agent-browser:*), Bash(npx agent-browser-stealth:*)
description: Run chrome-use on AWS Bedrock AgentCore cloud browsers. Use when the user wants to use AgentCore, run browser automation on AWS, use a cloud browser with AWS credentials, or needs a managed browser session backed by AWS infrastructure. Triggers include "use agentcore", "run on AWS", "cloud browser with AWS", "bedrock browser", "agentcore session", or any task requiring AWS-hosted browser automation.
allowed-tools: Bash(chrome-use:*), Bash(chrome-use:*), Bash(abs:*), Bash(npx chrome-use:*), Bash(npx chrome-use:*)
---
# AWS Bedrock AgentCore
Run agent-browser on cloud browser sessions hosted by AWS Bedrock AgentCore. All standard agent-browser commands work identically; the only difference is where the browser runs.
Run chrome-use on cloud browser sessions hosted by AWS Bedrock AgentCore. All standard chrome-use commands work identically; the only difference is where the browser runs.
## Setup
@@ -21,13 +21,13 @@ No additional setup is needed if the user already has working AWS credentials.
```bash
# Open a page on an AgentCore cloud browser
agent-browser -p agentcore open https://example.com
chrome-use -p agentcore open https://example.com
# Everything else is the same as local Chrome
agent-browser snapshot -i
agent-browser click @e1
agent-browser screenshot page.png
agent-browser close
chrome-use snapshot -i
chrome-use click @e1
chrome-use screenshot page.png
chrome-use close
```
## Environment Variables
@@ -46,15 +46,15 @@ Use `AGENTCORE_PROFILE_ID` to persist browser state across sessions. This is use
```bash
# First run: log in
AGENTCORE_PROFILE_ID=my-app agent-browser -p agentcore open https://app.example.com/login
agent-browser snapshot -i
agent-browser fill @e1 "user@example.com"
agent-browser fill @e2 "password"
agent-browser click @e3
agent-browser close
AGENTCORE_PROFILE_ID=my-app chrome-use -p agentcore open https://app.example.com/login
chrome-use snapshot -i
chrome-use fill @e1 "user@example.com"
chrome-use fill @e2 "password"
chrome-use click @e3
chrome-use close
# Future runs: already authenticated
AGENTCORE_PROFILE_ID=my-app agent-browser -p agentcore open https://app.example.com/dashboard
AGENTCORE_PROFILE_ID=my-app chrome-use -p agentcore open https://app.example.com/dashboard
```
## Live View
@@ -70,10 +70,10 @@ Live View: https://us-east-1.console.aws.amazon.com/bedrock-agentcore/browser/aw
```bash
# Default: us-east-1
agent-browser -p agentcore open https://example.com
chrome-use -p agentcore open https://example.com
# Explicit region
AGENTCORE_REGION=eu-west-1 agent-browser -p agentcore open https://example.com
AGENTCORE_REGION=eu-west-1 chrome-use -p agentcore open https://example.com
```
## Credential Patterns
@@ -82,14 +82,14 @@ AGENTCORE_REGION=eu-west-1 agent-browser -p agentcore open https://example.com
# Explicit credentials (CI/CD, scripts)
export AWS_ACCESS_KEY_ID=AKIA...
export AWS_SECRET_ACCESS_KEY=...
agent-browser -p agentcore open https://example.com
chrome-use -p agentcore open https://example.com
# SSO (interactive)
aws sso login --profile my-profile
AWS_PROFILE=my-profile agent-browser -p agentcore open https://example.com
AWS_PROFILE=my-profile chrome-use -p agentcore open https://example.com
# IAM role / default credential chain
agent-browser -p agentcore open https://example.com
chrome-use -p agentcore open https://example.com
```
## Using with AGENT_BROWSER_PROVIDER
@@ -100,10 +100,10 @@ Set the provider via environment variable to avoid passing `-p agentcore` on eve
export AGENT_BROWSER_PROVIDER=agentcore
export AGENTCORE_REGION=us-east-2
agent-browser open https://example.com
agent-browser snapshot -i
agent-browser click @e1
agent-browser close
chrome-use open https://example.com
chrome-use snapshot -i
chrome-use click @e1
chrome-use close
```
## Common Issues
+179 -179
View File
@@ -1,10 +1,10 @@
---
name: core
description: Core agent-browser usage guide. Read this before running any agent-browser commands. Covers the snapshot-and-ref workflow, navigating pages, interacting with elements (click, fill, type, select), extracting text and data, taking screenshots, managing tabs, handling forms and auth, waiting for content, running multiple browser sessions in parallel, and troubleshooting common failures. Use when the user asks to interact with a website, fill a form, click something, extract data, take a screenshot, log into a site, test a web app, or automate any browser task.
allowed-tools: Bash(agent-browser:*), Bash(agent-browser-stealth:*), Bash(abs:*), Bash(npx agent-browser:*), Bash(npx agent-browser-stealth:*)
description: Core chrome-use usage guide. Read this before running any chrome-use commands. Covers the snapshot-and-ref workflow, navigating pages, interacting with elements (click, fill, type, select), extracting text and data, taking screenshots, managing tabs, handling forms and auth, waiting for content, running multiple browser sessions in parallel, and troubleshooting common failures. Use when the user asks to interact with a website, fill a form, click something, extract data, take a screenshot, log into a site, test a web app, or automate any browser task.
allowed-tools: Bash(chrome-use:*), Bash(chrome-use:*), Bash(abs:*), Bash(npx chrome-use:*), Bash(npx chrome-use:*)
---
# agent-browser core
# chrome-use core
Fast browser automation CLI for AI agents. Chrome/Chromium via CDP, no
Playwright or Puppeteer dependency. Accessibility-tree snapshots with compact
@@ -18,17 +18,17 @@ web pages — see [When to load another skill](#when-to-load-another-skill).
> **Hit a rough edge? Please report it.** If a command surprised you — a
> confusing error, a stale `@ref`, an occluded click, a flaky wait, a missing
> feature, or anything that cost you extra turns — open a quick issue at
> **<https://github.com/leeguooooo/agent-browser-stealth/issues>** with the exact
> **<https://github.com/leeguooooo/chrome-use/issues>** with the exact
> command and what happened vs. what you expected. Agent-filed friction reports
> are how this tool gets sharper; a 30-second issue is genuinely valuable.
## The core loop
```bash
agent-browser open <url> # 1. Open a page
agent-browser snapshot -i # 2. See what's on it (interactive elements only)
agent-browser click @e3 # 3. Act on refs from the snapshot
agent-browser snapshot -i # 4. Re-snapshot after any page change
chrome-use open <url> # 1. Open a page
chrome-use snapshot -i # 2. See what's on it (interactive elements only)
chrome-use click @e3 # 3. Act on refs from the snapshot
chrome-use snapshot -i # 4. Re-snapshot after any page change
```
Refs (`@e1`, `@e2`, ...) are assigned fresh on every snapshot. They become
@@ -38,15 +38,15 @@ next ref interaction.
## Before you automate: pick the cheapest tool
Driving a browser is the heavy option. agent-browser earns its keep when you
Driving a browser is the heavy option. chrome-use earns its keep when you
need a **real, logged-in browser** — not for reading text off a public page.
| You need | Use |
|---|---|
| Discover what exists / find sources | `WebSearch` |
| Specific facts from a static or public page | `WebFetch` or `curl` (no browser) |
| Login state, interaction, JS-rendered or anti-bot pages | **agent-browser** (this skill) |
| A page the user saved before / an internal system | `agent-browser find-url <keywords>` (their bookmarks), then open it |
| Login state, interaction, JS-rendered or anti-bot pages | **chrome-use** (this skill) |
| A page the user saved before / an internal system | `chrome-use find-url <keywords>` (their bookmarks), then open it |
| The user's **own already-open, logged-in** Chrome window | the **extension connect** flow (below) |
Don't hand-build deep URLs with query params — links discovered by *interacting*
@@ -58,24 +58,24 @@ hand-constructed URL often doesn't.
When the task needs the user's *live* logged-in window (their real session, the
window they're looking at — not a fresh browser), use the extension connect flow.
One-time setup:
1. `agent-browser extension install` — registers the native-messaging host.
2. Install the **agent-browser-stealth** extension. Easiest (and restart-stable):
1. `chrome-use extension install` — registers the native-messaging host.
2. Install the **chrome-use** extension. Easiest (and restart-stable):
the **Chrome Web Store**, one-click *Add to Chrome*:
<https://chromewebstore.google.com/detail/agent-browser-stealth/knfcmbamhjmaonkfnjhldjedeobeafmk>
<https://chromewebstore.google.com/detail/chrome-use/knfcmbamhjmaonkfnjhldjedeobeafmk>
(Dev fallback: `chrome://extensions` → Developer mode → *Load unpacked* →
`extensions/ab-connect`. Load-unpacked can be disabled on Chrome restart, so
prefer the Store build for unattended setups.)
Once installed, plain `agent-browser open <url>` auto-connects through the
Once installed, plain `chrome-use open <url>` auto-connects through the
extension relay — `auto_connect_cdp` **prefers the live relay over a raw
`--remote-debugging-port`**, so Chrome 136+'s "Allow remote debugging?" consent
popup never fires. `agent-browser extension connect` is the explicit form of the
popup never fires. `chrome-use extension connect` is the explicit form of the
same path. Zero-confirmation, zero-token. Use `--launch` instead when a fresh,
isolated browser is fine.
`--launch` opens an **isolated, empty test profile** — no cookies, no login, no
extensions (so the extension-relay path is off). Its window is labelled
`agent-browser (<session>)` in Chrome's profile menu so a human watching the
`chrome-use (<session>)` in Chrome's profile menu so a human watching the
desktop knows which session owns it. If a launched session needs more:
- **Real cookies / login / extensions** → drop `--launch`, use `--profile auto`
@@ -88,17 +88,17 @@ desktop knows which session owns it. If a launched session needs more:
attempt re-pops it). One of two things is true:
1. **You're on a stale build.** The relay-preference that avoids this dialog
landed in **fork.30**. Run `agent-browser --version`: if it's below
landed in **fork.30**. Run `chrome-use --version`: if it's below
`0.27.0-fork.30`, upgrade and retry:
```bash
curl -fsSL https://raw.githubusercontent.com/leeguooooo/agent-browser-stealth/main/install.sh | sh
curl -fsSL https://raw.githubusercontent.com/leeguooooo/chrome-use/main/install.sh | sh
```
If `which -a agent-browser` shows more than one install, an old **npm/pnpm**
If `which -a chrome-use` shows more than one install, an old **npm/pnpm**
copy (the npm registry lags behind — Releases are the source of truth) may be
shadowing the upgraded one; remove the stale copy
(`npm rm -g agent-browser-stealth` / `pnpm rm -g agent-browser-stealth`) so the
(`npm rm -g chrome-use` / `pnpm rm -g chrome-use`) so the
`install.sh` build wins. A tool that bundles its *own* pinned copy
(e.g. `node .../agent-browser-stealth@0.24.x/.../agent-browser`) needs that
(e.g. `node .../chrome-use@0.24.x/.../chrome-use`) needs that
copy upgraded too.
2. **The extension/relay isn't live.** Tell the user to install the Store
extension (one click, above); after that the relay stays up and the dialog
@@ -135,7 +135,7 @@ You have a **real Chrome with the user's DOM**. Two layers, mix them freely:
readable; best for straightforward forms and navigation. But the a11y view is
*lossy and fragile*: refs go stale on any change, hidden inputs never show up,
overlays can block coordinate clicks.
2. **eval-first** (`agent-browser eval "<js>"`) — your eyes and hands on the real
2. **eval-first** (`chrome-use eval "<js>"`) — your eyes and hands on the real
DOM: read hidden inputs, reach into Shadow DOM / iframes, inspect
`form.elements` and `.validity`, extract the exact shape you want, or call
`el.click()` directly. **The moment the structured path fights you, drop to
@@ -144,47 +144,47 @@ You have a **real Chrome with the user's DOM**. Two layers, mix them freely:
```bash
# "what's actually in this form / why won't it submit?"
agent-browser eval "[...document.forms[0].elements].map(e=>[e.name,e.type,e.value,e.checked])"
agent-browser eval "document.querySelector('[name=point_choice]')?.value"
agent-browser eval "[...document.forms[0].elements].filter(e=>!e.validity.valid).map(e=>e.name+': '+e.validationMessage)"
agent-browser eval "document.querySelector('#stubborn').click()" # direct DOM click, bypasses overlays
chrome-use eval "[...document.forms[0].elements].map(e=>[e.name,e.type,e.value,e.checked])"
chrome-use eval "document.querySelector('[name=point_choice]')?.value"
chrome-use eval "[...document.forms[0].elements].filter(e=>!e.validity.valid).map(e=>e.name+': '+e.validationMessage)"
chrome-use eval "document.querySelector('#stubborn').click()" # direct DOM click, bypasses overlays
```
## Quickstart
```bash
# Install once
npm i -g agent-browser && agent-browser install
npm i -g chrome-use && chrome-use install
# Take a screenshot of a page
agent-browser open https://example.com
agent-browser screenshot home.png
agent-browser close
chrome-use open https://example.com
chrome-use screenshot home.png
chrome-use close
# Search, click a result, and capture it
agent-browser open https://duckduckgo.com
agent-browser snapshot -i # find the search box ref
agent-browser fill @e1 "agent-browser cli"
agent-browser press Enter
agent-browser wait --load networkidle
agent-browser snapshot -i # refs now reflect results
agent-browser click @e5 # click a result
agent-browser screenshot result.png
chrome-use open https://duckduckgo.com
chrome-use snapshot -i # find the search box ref
chrome-use fill @e1 "chrome-use cli"
chrome-use press Enter
chrome-use wait --load networkidle
chrome-use snapshot -i # refs now reflect results
chrome-use click @e5 # click a result
chrome-use screenshot result.png
```
The browser stays running across commands so these feel like a single
session. Use `agent-browser close` (or `close --all`) when you're done.
session. Use `chrome-use close` (or `close --all`) when you're done.
## Reading a page
```bash
agent-browser snapshot # full tree (verbose)
agent-browser snapshot -i # interactive elements only (preferred)
agent-browser snapshot -i -u # include href urls on links
agent-browser snapshot -i -c # compact (no empty structural nodes)
agent-browser snapshot -i -d 3 # cap depth at 3 levels
agent-browser snapshot -s "#main" # scope to a CSS selector
agent-browser snapshot -i --json # machine-readable output
chrome-use snapshot # full tree (verbose)
chrome-use snapshot -i # interactive elements only (preferred)
chrome-use snapshot -i -u # include href urls on links
chrome-use snapshot -i -c # compact (no empty structural nodes)
chrome-use snapshot -i -d 3 # cap depth at 3 levels
chrome-use snapshot -s "#main" # scope to a CSS selector
chrome-use snapshot -i --json # machine-readable output
```
Snapshot output looks like:
@@ -207,32 +207,32 @@ assigned fresh on every snapshot.
For unstructured reading (no refs needed):
```bash
agent-browser get text @e1 # visible text of an element
agent-browser get html @e1 # innerHTML
agent-browser get attr @e1 href # any attribute
agent-browser get value @e1 # input value
agent-browser get title # page title
agent-browser get url # current URL
agent-browser get count ".item" # count matching elements
chrome-use get text @e1 # visible text of an element
chrome-use get html @e1 # innerHTML
chrome-use get attr @e1 href # any attribute
chrome-use get value @e1 # input value
chrome-use get title # page title
chrome-use get url # current URL
chrome-use get count ".item" # count matching elements
```
## Interacting
```bash
agent-browser click @e1 # click
agent-browser click @e1 --new-tab # open link in new tab instead of navigating
agent-browser dblclick @e1 # double-click
agent-browser hover @e1 # hover
agent-browser focus @e1 # focus (useful before keyboard input)
agent-browser fill @e2 "hello" # clear then type
agent-browser type @e2 " world" # type without clearing
agent-browser press Enter # press a key at current focus
agent-browser press Control+a # key combination
agent-browser check @e3 # check checkbox
agent-browser uncheck @e3 # uncheck
agent-browser select @e4 "option-value" # native <select> only
agent-browser select @e4 "a" "b" # select multiple
agent-browser pick @e4 --option "Europe" # ANY combobox (react-select / ARIA /
chrome-use click @e1 # click
chrome-use click @e1 --new-tab # open link in new tab instead of navigating
chrome-use dblclick @e1 # double-click
chrome-use hover @e1 # hover
chrome-use focus @e1 # focus (useful before keyboard input)
chrome-use fill @e2 "hello" # clear then type
chrome-use type @e2 " world" # type without clearing
chrome-use press Enter # press a key at current focus
chrome-use press Control+a # key combination
chrome-use check @e3 # check checkbox
chrome-use uncheck @e3 # uncheck
chrome-use select @e4 "option-value" # native <select> only
chrome-use select @e4 "a" "b" # select multiple
chrome-use pick @e4 --option "Europe" # ANY combobox (react-select / ARIA /
# native): opens it, waits for the menu
# (incl. portal-rendered), matches by
# visible text, fires the right events,
@@ -240,10 +240,10 @@ agent-browser pick @e4 --option "Europe" # ANY combobox (react-select / ARIA /
# (no silent no-op). Use this for custom
# dropdowns where `select` returns ✓ but
# changes nothing.
agent-browser upload @e5 file1.pdf # upload file(s)
agent-browser scroll down 500 # scroll page (up/down/left/right)
agent-browser scrollintoview @e1 # scroll element into view
agent-browser drag @e1 @e2 # drag and drop
chrome-use upload @e5 file1.pdf # upload file(s)
chrome-use scroll down 500 # scroll page (up/down/left/right)
chrome-use scrollintoview @e1 # scroll element into view
chrome-use drag @e1 @e2 # drag and drop
```
### When refs don't work or you don't want to snapshot
@@ -251,22 +251,22 @@ agent-browser drag @e1 @e2 # drag and drop
Use semantic locators:
```bash
agent-browser find role button click --name "Submit"
agent-browser find text "Sign In" click
agent-browser find text "Sign In" click --exact # exact match only
agent-browser find label "Email" fill "user@test.com"
agent-browser find placeholder "Search" type "query"
agent-browser find testid "submit-btn" click
agent-browser find first ".card" click
agent-browser find nth 2 ".card" hover
chrome-use find role button click --name "Submit"
chrome-use find text "Sign In" click
chrome-use find text "Sign In" click --exact # exact match only
chrome-use find label "Email" fill "user@test.com"
chrome-use find placeholder "Search" type "query"
chrome-use find testid "submit-btn" click
chrome-use find first ".card" click
chrome-use find nth 2 ".card" hover
```
Or a raw CSS selector:
```bash
agent-browser click "#submit"
agent-browser fill "input[name=email]" "user@test.com"
agent-browser click "button.primary"
chrome-use click "#submit"
chrome-use fill "input[name=email]" "user@test.com"
chrome-use click "button.primary"
```
Escalation ladder: snapshot + `@eN` refs are quickest for straightforward
@@ -278,16 +278,16 @@ occluded clicks). Don't retry a flaky structured locator three times; drop to
`click` auto-scrolls into view and, if the coordinate click is occluded, falls
back to a DOM `.click()`. If a click *reports success but nothing happened* —
classic for an autocomplete/menu `<li>` that closes on the input's blur — retry
that one with `AGENT_BROWSER_CLICK_MODE=dom agent-browser click ...`, or just
`agent-browser eval "<select the item via JS>"`.
that one with `AGENT_BROWSER_CLICK_MODE=dom chrome-use click ...`, or just
`chrome-use eval "<select the item via JS>"`.
Click a raw pixel point when the only handle you have is a coordinate (canvas,
a marker from a screenshot, a target with no stable selector):
```bash
agent-browser click 449 320 # click viewport point (x y)
agent-browser click 449,320 # same, comma form
agent-browser click --coords 449,320 # same, explicit flag
chrome-use click 449 320 # click viewport point (x y)
chrome-use click 449,320 # same, comma form
chrome-use click --coords 449,320 # same, explicit flag
```
A bare-number argument is always a coordinate, never a selector.
@@ -298,13 +298,13 @@ Agents fail more often from bad waits than from bad selectors. Pick the
right wait for the situation:
```bash
agent-browser wait @e1 # until an element appears
agent-browser wait 2000 # dumb wait, milliseconds (last resort)
agent-browser wait --text "Success" # until the text appears on the page
agent-browser wait --url "**/dashboard" # until URL matches pattern (glob)
agent-browser wait --load networkidle # until network idle (post-navigation)
agent-browser wait --load domcontentloaded # until DOMContentLoaded
agent-browser wait --fn "window.myApp.ready === true" # until JS condition
chrome-use wait @e1 # until an element appears
chrome-use wait 2000 # dumb wait, milliseconds (last resort)
chrome-use wait --text "Success" # until the text appears on the page
chrome-use wait --url "**/dashboard" # until URL matches pattern (glob)
chrome-use wait --load networkidle # until network idle (post-navigation)
chrome-use wait --load domcontentloaded # until DOMContentLoaded
chrome-use wait --fn "window.myApp.ready === true" # until JS condition
```
After any page-changing action, pick one:
@@ -321,42 +321,42 @@ flaky. Timeouts default to 25 seconds.
### Log in
```bash
agent-browser open https://app.example.com/login
agent-browser snapshot -i
chrome-use open https://app.example.com/login
chrome-use snapshot -i
# Pick the email/password refs out of the snapshot, then:
agent-browser fill @e3 "user@example.com"
agent-browser fill @e4 "hunter2"
agent-browser click @e5
agent-browser wait --url "**/dashboard"
agent-browser snapshot -i
chrome-use fill @e3 "user@example.com"
chrome-use fill @e4 "hunter2"
chrome-use click @e5
chrome-use wait --url "**/dashboard"
chrome-use snapshot -i
```
Credentials in shell history are a leak. For anything sensitive, use the
auth vault (see [references/authentication.md](references/authentication.md)):
```bash
agent-browser auth save my-app --url https://app.example.com/login \
chrome-use auth save my-app --url https://app.example.com/login \
--username user@example.com --password-stdin
# (type password, Ctrl+D)
agent-browser auth login my-app # fills + clicks, waits for form
chrome-use auth login my-app # fills + clicks, waits for form
```
### Persist session across runs
```bash
# Log in once, save cookies + localStorage
agent-browser state save ./auth.json
chrome-use state save ./auth.json
# Later runs start already-logged-in
agent-browser --state ./auth.json open https://app.example.com
chrome-use --state ./auth.json open https://app.example.com
```
Or use `--session-name` for auto-save/restore:
```bash
AGENT_BROWSER_SESSION_NAME=my-app agent-browser open https://app.example.com
AGENT_BROWSER_SESSION_NAME=my-app chrome-use open https://app.example.com
# State is auto-saved and restored on subsequent runs with the same name.
```
@@ -369,7 +369,7 @@ re-discover it.** Keep one markdown file per domain (these are your own notes,
not shipped with the skill):
```
~/.agent-browser/site-patterns/<domain>.md
~/.chrome-use/site-patterns/<domain>.md
```
**Before** working on a domain, read its file if it exists (use your normal file
@@ -402,15 +402,15 @@ page every time.
```bash
# Structured snapshot (best for AI reasoning over page content)
agent-browser snapshot -i --json > page.json
chrome-use snapshot -i --json > page.json
# Targeted extraction with refs
agent-browser snapshot -i
agent-browser get text @e5
agent-browser get attr @e10 href
chrome-use snapshot -i
chrome-use get text @e5
chrome-use get attr @e10 href
# Arbitrary shape via JavaScript
cat <<'EOF' | agent-browser eval --stdin
cat <<'EOF' | chrome-use eval --stdin
const rows = document.querySelectorAll("table tbody tr");
Array.from(rows).map(r => ({
name: r.cells[0].innerText,
@@ -421,7 +421,7 @@ EOF
Prefer `eval --stdin` (heredoc), `eval --file <path>`, or `eval -b <base64>`
for any JS with quotes, **non-ASCII identifiers/strings (e.g. Chinese)**, or
large scripts — inline `agent-browser eval "..."` is shell-mangled and works
large scripts — inline `chrome-use eval "..."` is shell-mangled and works
only for simple ASCII expressions.
**`eval` runs in the page's MAIN world and state persists across calls**, so a
@@ -440,10 +440,10 @@ key events (some search-as-you-type widgets) won't react; use `keyboard type` (o
### Screenshot
```bash
agent-browser screenshot # temp path, printed on stdout
agent-browser screenshot page.png # specific path
agent-browser screenshot --full full.png # full scroll height
agent-browser screenshot --annotate map.png # numbered labels + legend keyed to snapshot refs
chrome-use screenshot # temp path, printed on stdout
chrome-use screenshot page.png # specific path
chrome-use screenshot --full full.png # full scroll height
chrome-use screenshot --annotate map.png # numbered labels + legend keyed to snapshot refs
```
Headless Chromium screenshots hide native scrollbars for consistent image output.
@@ -454,11 +454,11 @@ Pass `--hide-scrollbars false` when launching to keep native scrollbars visible.
### Handle multiple pages via tabs
```bash
agent-browser tab # list open tabs (with stable tabId)
agent-browser tabs # alias for `tab` (lists too)
agent-browser tab new https://docs... # open a new tab (and switch to it)
agent-browser tab t2 # switch to tab t2
agent-browser tab close t2 # close tab t2
chrome-use tab # list open tabs (with stable tabId)
chrome-use tabs # alias for `tab` (lists too)
chrome-use tab new https://docs... # open a new tab (and switch to it)
chrome-use tab t2 # switch to tab t2
chrome-use tab close t2 # close tab t2
```
(`tabs` → the `tab` subcommand tree, and `get-text <sel>` → `get text <sel>` —
@@ -475,10 +475,10 @@ Each `--session <name>` is an isolated browser with its own cookies, tabs,
and refs. Useful for testing multi-user flows or parallel scraping:
```bash
agent-browser --session a open https://app.example.com
agent-browser --session b open https://app.example.com
agent-browser --session a fill @e1 "alice@test.com"
agent-browser --session b fill @e1 "bob@test.com"
chrome-use --session a open https://app.example.com
chrome-use --session b open https://app.example.com
chrome-use --session a fill @e1 "alice@test.com"
chrome-use --session b fill @e1 "bob@test.com"
```
`AGENT_BROWSER_SESSION=myapp` sets the default session for the current
@@ -500,23 +500,23 @@ extension (each with a distinct `--session`), not raw `--cdp`.
### Mock network requests
```bash
agent-browser network route "**/api/users" --body '{"users":[]}' # stub a response
agent-browser network route "**/analytics" --abort # block entirely
agent-browser network requests --clear # start capturing fresh
agent-browser network requests # inspect what fired
agent-browser network har start # record all traffic
chrome-use network route "**/api/users" --body '{"users":[]}' # stub a response
chrome-use network route "**/analytics" --abort # block entirely
chrome-use network requests --clear # start capturing fresh
chrome-use network requests # inspect what fired
chrome-use network har start # record all traffic
# ... perform actions ...
agent-browser network har stop /tmp/trace.har
chrome-use network har stop /tmp/trace.har
```
### Record a video of the workflow
```bash
agent-browser record start demo.webm
agent-browser open https://example.com
agent-browser snapshot -i
agent-browser click @e3
agent-browser record stop
chrome-use record start demo.webm
chrome-use open https://example.com
chrome-use snapshot -i
chrome-use click @e3
chrome-use record stop
```
See [references/video-recording.md](references/video-recording.md) for
@@ -527,21 +527,21 @@ codec options, GIF export, and more.
Iframes are auto-inlined in the snapshot — their refs work transparently:
```bash
agent-browser snapshot -i
chrome-use snapshot -i
# @e3 [Iframe] "payment-frame"
# @e4 [input] "Card number"
# @e5 [button] "Pay"
agent-browser fill @e4 "4111111111111111"
agent-browser click @e5
chrome-use fill @e4 "4111111111111111"
chrome-use click @e5
```
To scope a snapshot to an iframe (for focus or deep nesting):
```bash
agent-browser frame @e3 # switch context to the iframe
agent-browser snapshot -i
agent-browser frame main # back to main frame
chrome-use frame @e3 # switch context to the iframe
chrome-use snapshot -i
chrome-use frame main # back to main frame
```
### Dialogs
@@ -550,10 +550,10 @@ agent-browser frame main # back to main frame
`confirm` and `prompt`:
```bash
agent-browser dialog status # is there a pending dialog?
agent-browser dialog accept # accept
agent-browser dialog accept "text" # accept with prompt input
agent-browser dialog dismiss # cancel
chrome-use dialog status # is there a pending dialog?
chrome-use dialog accept # accept
chrome-use dialog accept "text" # accept with prompt input
chrome-use dialog dismiss # cancel
```
## Diagnosing install issues
@@ -563,12 +563,12 @@ stale daemons, version mismatches after `upgrade`, missing Chrome, etc.)
run `doctor` before anything else:
```bash
agent-browser doctor # full diagnosis (env, Chrome, daemons, config, providers, network, launch test)
agent-browser doctor --offline --quick # fast, local-only
agent-browser doctor --fix # also run destructive repairs (reinstall Chrome, purge old state, ...)
agent-browser doctor --json # structured output for programmatic consumption
agent-browser stealth status # stealth self-check: mode + live probes
agent-browser stealth status --json # (webdriver/chrome/plugins/UA) + applied
chrome-use doctor # full diagnosis (env, Chrome, daemons, config, providers, network, launch test)
chrome-use doctor --offline --quick # fast, local-only
chrome-use doctor --fix # also run destructive repairs (reinstall Chrome, purge old state, ...)
chrome-use doctor --json # structured output for programmatic consumption
chrome-use stealth status # stealth self-check: mode + live probes
chrome-use stealth status --json # (webdriver/chrome/plugins/UA) + applied
# overrides. Gate a sensitive flow on this
# instead of driving an external detector.
```
@@ -580,18 +580,18 @@ Destructive actions require `--fix`. Exit code is `0` if all checks pass
## Troubleshooting
**"Ref not found" / "Element not found: @eN"**
Page changed since the snapshot. Run `agent-browser snapshot -i` again,
Page changed since the snapshot. Run `chrome-use snapshot -i` again,
then use the new refs.
**Element exists in the DOM but not in the snapshot**
It's probably off-screen or not yet rendered. Try:
```bash
agent-browser scroll down 1000
agent-browser snapshot -i
chrome-use scroll down 1000
chrome-use snapshot -i
# or
agent-browser wait --text "..."
agent-browser snapshot -i
chrome-use wait --text "..."
chrome-use snapshot -i
```
**Click does nothing / overlay swallows the click**
@@ -602,7 +602,7 @@ dismiss/close button, click it, then re-snapshot.
Your tab was closed, navigated across processes, or its debugger detached
(e.g. it landed on a `chrome://` or Chrome Web Store page, which Chrome
forbids debugging). The session no longer has a live tab — re-run
`agent-browser open <your URL>` to re-attach, then retry. This loud error
`chrome-use open <your URL>` to re-attach, then retry. This loud error
replaces the old silent behaviour where the command ran on some *other*
tab and returned wrong data.
@@ -617,17 +617,17 @@ sanity check on every read.
Some custom input components intercept key events. Try:
```bash
agent-browser focus @e1
agent-browser keyboard inserttext "text" # bypasses key events
chrome-use focus @e1
chrome-use keyboard inserttext "text" # bypasses key events
# or
agent-browser keyboard type "text" # raw keystrokes, no selector
chrome-use keyboard type "text" # raw keystrokes, no selector
```
**Page needs JS you can't get right in one shot**
Use `eval --stdin` with a heredoc instead of inline:
```bash
cat <<'EOF' | agent-browser eval --stdin
cat <<'EOF' | chrome-use eval --stdin
// Complex script with quotes, backticks, whatever
document.querySelectorAll('[data-id]').length
EOF
@@ -665,28 +665,28 @@ and [references/authentication.md](references/authentication.md).
## When to load another skill
- **Electron desktop app** (VS Code, Slack desktop, Discord, Figma, etc.):
`agent-browser skills get electron`
- **Slack workspace automation**: `agent-browser skills get slack`
- **Exploratory testing / QA / bug hunts**: `agent-browser skills get dogfood`
- **Vercel Sandbox microVMs**: `agent-browser skills get vercel-sandbox`
- **AWS Bedrock AgentCore cloud browser**: `agent-browser skills get agentcore`
`chrome-use skills get electron`
- **Slack workspace automation**: `chrome-use skills get slack`
- **Exploratory testing / QA / bug hunts**: `chrome-use skills get dogfood`
- **Vercel Sandbox microVMs**: `chrome-use skills get vercel-sandbox`
- **AWS Bedrock AgentCore cloud browser**: `chrome-use skills get agentcore`
## React / Web Vitals (built-in, any React app)
agent-browser ships with first-class React introspection. Works on any
chrome-use ships with first-class React introspection. Works on any
React app — Next.js, Remix, Vite+React, CRA, TanStack Start, React Native
Web, etc. The `react …` commands require the React DevTools hook to be
installed at launch via `--enable react-devtools`:
```bash
agent-browser open --enable react-devtools http://localhost:3000
agent-browser react tree # component tree
agent-browser react inspect <fiberId> # props, hooks, state, source
agent-browser react renders start # begin re-render recording
agent-browser react renders stop # print render profile
agent-browser react suspense [--only-dynamic] # Suspense boundaries + classifier
agent-browser vitals [url] # LCP/CLS/TTFB/FCP/INP + hydration
agent-browser pushstate <url> # SPA navigation (auto-detects Next router)
chrome-use open --enable react-devtools http://localhost:3000
chrome-use react tree # component tree
chrome-use react inspect <fiberId> # props, hooks, state, source
chrome-use react renders start # begin re-render recording
chrome-use react renders stop # print render profile
chrome-use react suspense [--only-dynamic] # Suspense boundaries + classifier
chrome-use vitals [url] # LCP/CLS/TTFB/FCP/INP + hydration
chrome-use pushstate <url> # SPA navigation (auto-detects Next router)
```
Without `--enable react-devtools`, the `react …` commands error. `vitals`
@@ -706,7 +706,7 @@ instructed. See `references/trust-boundaries.md` for the full rules.
Everything covered here plus the complete command/flag/env listing:
```bash
agent-browser skills get core --full
chrome-use skills get core --full
```
That pulls in:
+70 -70
View File
@@ -44,18 +44,18 @@ Log in to your target site(s) in this Chrome window as you normally would.
```bash
# Auto-discover the running Chrome and save its cookies + localStorage
agent-browser --auto-connect state save ./my-auth.json
chrome-use --auto-connect state save ./my-auth.json
```
**Step 3: Reuse in automation**
```bash
# Load auth at launch
agent-browser --state ./my-auth.json open https://app.example.com/dashboard
chrome-use --state ./my-auth.json open https://app.example.com/dashboard
# Or load into an existing session
agent-browser state load ./my-auth.json
agent-browser open https://app.example.com/dashboard
chrome-use state load ./my-auth.json
chrome-use open https://app.example.com/dashboard
```
This works for any site, including those with complex OAuth flows, SSO, or 2FA -- as long as Chrome already has valid session cookies.
@@ -65,35 +65,35 @@ This works for any site, including those with complex OAuth flows, SSO, or 2FA -
**Tip:** Combine with `--session-name` so the imported auth auto-persists across restarts:
```bash
agent-browser --session-name myapp state load ./my-auth.json
chrome-use --session-name myapp state load ./my-auth.json
# From now on, state is auto-saved/restored for "myapp"
```
## Persistent Profiles
Use `--profile` to point agent-browser at a Chrome user data directory. This persists everything (cookies, IndexedDB, service workers, cache) across browser restarts without explicit save/load:
Use `--profile` to point chrome-use at a Chrome user data directory. This persists everything (cookies, IndexedDB, service workers, cache) across browser restarts without explicit save/load:
```bash
# First run: login once
agent-browser --profile ~/.myapp-profile open https://app.example.com/login
chrome-use --profile ~/.myapp-profile open https://app.example.com/login
# ... complete login flow ...
# All subsequent runs: already authenticated
agent-browser --profile ~/.myapp-profile open https://app.example.com/dashboard
chrome-use --profile ~/.myapp-profile open https://app.example.com/dashboard
```
Use different paths for different projects or test users:
```bash
agent-browser --profile ~/.profiles/admin open https://app.example.com
agent-browser --profile ~/.profiles/viewer open https://app.example.com
chrome-use --profile ~/.profiles/admin open https://app.example.com
chrome-use --profile ~/.profiles/viewer open https://app.example.com
```
Or set via environment variable:
```bash
export AGENT_BROWSER_PROFILE=~/.myapp-profile
agent-browser open https://app.example.com/dashboard
chrome-use open https://app.example.com/dashboard
```
## Session Persistence
@@ -102,42 +102,42 @@ Use `--session-name` to auto-save and restore cookies + localStorage by name, wi
```bash
# Auto-saves state on close, auto-restores on next launch
agent-browser --session-name twitter open https://twitter.com
chrome-use --session-name twitter open https://twitter.com
# ... login flow ...
agent-browser close # state saved to ~/.agent-browser/sessions/
chrome-use close # state saved to ~/.chrome-use/sessions/
# Next time: state is automatically restored
agent-browser --session-name twitter open https://twitter.com
chrome-use --session-name twitter open https://twitter.com
```
Encrypt state at rest:
```bash
export AGENT_BROWSER_ENCRYPTION_KEY=$(openssl rand -hex 32)
agent-browser --session-name secure open https://app.example.com
chrome-use --session-name secure open https://app.example.com
```
## Basic Login Flow
```bash
# Navigate to login page
agent-browser open https://app.example.com/login
agent-browser wait --load networkidle
chrome-use open https://app.example.com/login
chrome-use wait --load networkidle
# Get form elements
agent-browser snapshot -i
chrome-use snapshot -i
# Output: @e1 [input type="email"], @e2 [input type="password"], @e3 [button] "Sign In"
# Fill credentials
agent-browser fill @e1 "user@example.com"
agent-browser fill @e2 "password123"
chrome-use fill @e1 "user@example.com"
chrome-use fill @e2 "password123"
# Submit
agent-browser click @e3
agent-browser wait --load networkidle
chrome-use click @e3
chrome-use wait --load networkidle
# Verify login succeeded
agent-browser get url # Should be dashboard, not login
chrome-use get url # Should be dashboard, not login
```
## Saving Authentication State
@@ -146,15 +146,15 @@ After logging in, save state for reuse:
```bash
# Login first (see above)
agent-browser open https://app.example.com/login
agent-browser snapshot -i
agent-browser fill @e1 "user@example.com"
agent-browser fill @e2 "password123"
agent-browser click @e3
agent-browser wait --url "**/dashboard"
chrome-use open https://app.example.com/login
chrome-use snapshot -i
chrome-use fill @e1 "user@example.com"
chrome-use fill @e2 "password123"
chrome-use click @e3
chrome-use wait --url "**/dashboard"
# Save authenticated state
agent-browser state save ./auth-state.json
chrome-use state save ./auth-state.json
```
## Restoring Authentication
@@ -163,13 +163,13 @@ Skip login by loading saved state:
```bash
# Load saved auth state
agent-browser state load ./auth-state.json
chrome-use state load ./auth-state.json
# Navigate directly to protected page
agent-browser open https://app.example.com/dashboard
chrome-use open https://app.example.com/dashboard
# Verify authenticated
agent-browser snapshot -i
chrome-use snapshot -i
```
## OAuth / SSO Flows
@@ -178,23 +178,23 @@ For OAuth redirects:
```bash
# Start OAuth flow
agent-browser open https://app.example.com/auth/google
chrome-use open https://app.example.com/auth/google
# Handle redirects automatically
agent-browser wait --url "**/accounts.google.com**"
agent-browser snapshot -i
chrome-use wait --url "**/accounts.google.com**"
chrome-use snapshot -i
# Fill Google credentials
agent-browser fill @e1 "user@gmail.com"
agent-browser click @e2 # Next button
agent-browser wait 2000
agent-browser snapshot -i
agent-browser fill @e3 "password"
agent-browser click @e4 # Sign in
chrome-use fill @e1 "user@gmail.com"
chrome-use click @e2 # Next button
chrome-use wait 2000
chrome-use snapshot -i
chrome-use fill @e3 "password"
chrome-use click @e4 # Sign in
# Wait for redirect back
agent-browser wait --url "**/app.example.com**"
agent-browser state save ./oauth-state.json
chrome-use wait --url "**/app.example.com**"
chrome-use state save ./oauth-state.json
```
## Two-Factor Authentication
@@ -203,18 +203,18 @@ Handle 2FA with manual intervention:
```bash
# Login with credentials
agent-browser open https://app.example.com/login --headed # Show browser
agent-browser snapshot -i
agent-browser fill @e1 "user@example.com"
agent-browser fill @e2 "password123"
agent-browser click @e3
chrome-use open https://app.example.com/login --headed # Show browser
chrome-use snapshot -i
chrome-use fill @e1 "user@example.com"
chrome-use fill @e2 "password123"
chrome-use click @e3
# Wait for user to complete 2FA manually
echo "Complete 2FA in the browser window..."
agent-browser wait --url "**/dashboard" --timeout 120000
chrome-use wait --url "**/dashboard" --timeout 120000
# Save state after 2FA
agent-browser state save ./2fa-state.json
chrome-use state save ./2fa-state.json
```
## HTTP Basic Auth
@@ -223,10 +223,10 @@ For sites using HTTP Basic Authentication:
```bash
# Set credentials before navigation
agent-browser set credentials username password
chrome-use set credentials username password
# Navigate to protected resource
agent-browser open https://protected.example.com/api
chrome-use open https://protected.example.com/api
```
## Cookie-Based Auth
@@ -235,10 +235,10 @@ Manually set authentication cookies:
```bash
# Set auth cookie
agent-browser cookies set session_token "abc123xyz"
chrome-use cookies set session_token "abc123xyz"
# Navigate to protected page
agent-browser open https://app.example.com/dashboard
chrome-use open https://app.example.com/dashboard
```
## Token Refresh Handling
@@ -253,24 +253,24 @@ STATE_FILE="./auth-state.json"
# Try loading existing state
if [[ -f "$STATE_FILE" ]]; then
agent-browser state load "$STATE_FILE"
agent-browser open https://app.example.com/dashboard
chrome-use state load "$STATE_FILE"
chrome-use open https://app.example.com/dashboard
# Check if session is still valid
URL=$(agent-browser get url)
URL=$(chrome-use get url)
if [[ "$URL" == *"/login"* ]]; then
echo "Session expired, re-authenticating..."
# Perform fresh login
agent-browser snapshot -i
agent-browser fill @e1 "$USERNAME"
agent-browser fill @e2 "$PASSWORD"
agent-browser click @e3
agent-browser wait --url "**/dashboard"
agent-browser state save "$STATE_FILE"
chrome-use snapshot -i
chrome-use fill @e1 "$USERNAME"
chrome-use fill @e2 "$PASSWORD"
chrome-use click @e3
chrome-use wait --url "**/dashboard"
chrome-use state save "$STATE_FILE"
fi
else
# First-time login
agent-browser open https://app.example.com/login
chrome-use open https://app.example.com/login
# ... login flow ...
fi
```
@@ -284,20 +284,20 @@ fi
2. **Use environment variables for credentials**
```bash
agent-browser fill @e1 "$APP_USERNAME"
agent-browser fill @e2 "$APP_PASSWORD"
chrome-use fill @e1 "$APP_USERNAME"
chrome-use fill @e2 "$APP_PASSWORD"
```
3. **Clean up after automation**
```bash
agent-browser cookies clear
chrome-use cookies clear
rm -f ./auth-state.json
```
4. **Use short-lived sessions for CI/CD**
```bash
# Don't persist state in CI
agent-browser open https://app.example.com/login
chrome-use open https://app.example.com/login
# ... login and perform actions ...
agent-browser close # Session ends, nothing persisted
chrome-use close # Session ends, nothing persisted
```
+198 -198
View File
@@ -1,30 +1,30 @@
# Command Reference
Complete reference for all agent-browser commands. For quick start and common patterns, see SKILL.md.
Complete reference for all chrome-use commands. For quick start and common patterns, see SKILL.md.
## Navigation
```bash
agent-browser open # Launch browser (no navigation); stays on about:blank.
chrome-use open # Launch browser (no navigation); stays on about:blank.
# Pair with `network route`, `cookies set --curl`, or
# `addinitscript` to stage state before the first navigation.
agent-browser open <url> # Launch + navigate (aliases: goto, navigate)
chrome-use open <url> # Launch + navigate (aliases: goto, navigate)
# Supports: https://, http://, file://, about:, data://
# Auto-prepends https:// if no protocol given
agent-browser back # Go back
agent-browser forward # Go forward
agent-browser reload # Reload page
agent-browser pushstate <url> # SPA client-side navigation. Auto-detects
chrome-use back # Go back
chrome-use forward # Go forward
chrome-use reload # Reload page
chrome-use pushstate <url> # SPA client-side navigation. Auto-detects
# window.next.router.push (triggers RSC fetch on Next.js);
# falls back to history.pushState + popstate/navigate events.
agent-browser close # Close browser (aliases: quit, exit)
agent-browser connect 9222 # Connect to browser via CDP port
chrome-use close # Close browser (aliases: quit, exit)
chrome-use connect 9222 # Connect to browser via CDP port
```
### Pre-navigation setup (one-turn batch)
```bash
agent-browser batch \
chrome-use batch \
'["open"]' \
'["network","route","*","--abort","--resource-type","script"]' \
'["cookies","set","--curl","cookies.curl","--domain","localhost"]' \
@@ -40,67 +40,67 @@ prior page.
## Snapshot (page analysis)
```bash
agent-browser snapshot # Full accessibility tree
agent-browser snapshot -i # Interactive elements only (recommended)
agent-browser snapshot -c # Compact output
agent-browser snapshot -d 3 # Limit depth to 3
agent-browser snapshot -s "#main" # Scope to CSS selector
chrome-use snapshot # Full accessibility tree
chrome-use snapshot -i # Interactive elements only (recommended)
chrome-use snapshot -c # Compact output
chrome-use snapshot -d 3 # Limit depth to 3
chrome-use snapshot -s "#main" # Scope to CSS selector
```
## Interactions (use @refs from snapshot)
```bash
agent-browser click @e1 # Click
agent-browser click @e1 --new-tab # Click and open in new tab
agent-browser dblclick @e1 # Double-click
agent-browser focus @e1 # Focus element
agent-browser fill @e2 "text" # Clear and type
agent-browser type @e2 "text" # Type without clearing
agent-browser press Enter # Press key (alias: key)
agent-browser press Control+a # Key combination
agent-browser keydown Shift # Hold key down
agent-browser keyup Shift # Release key
agent-browser hover @e1 # Hover
agent-browser check @e1 # Check checkbox
agent-browser uncheck @e1 # Uncheck checkbox
agent-browser select @e1 "value" # Select dropdown option
agent-browser select @e1 "a" "b" # Select multiple options
agent-browser scroll down 500 # Scroll page (default: down 300px)
agent-browser scrollintoview @e1 # Scroll element into view (alias: scrollinto)
agent-browser drag @e1 @e2 # Drag and drop
agent-browser upload @e1 file.pdf # Upload files
chrome-use click @e1 # Click
chrome-use click @e1 --new-tab # Click and open in new tab
chrome-use dblclick @e1 # Double-click
chrome-use focus @e1 # Focus element
chrome-use fill @e2 "text" # Clear and type
chrome-use type @e2 "text" # Type without clearing
chrome-use press Enter # Press key (alias: key)
chrome-use press Control+a # Key combination
chrome-use keydown Shift # Hold key down
chrome-use keyup Shift # Release key
chrome-use hover @e1 # Hover
chrome-use check @e1 # Check checkbox
chrome-use uncheck @e1 # Uncheck checkbox
chrome-use select @e1 "value" # Select dropdown option
chrome-use select @e1 "a" "b" # Select multiple options
chrome-use scroll down 500 # Scroll page (default: down 300px)
chrome-use scrollintoview @e1 # Scroll element into view (alias: scrollinto)
chrome-use drag @e1 @e2 # Drag and drop
chrome-use upload @e1 file.pdf # Upload files
```
## Get Information
```bash
agent-browser get text @e1 # Get element text
agent-browser get html @e1 # Get innerHTML
agent-browser get value @e1 # Get input value
agent-browser get attr @e1 href # Get attribute
agent-browser get title # Get page title
agent-browser get url # Get current URL
agent-browser get cdp-url # Get CDP WebSocket URL
agent-browser get count ".item" # Count matching elements
agent-browser get box @e1 # Get bounding box
agent-browser get styles @e1 # Get computed styles (font, color, bg, etc.)
chrome-use get text @e1 # Get element text
chrome-use get html @e1 # Get innerHTML
chrome-use get value @e1 # Get input value
chrome-use get attr @e1 href # Get attribute
chrome-use get title # Get page title
chrome-use get url # Get current URL
chrome-use get cdp-url # Get CDP WebSocket URL
chrome-use get count ".item" # Count matching elements
chrome-use get box @e1 # Get bounding box
chrome-use get styles @e1 # Get computed styles (font, color, bg, etc.)
```
## Check State
```bash
agent-browser is visible @e1 # Check if visible
agent-browser is enabled @e1 # Check if enabled
agent-browser is checked @e1 # Check if checked
chrome-use is visible @e1 # Check if visible
chrome-use is enabled @e1 # Check if enabled
chrome-use is checked @e1 # Check if checked
```
## Screenshots and PDF
```bash
agent-browser screenshot # Save to temporary directory
agent-browser screenshot path.png # Save to specific path
agent-browser screenshot --full # Full page
agent-browser pdf output.pdf # Save as PDF
chrome-use screenshot # Save to temporary directory
chrome-use screenshot path.png # Save to specific path
chrome-use screenshot --full # Full page
chrome-use pdf output.pdf # Save as PDF
```
Headless Chromium screenshots hide native scrollbars for consistent image output.
@@ -109,97 +109,97 @@ Pass `--hide-scrollbars false` when launching to keep native scrollbars visible.
## Video Recording
```bash
agent-browser record start ./demo.webm # Start recording
agent-browser click @e1 # Perform actions
agent-browser record stop # Stop and save video
agent-browser record restart ./take2.webm # Stop current + start new
chrome-use record start ./demo.webm # Start recording
chrome-use click @e1 # Perform actions
chrome-use record stop # Stop and save video
chrome-use record restart ./take2.webm # Stop current + start new
```
## Wait
```bash
agent-browser wait @e1 # Wait for element
agent-browser wait 2000 # Wait milliseconds
agent-browser wait --text "Success" # Wait for text (or -t)
agent-browser wait --url "**/dashboard" # Wait for URL pattern (or -u)
agent-browser wait --load networkidle # Wait for network idle (or -l)
agent-browser wait --fn "window.ready" # Wait for JS condition (or -f)
chrome-use wait @e1 # Wait for element
chrome-use wait 2000 # Wait milliseconds
chrome-use wait --text "Success" # Wait for text (or -t)
chrome-use wait --url "**/dashboard" # Wait for URL pattern (or -u)
chrome-use wait --load networkidle # Wait for network idle (or -l)
chrome-use wait --fn "window.ready" # Wait for JS condition (or -f)
```
## Mouse Control
```bash
agent-browser mouse move 100 200 # Move mouse
agent-browser mouse down left # Press button
agent-browser mouse up left # Release button
agent-browser mouse wheel 100 # Scroll wheel
chrome-use mouse move 100 200 # Move mouse
chrome-use mouse down left # Press button
chrome-use mouse up left # Release button
chrome-use mouse wheel 100 # Scroll wheel
```
## Semantic Locators (alternative to refs)
```bash
agent-browser find role button click --name "Submit"
agent-browser find text "Sign In" click
agent-browser find text "Sign In" click --exact # Exact match only
agent-browser find label "Email" fill "user@test.com"
agent-browser find placeholder "Search" type "query"
agent-browser find alt "Logo" click
agent-browser find title "Close" click
agent-browser find testid "submit-btn" click
agent-browser find first ".item" click
agent-browser find last ".item" click
agent-browser find nth 2 "a" hover
chrome-use find role button click --name "Submit"
chrome-use find text "Sign In" click
chrome-use find text "Sign In" click --exact # Exact match only
chrome-use find label "Email" fill "user@test.com"
chrome-use find placeholder "Search" type "query"
chrome-use find alt "Logo" click
chrome-use find title "Close" click
chrome-use find testid "submit-btn" click
chrome-use find first ".item" click
chrome-use find last ".item" click
chrome-use find nth 2 "a" hover
```
## Browser Settings
```bash
agent-browser set viewport 1920 1080 # Set viewport size
agent-browser set viewport 1920 1080 2 # 2x retina (same CSS size, higher res screenshots)
agent-browser set device "iPhone 14" # Emulate device
agent-browser set geo 37.7749 -122.4194 # Set geolocation (alias: geolocation)
agent-browser set offline on # Toggle offline mode
agent-browser set headers '{"X-Key":"v"}' # Extra HTTP headers
agent-browser set credentials user pass # HTTP basic auth (alias: auth)
agent-browser set media dark # Emulate color scheme
agent-browser set media light reduced-motion # Light mode + reduced motion
chrome-use set viewport 1920 1080 # Set viewport size
chrome-use set viewport 1920 1080 2 # 2x retina (same CSS size, higher res screenshots)
chrome-use set device "iPhone 14" # Emulate device
chrome-use set geo 37.7749 -122.4194 # Set geolocation (alias: geolocation)
chrome-use set offline on # Toggle offline mode
chrome-use set headers '{"X-Key":"v"}' # Extra HTTP headers
chrome-use set credentials user pass # HTTP basic auth (alias: auth)
chrome-use set media dark # Emulate color scheme
chrome-use set media light reduced-motion # Light mode + reduced motion
```
## Cookies and Storage
```bash
agent-browser cookies # Get all cookies
agent-browser cookies set name value # Set cookie
agent-browser cookies clear # Clear cookies
agent-browser storage local # Get all localStorage
agent-browser storage local key # Get specific key
agent-browser storage local set k v # Set value
agent-browser storage local clear # Clear all
chrome-use cookies # Get all cookies
chrome-use cookies set name value # Set cookie
chrome-use cookies clear # Clear cookies
chrome-use storage local # Get all localStorage
chrome-use storage local key # Get specific key
chrome-use storage local set k v # Set value
chrome-use storage local clear # Clear all
```
## Network
```bash
agent-browser network route <url> # Intercept requests
agent-browser network route <url> --abort # Block requests
agent-browser network route <url> --body '{}' # Mock response
agent-browser network unroute [url] # Remove routes
agent-browser network requests # View tracked requests
agent-browser network requests --filter api # Filter requests
chrome-use network route <url> # Intercept requests
chrome-use network route <url> --abort # Block requests
chrome-use network route <url> --body '{}' # Mock response
chrome-use network unroute [url] # Remove routes
chrome-use network requests # View tracked requests
chrome-use network requests --filter api # Filter requests
```
## Tabs and Windows
```bash
agent-browser tab # List tabs with tabId and label
agent-browser tab new [url] # New tab
agent-browser tab new --label docs [url] # New tab with a memorable label
agent-browser tab t2 # Switch to tab by id
agent-browser tab docs # Switch to tab by label
agent-browser tab close # Close current tab
agent-browser tab close t2 # Close tab by id
agent-browser tab close docs # Close tab by label
agent-browser window new # New window
chrome-use tab # List tabs with tabId and label
chrome-use tab new [url] # New tab
chrome-use tab new --label docs [url] # New tab with a memorable label
chrome-use tab t2 # Switch to tab by id
chrome-use tab docs # Switch to tab by label
chrome-use tab close # Close current tab
chrome-use tab close t2 # Close tab by id
chrome-use tab close docs # Close tab by label
chrome-use window new # New window
```
Tab ids are stable strings of the form `t1`, `t2`, `t3`. They're never reused
@@ -212,13 +212,13 @@ everywhere a tab ref is accepted. Labels are the agent-friendly way to write
multi-tab workflows:
```bash
agent-browser tab new --label docs https://docs.example.com
agent-browser tab new --label app https://app.example.com
agent-browser tab docs # switch to docs
agent-browser snapshot # populate refs for docs
agent-browser click @e1 # ref click on docs
agent-browser tab app # switch to app
agent-browser tab close docs # close by label
chrome-use tab new --label docs https://docs.example.com
chrome-use tab new --label app https://app.example.com
chrome-use tab docs # switch to docs
chrome-use snapshot # populate refs for docs
chrome-use click @e1 # ref click on docs
chrome-use tab app # switch to app
chrome-use tab close docs # close by label
```
Labels are never auto-generated, never rewritten on navigation, and must be
@@ -229,9 +229,9 @@ that was active when the snapshot ran.
## Frames
```bash
agent-browser frame "#iframe" # Switch to iframe by CSS selector
agent-browser frame @e3 # Switch to iframe by element ref
agent-browser frame main # Back to main frame
chrome-use frame "#iframe" # Switch to iframe by CSS selector
chrome-use frame @e3 # Switch to iframe by element ref
chrome-use frame main # Back to main frame
```
### Iframe support
@@ -239,19 +239,19 @@ agent-browser frame main # Back to main frame
Iframes are detected automatically during snapshots. When the main-frame snapshot runs, `Iframe` nodes are resolved and their content is inlined beneath the iframe element in the output (one level of nesting; iframes within iframes are not expanded).
```bash
agent-browser snapshot -i
chrome-use snapshot -i
# @e3 [Iframe] "payment-frame"
# @e4 [input] "Card number"
# @e5 [button] "Pay"
# Interact directly — refs inside iframes already work
agent-browser fill @e4 "4111111111111111"
agent-browser click @e5
chrome-use fill @e4 "4111111111111111"
chrome-use click @e5
# Or switch frame context for scoped snapshots
agent-browser frame @e3 # Switch using element ref
agent-browser snapshot -i # Snapshot scoped to that iframe
agent-browser frame main # Return to main frame
chrome-use frame @e3 # Switch using element ref
chrome-use snapshot -i # Snapshot scoped to that iframe
chrome-use frame main # Return to main frame
```
The `frame` command accepts:
@@ -264,27 +264,27 @@ The `frame` command accepts:
By default, `alert` and `beforeunload` dialogs are automatically accepted so they never block the agent. `confirm` and `prompt` dialogs still require explicit handling. Use `--no-auto-dialog` to disable this behavior.
```bash
agent-browser dialog accept [text] # Accept dialog
agent-browser dialog dismiss # Dismiss dialog
agent-browser dialog status # Check if a dialog is currently open
chrome-use dialog accept [text] # Accept dialog
chrome-use dialog dismiss # Dismiss dialog
chrome-use dialog status # Check if a dialog is currently open
```
## JavaScript
```bash
agent-browser eval "document.title" # Simple expressions only
agent-browser eval -b "<base64>" # Any JavaScript (base64 encoded)
agent-browser eval --stdin # Read script from stdin
chrome-use eval "document.title" # Simple expressions only
chrome-use eval -b "<base64>" # Any JavaScript (base64 encoded)
chrome-use eval --stdin # Read script from stdin
```
Use `-b`/`--base64` or `--stdin` for reliable execution. Shell escaping with nested quotes and special characters is error-prone.
```bash
# Base64 encode your script, then:
agent-browser eval -b "ZG9jdW1lbnQucXVlcnlTZWxlY3RvcignW3NyYyo9Il9uZXh0Il0nKQ=="
chrome-use eval -b "ZG9jdW1lbnQucXVlcnlTZWxlY3RvcignW3NyYyo9Il9uZXh0Il0nKQ=="
# Or use stdin with heredoc for multiline scripts:
cat <<'EOF' | agent-browser eval --stdin
cat <<'EOF' | chrome-use eval --stdin
const links = document.querySelectorAll('a');
Array.from(links).map(a => a.href);
EOF
@@ -293,49 +293,49 @@ EOF
## State Management
```bash
agent-browser state save auth.json # Save cookies, storage, auth state
agent-browser state load auth.json # Restore saved state
chrome-use state save auth.json # Save cookies, storage, auth state
chrome-use state load auth.json # Restore saved state
```
## Global Options
```bash
agent-browser --session <name> ... # Isolated browser session
agent-browser --json ... # JSON output for parsing
agent-browser --headed ... # Default & always-on (stealth). Headless is FORBIDDEN
chrome-use --session <name> ... # Isolated browser session
chrome-use --json ... # JSON output for parsing
chrome-use --headed ... # Default & always-on (stealth). Headless is FORBIDDEN
# (bot tell); display-less servers: AGENT_BROWSER_ALLOW_HEADLESS=1
agent-browser --full ... # Full page screenshot (-f)
agent-browser --cdp <port> ... # Connect via Chrome DevTools Protocol
agent-browser -p <provider> ... # Cloud browser provider (--provider)
agent-browser --proxy <url> ... # Use proxy server
agent-browser --proxy-bypass <hosts> # Hosts to bypass proxy
agent-browser --headers <json> ... # HTTP headers scoped to URL's origin
agent-browser --executable-path <p> # Custom browser executable
agent-browser --extension <path> ... # Load browser extension (repeatable)
agent-browser --ignore-https-errors # Ignore SSL certificate errors
agent-browser --hide-scrollbars false # Keep native scrollbars visible in headless Chromium screenshots
agent-browser --help # Show help (-h)
agent-browser --version # Show version (-V)
agent-browser <command> --help # Show detailed help for a command
chrome-use --full ... # Full page screenshot (-f)
chrome-use --cdp <port> ... # Connect via Chrome DevTools Protocol
chrome-use -p <provider> ... # Cloud browser provider (--provider)
chrome-use --proxy <url> ... # Use proxy server
chrome-use --proxy-bypass <hosts> # Hosts to bypass proxy
chrome-use --headers <json> ... # HTTP headers scoped to URL's origin
chrome-use --executable-path <p> # Custom browser executable
chrome-use --extension <path> ... # Load browser extension (repeatable)
chrome-use --ignore-https-errors # Ignore SSL certificate errors
chrome-use --hide-scrollbars false # Keep native scrollbars visible in headless Chromium screenshots
chrome-use --help # Show help (-h)
chrome-use --version # Show version (-V)
chrome-use <command> --help # Show detailed help for a command
```
## Drive your real, logged-in Chrome (extension — zero confirmation)
Chrome 136 blocked `--remote-debugging-port` on the default profile, so to drive
the user's *existing* logged-in window, agent-browser uses a Chrome **extension**
the user's *existing* logged-in window, chrome-use uses a Chrome **extension**
over native messaging — no port, no token, no per-use confirmation (the
codex/claude approach).
One-time setup:
```bash
agent-browser extension install # writes the native-messaging host manifest
chrome-use extension install # writes the native-messaging host manifest
```
The native-messaging host accepts **both** extension origins, so either install
works — but prefer the Store build:
1. **Chrome Web Store (recommended)** — one-click *Add to Chrome*:
<https://chromewebstore.google.com/detail/agent-browser-stealth/knfcmbamhjmaonkfnjhldjedeobeafmk>
<https://chromewebstore.google.com/detail/chrome-use/knfcmbamhjmaonkfnjhldjedeobeafmk>
Restart-stable and auto-updating (store id `knfcmbamhjmaonkfnjhldjedeobeafmk`).
2. **Load unpacked (dev)** — load `<repo>/extensions/ab-connect` from source;
its pinned `key` gives the stable id `ciiljdlhd…`. NOTE: Load-unpacked
@@ -347,12 +347,12 @@ CLI can't load an unpacked extension):
> chrome://extensions → enable **Developer mode** (top-right) → **Load unpacked** →
> select `<repo>/extensions/ab-connect` (it appears in the list as
> **agent-browser-stealth**)
> **chrome-use**)
Once loaded, the relay goes live and plain `agent-browser open <url>` connects
Once loaded, the relay goes live and plain `chrome-use open <url>` connects
through it automatically — `auto_connect_cdp` prefers the live extension relay
over a raw `--remote-debugging-port`, so Chrome 136+'s "Allow remote debugging?"
consent popup never appears. `agent-browser extension connect` is the explicit
consent popup never appears. `chrome-use extension connect` is the explicit
form of the same path.
**You can do this load step yourself with a computer-use / GUI-automation tool**
@@ -368,35 +368,35 @@ the folder (one click). After it loads, Chrome assigns the extension a fixed id
Then, any time (pure CLI, zero confirmation):
```bash
agent-browser extension connect # auto-attaches to the live, logged-in tabs
agent-browser tab # list the real tabs it now controls
agent-browser tab t3 # switch the session to one of them
agent-browser snapshot -i / eval / click ... # drive it like any session
agent-browser extension status # is the host installed?
agent-browser extension uninstall # remove the host manifest
chrome-use extension connect # auto-attaches to the live, logged-in tabs
chrome-use tab # list the real tabs it now controls
chrome-use tab t3 # switch the session to one of them
chrome-use snapshot -i / eval / click ... # drive it like any session
chrome-use extension status # is the host installed?
chrome-use extension uninstall # remove the host manifest
```
Security: the extension↔host link is authenticated by Chrome (extension id); the
host↔agent-browser CDP link uses an unguessable URL in a 0600 file. Use this when
host↔chrome-use CDP link uses an unguessable URL in a 0600 file. Use this when
you need the user's real cookies/login on their actual machine. (`--extension
<path>` is unrelated — that loads an extension into a *launched* browser.)
## Debugging
```bash
agent-browser --headed open example.com # Show browser window
agent-browser --cdp 9222 snapshot # Connect via CDP port
agent-browser connect 9222 # Alternative: connect command
agent-browser console # View console messages (needs AGENT_BROWSER_CAPTURE_CONSOLE=1)
agent-browser console --clear # Clear console
agent-browser errors # View page errors (needs AGENT_BROWSER_CAPTURE_CONSOLE=1)
agent-browser errors --clear # Clear errors
agent-browser highlight @e1 # Highlight element
agent-browser inspect # Open Chrome DevTools for this session
agent-browser trace start # Start recording trace
agent-browser trace stop trace.zip # Stop and save trace
agent-browser profiler start # Start Chrome DevTools profiling
agent-browser profiler stop trace.json # Stop and save profile
chrome-use --headed open example.com # Show browser window
chrome-use --cdp 9222 snapshot # Connect via CDP port
chrome-use connect 9222 # Alternative: connect command
chrome-use console # View console messages (needs AGENT_BROWSER_CAPTURE_CONSOLE=1)
chrome-use console --clear # Clear console
chrome-use errors # View page errors (needs AGENT_BROWSER_CAPTURE_CONSOLE=1)
chrome-use errors --clear # Clear errors
chrome-use highlight @e1 # Highlight element
chrome-use inspect # Open Chrome DevTools for this session
chrome-use trace start # Start recording trace
chrome-use trace stop trace.zip # Stop and save trace
chrome-use profiler start # Start Chrome DevTools profiling
chrome-use profiler stop trace.json # Stop and save profile
```
### Finding a page the user saved (`find-url`)
@@ -406,10 +406,10 @@ systems or previously-saved pages that public search can't reach. Local read, no
browser/daemon needed.
```bash
agent-browser find-url jira board # all keywords must match (name or url)
agent-browser find-url --limit 10 invoices
agent-browser find-url --browser edge --profile "Profile 1" wiki
agent-browser find-url grafana --json # {results:[{name,url,folder}], count}
chrome-use find-url jira board # all keywords must match (name or url)
chrome-use find-url --limit 10 invoices
chrome-use find-url --browser edge --profile "Profile 1" wiki
chrome-use find-url grafana --json # {results:[{name,url,folder}], count}
```
Results are most-recently-added first. `javascript:`/`data:` bookmarklets are
@@ -425,13 +425,13 @@ problem (e.g. a hidden `point_choice=none` that the visible UI never exposes):
```bash
# Dump every field's name → value, including hidden inputs and unchecked radios
agent-browser eval "JSON.stringify([...document.forms[0].elements].map(e=>({name:e.name,type:e.type,value:e.value,checked:e.checked})).filter(e=>e.name))"
chrome-use eval "JSON.stringify([...document.forms[0].elements].map(e=>({name:e.name,type:e.type,value:e.value,checked:e.checked})).filter(e=>e.name))"
# Inspect one hidden field directly
agent-browser eval "document.querySelector('[name=point_choice]')?.value"
chrome-use eval "document.querySelector('[name=point_choice]')?.value"
# Why won't it submit? Ask the browser's own validity API
agent-browser eval "[...document.forms[0].elements].filter(e=>!e.validity?.valid).map(e=>e.name+': '+e.validationMessage)"
chrome-use eval "[...document.forms[0].elements].filter(e=>!e.validity?.valid).map(e=>e.name+': '+e.validationMessage)"
```
## React / Web Vitals
@@ -440,30 +440,30 @@ Requires `--enable react-devtools` at launch for the `react ...` commands.
`vitals` and `pushstate` are framework-agnostic.
```bash
agent-browser open --enable react-devtools <url> # Launch with React hook installed
agent-browser react tree # Full component tree
agent-browser react inspect <fiberId> # Props, hooks, state, source
agent-browser react renders start # Begin re-render recording
agent-browser react renders stop [--json] # Stop and print render profile
agent-browser react suspense [--only-dynamic] [--json] # Suspense boundaries + classifier
chrome-use open --enable react-devtools <url> # Launch with React hook installed
chrome-use react tree # Full component tree
chrome-use react inspect <fiberId> # Props, hooks, state, source
chrome-use react renders start # Begin re-render recording
chrome-use react renders stop [--json] # Stop and print render profile
chrome-use react suspense [--only-dynamic] [--json] # Suspense boundaries + classifier
# --only-dynamic hides the "static" list
agent-browser vitals [url] [--json] # LCP/CLS/TTFB/FCP/INP + hydration
agent-browser pushstate <url> # SPA client-side nav (auto-detects Next router)
chrome-use vitals [url] [--json] # LCP/CLS/TTFB/FCP/INP + hydration
chrome-use pushstate <url> # SPA client-side nav (auto-detects Next router)
```
## Init scripts
```bash
agent-browser open --init-script <path> # Register before first navigation (repeatable)
agent-browser addinitscript <js> # Register at runtime (returns identifier)
agent-browser removeinitscript <identifier> # Remove a previously registered init script
chrome-use open --init-script <path> # Register before first navigation (repeatable)
chrome-use addinitscript <js> # Register at runtime (returns identifier)
chrome-use removeinitscript <identifier> # Remove a previously registered init script
```
## cURL cookie import
```bash
agent-browser cookies set --curl <file> # Auto-detects JSON/cURL/Cookie-header
agent-browser cookies set --curl <file> --domain example.com # Scope to a domain
chrome-use cookies set --curl <file> # Auto-detects JSON/cURL/Cookie-header
chrome-use cookies set --curl <file> --domain example.com # Scope to a domain
```
Supported formats: JSON array of `{name, value}`, a cURL dump from
@@ -473,8 +473,8 @@ echo cookie values.
## Network route by resource type
```bash
agent-browser network route '*' --abort --resource-type script # Block scripts only (SSR-lock pattern)
agent-browser network route '*' --resource-type image,font --body '' # Stub images and fonts
chrome-use network route '*' --abort --resource-type script # Block scripts only (SSR-lock pattern)
chrome-use network route '*' --resource-type image,font --body '' # Stub images and fonts
```
## Environment Variables
@@ -488,7 +488,7 @@ AGENT_BROWSER_ENABLE="react-devtools" # Comma-separated built-in init scr
AGENT_BROWSER_HIDE_SCROLLBARS="false" # Keep native scrollbars visible in headless Chromium screenshots
AGENT_BROWSER_PROVIDER="browserbase" # Cloud browser provider
AGENT_BROWSER_STREAM_PORT="9223" # Override WebSocket streaming port (default: OS-assigned)
AGENT_BROWSER_HOME="/path/to/agent-browser" # Custom install location
AGENT_BROWSER_HOME="/path/to/chrome-use" # Custom install location
AGENT_BROWSER_CLICK_MODE="dom" # Click strategy: "" (default: scroll-in + coordinate
# click, DOM-dispatch fallback), "coord" (strict
# coordinate only), "dom" (always element.click())
+21 -21
View File
@@ -18,28 +18,28 @@ Capture Chrome DevTools performance profiles during browser automation for perfo
```bash
# Start profiling
agent-browser profiler start
chrome-use profiler start
# Perform actions
agent-browser navigate https://example.com
agent-browser click "#button"
agent-browser wait 1000
chrome-use navigate https://example.com
chrome-use click "#button"
chrome-use wait 1000
# Stop and save
agent-browser profiler stop ./trace.json
chrome-use profiler stop ./trace.json
```
## Profiler Commands
```bash
# Start profiling with default categories
agent-browser profiler start
chrome-use profiler start
# Start with custom trace categories
agent-browser profiler start --categories "devtools.timeline,v8.execute,blink.user_timing"
chrome-use profiler start --categories "devtools.timeline,v8.execute,blink.user_timing"
# Stop profiling and save to file
agent-browser profiler stop ./trace.json
chrome-use profiler stop ./trace.json
```
## Categories
@@ -61,30 +61,30 @@ Several `disabled-by-default-*` categories are also included for detailed timeli
### Diagnosing Slow Page Loads
```bash
agent-browser profiler start
agent-browser navigate https://app.example.com
agent-browser wait --load networkidle
agent-browser profiler stop ./page-load-profile.json
chrome-use profiler start
chrome-use navigate https://app.example.com
chrome-use wait --load networkidle
chrome-use profiler stop ./page-load-profile.json
```
### Profiling User Interactions
```bash
agent-browser navigate https://app.example.com
agent-browser profiler start
agent-browser click "#submit"
agent-browser wait 2000
agent-browser profiler stop ./interaction-profile.json
chrome-use navigate https://app.example.com
chrome-use profiler start
chrome-use click "#submit"
chrome-use wait 2000
chrome-use profiler stop ./interaction-profile.json
```
### CI Performance Regression Checks
```bash
#!/bin/bash
agent-browser profiler start
agent-browser navigate https://app.example.com
agent-browser wait --load networkidle
agent-browser profiler stop "./profiles/build-${BUILD_ID}.json"
chrome-use profiler start
chrome-use navigate https://app.example.com
chrome-use wait --load networkidle
chrome-use profiler stop "./profiles/build-${BUILD_ID}.json"
```
## Output Format
+21 -21
View File
@@ -21,20 +21,20 @@ Use the `--proxy` flag or set proxy via environment variable:
```bash
# Via CLI flag
agent-browser --proxy "http://proxy.example.com:8080" open https://example.com
chrome-use --proxy "http://proxy.example.com:8080" open https://example.com
# Via environment variable
export HTTP_PROXY="http://proxy.example.com:8080"
agent-browser open https://example.com
chrome-use open https://example.com
# HTTPS proxy
export HTTPS_PROXY="https://proxy.example.com:8080"
agent-browser open https://example.com
chrome-use open https://example.com
# Both
export HTTP_PROXY="http://proxy.example.com:8080"
export HTTPS_PROXY="http://proxy.example.com:8080"
agent-browser open https://example.com
chrome-use open https://example.com
```
## Authenticated Proxy
@@ -44,7 +44,7 @@ For proxies requiring authentication:
```bash
# Include credentials in URL
export HTTP_PROXY="http://username:password@proxy.example.com:8080"
agent-browser open https://example.com
chrome-use open https://example.com
```
## SOCKS Proxy
@@ -52,11 +52,11 @@ agent-browser open https://example.com
```bash
# SOCKS5 proxy
export ALL_PROXY="socks5://proxy.example.com:1080"
agent-browser open https://example.com
chrome-use open https://example.com
# SOCKS5 with auth
export ALL_PROXY="socks5://user:pass@proxy.example.com:1080"
agent-browser open https://example.com
chrome-use open https://example.com
```
## Proxy Bypass
@@ -65,12 +65,12 @@ Skip proxy for specific domains using `--proxy-bypass` or `NO_PROXY`:
```bash
# Via CLI flag
agent-browser --proxy "http://proxy.example.com:8080" --proxy-bypass "localhost,*.internal.com" open https://example.com
chrome-use --proxy "http://proxy.example.com:8080" --proxy-bypass "localhost,*.internal.com" open https://example.com
# Via environment variable
export NO_PROXY="localhost,127.0.0.1,.internal.company.com"
agent-browser open https://internal.company.com # Direct connection
agent-browser open https://external.com # Via proxy
chrome-use open https://internal.company.com # Direct connection
chrome-use open https://external.com # Via proxy
```
## Common Use Cases
@@ -94,9 +94,9 @@ for proxy in "${PROXIES[@]}"; do
region=$(echo "$proxy" | grep -oP '^\w+-\w+')
echo "Testing from: $region"
agent-browser --session "$region" open https://example.com
agent-browser --session "$region" screenshot "./screenshots/$region.png"
agent-browser --session "$region" close
chrome-use --session "$region" open https://example.com
chrome-use --session "$region" screenshot "./screenshots/$region.png"
chrome-use --session "$region" close
done
```
@@ -123,9 +123,9 @@ for i in "${!URLS[@]}"; do
export HTTP_PROXY="${PROXY_LIST[$proxy_index]}"
export HTTPS_PROXY="${PROXY_LIST[$proxy_index]}"
agent-browser open "${URLS[$i]}"
agent-browser get text body > "output-$i.txt"
agent-browser close
chrome-use open "${URLS[$i]}"
chrome-use get text body > "output-$i.txt"
chrome-use close
sleep 1 # Polite delay
done
@@ -142,18 +142,18 @@ export HTTPS_PROXY="http://corpproxy.company.com:8080"
export NO_PROXY="localhost,127.0.0.1,.company.com"
# External sites go through proxy
agent-browser open https://external-vendor.com
chrome-use open https://external-vendor.com
# Internal sites bypass proxy
agent-browser open https://intranet.company.com
chrome-use open https://intranet.company.com
```
## Verifying Proxy Connection
```bash
# Check your apparent IP
agent-browser open https://httpbin.org/ip
agent-browser get text body
chrome-use open https://httpbin.org/ip
chrome-use get text body
# Should show proxy's IP, not your real IP
```
@@ -175,7 +175,7 @@ Some proxies perform SSL inspection. If you encounter certificate errors:
```bash
# For testing only - not recommended for production
agent-browser open https://example.com --ignore-https-errors
chrome-use open https://example.com --ignore-https-errors
```
### Slow Performance
@@ -20,14 +20,14 @@ Use `--session` flag to isolate browser contexts:
```bash
# Session 1: Authentication flow
agent-browser --session auth open https://app.example.com/login
chrome-use --session auth open https://app.example.com/login
# Session 2: Public browsing (separate cookies, storage)
agent-browser --session public open https://example.com
chrome-use --session public open https://example.com
# Commands are isolated by session
agent-browser --session auth fill @e1 "user@example.com"
agent-browser --session public get text body
chrome-use --session auth fill @e1 "user@example.com"
chrome-use --session public get text body
```
## Session Isolation Properties
@@ -46,17 +46,17 @@ Each session has independent:
```bash
# Save cookies, storage, and auth state
agent-browser state save /path/to/auth-state.json
chrome-use state save /path/to/auth-state.json
```
### Load Session State
```bash
# Restore saved state
agent-browser state load /path/to/auth-state.json
chrome-use state load /path/to/auth-state.json
# Continue with authenticated session
agent-browser open https://app.example.com/dashboard
chrome-use open https://app.example.com/dashboard
```
### State File Contents
@@ -82,19 +82,19 @@ STATE_FILE="/tmp/auth-state.json"
# Check if we have saved state
if [[ -f "$STATE_FILE" ]]; then
agent-browser state load "$STATE_FILE"
agent-browser open https://app.example.com/dashboard
chrome-use state load "$STATE_FILE"
chrome-use open https://app.example.com/dashboard
else
# Perform login
agent-browser open https://app.example.com/login
agent-browser snapshot -i
agent-browser fill @e1 "$USERNAME"
agent-browser fill @e2 "$PASSWORD"
agent-browser click @e3
agent-browser wait --load networkidle
chrome-use open https://app.example.com/login
chrome-use snapshot -i
chrome-use fill @e1 "$USERNAME"
chrome-use fill @e2 "$PASSWORD"
chrome-use click @e3
chrome-use wait --load networkidle
# Save for future use
agent-browser state save "$STATE_FILE"
chrome-use state save "$STATE_FILE"
fi
```
@@ -105,32 +105,32 @@ fi
# Scrape multiple sites concurrently
# Start all sessions
agent-browser --session site1 open https://site1.com &
agent-browser --session site2 open https://site2.com &
agent-browser --session site3 open https://site3.com &
chrome-use --session site1 open https://site1.com &
chrome-use --session site2 open https://site2.com &
chrome-use --session site3 open https://site3.com &
wait
# Extract from each
agent-browser --session site1 get text body > site1.txt
agent-browser --session site2 get text body > site2.txt
agent-browser --session site3 get text body > site3.txt
chrome-use --session site1 get text body > site1.txt
chrome-use --session site2 get text body > site2.txt
chrome-use --session site3 get text body > site3.txt
# Cleanup
agent-browser --session site1 close
agent-browser --session site2 close
agent-browser --session site3 close
chrome-use --session site1 close
chrome-use --session site2 close
chrome-use --session site3 close
```
### A/B Testing Sessions
```bash
# Test different user experiences
agent-browser --session variant-a open "https://app.com?variant=a"
agent-browser --session variant-b open "https://app.com?variant=b"
chrome-use --session variant-a open "https://app.com?variant=a"
chrome-use --session variant-b open "https://app.com?variant=b"
# Compare
agent-browser --session variant-a screenshot /tmp/variant-a.png
agent-browser --session variant-b screenshot /tmp/variant-b.png
chrome-use --session variant-a screenshot /tmp/variant-a.png
chrome-use --session variant-b screenshot /tmp/variant-b.png
```
## Default Session
@@ -139,19 +139,19 @@ When `--session` is omitted, commands use the default session:
```bash
# These use the same default session
agent-browser open https://example.com
agent-browser snapshot -i
agent-browser close # Closes default session
chrome-use open https://example.com
chrome-use snapshot -i
chrome-use close # Closes default session
```
## Session Cleanup
```bash
# Close specific session
agent-browser --session auth close
chrome-use --session auth close
# List active sessions
agent-browser session list
chrome-use session list
```
## Best Practices
@@ -160,19 +160,19 @@ agent-browser session list
```bash
# GOOD: Clear purpose
agent-browser --session github-auth open https://github.com
agent-browser --session docs-scrape open https://docs.example.com
chrome-use --session github-auth open https://github.com
chrome-use --session docs-scrape open https://docs.example.com
# AVOID: Generic names
agent-browser --session s1 open https://github.com
chrome-use --session s1 open https://github.com
```
### 2. Always Clean Up
```bash
# Close sessions when done
agent-browser --session auth close
agent-browser --session scrape close
chrome-use --session auth close
chrome-use --session scrape close
```
### 3. Handle State Files Securely
@@ -189,5 +189,5 @@ rm /tmp/auth-state.json
```bash
# Set timeout for automated scripts
timeout 60 agent-browser --session long-task get text body
timeout 60 chrome-use --session long-task get text body
```
+33 -33
View File
@@ -21,7 +21,7 @@ Traditional approach:
Full DOM/HTML → AI parses → CSS selector → Action (~3000-5000 tokens)
```
agent-browser approach:
chrome-use approach:
```
Compact snapshot → @refs assigned → Direct interaction (~200-400 tokens)
```
@@ -30,10 +30,10 @@ Compact snapshot → @refs assigned → Direct interaction (~200-400 tokens)
```bash
# Basic snapshot (shows page structure)
agent-browser snapshot
chrome-use snapshot
# Interactive snapshot (-i flag) - RECOMMENDED
agent-browser snapshot -i
chrome-use snapshot -i
```
### Snapshot Output Format
@@ -66,16 +66,16 @@ Once you have refs, interact directly:
```bash
# Click the "Sign In" button
agent-browser click @e6
chrome-use click @e6
# Fill email input
agent-browser fill @e10 "user@example.com"
chrome-use fill @e10 "user@example.com"
# Fill password
agent-browser fill @e11 "password123"
chrome-use fill @e11 "password123"
# Submit the form
agent-browser click @e12
chrome-use click @e12
```
## Ref Lifecycle
@@ -84,14 +84,14 @@ agent-browser click @e12
```bash
# Get initial snapshot
agent-browser snapshot -i
chrome-use snapshot -i
# @e1 [button] "Next"
# Click triggers page change
agent-browser click @e1
chrome-use click @e1
# MUST re-snapshot to get new refs!
agent-browser snapshot -i
chrome-use snapshot -i
# @e1 [h1] "Page 2" ← Different element now!
```
@@ -101,29 +101,29 @@ agent-browser snapshot -i
```bash
# CORRECT
agent-browser open https://example.com
agent-browser snapshot -i # Get refs first
agent-browser click @e1 # Use ref
chrome-use open https://example.com
chrome-use snapshot -i # Get refs first
chrome-use click @e1 # Use ref
# WRONG
agent-browser open https://example.com
agent-browser click @e1 # Ref doesn't exist yet!
chrome-use open https://example.com
chrome-use click @e1 # Ref doesn't exist yet!
```
### 2. Re-Snapshot After Navigation
```bash
agent-browser click @e5 # Navigates to new page
agent-browser snapshot -i # Get new refs
agent-browser click @e1 # Use new refs
chrome-use click @e5 # Navigates to new page
chrome-use snapshot -i # Get new refs
chrome-use click @e1 # Use new refs
```
### 3. Re-Snapshot After Dynamic Changes
```bash
agent-browser click @e1 # Opens dropdown
agent-browser snapshot -i # See dropdown items
agent-browser click @e7 # Select item
chrome-use click @e1 # Opens dropdown
chrome-use snapshot -i # See dropdown items
chrome-use click @e7 # Select item
```
### 4. Snapshot Specific Regions
@@ -132,7 +132,7 @@ For complex pages, snapshot specific areas:
```bash
# Snapshot just the form
agent-browser snapshot @e9
chrome-use snapshot @e9
```
## Ref Notation Details
@@ -167,7 +167,7 @@ agent-browser snapshot @e9
Snapshots automatically detect and inline iframe content. When the main-frame snapshot runs, each `Iframe` node is resolved and its child accessibility tree is included directly beneath it in the output. Refs assigned to elements inside iframes carry frame context, so interactions like `click`, `fill`, and `type` work without manually switching frames.
```bash
agent-browser snapshot -i
chrome-use snapshot -i
# @e1 [heading] "Checkout"
# @e2 [Iframe] "payment-frame"
# @e3 [input] "Card number"
@@ -176,9 +176,9 @@ agent-browser snapshot -i
# @e6 [button] "Cancel"
# Interact with iframe elements directly using their refs
agent-browser fill @e3 "4111111111111111"
agent-browser fill @e4 "12/28"
agent-browser click @e5
chrome-use fill @e3 "4111111111111111"
chrome-use fill @e4 "12/28"
chrome-use click @e5
```
**Key details:**
@@ -193,27 +193,27 @@ agent-browser click @e5
```bash
# Ref may have changed - re-snapshot
agent-browser snapshot -i
chrome-use snapshot -i
```
### Element Not Visible in Snapshot
```bash
# Scroll down to reveal element
agent-browser scroll down 1000
agent-browser snapshot -i
chrome-use scroll down 1000
chrome-use snapshot -i
# Or wait for dynamic content
agent-browser wait 1000
agent-browser snapshot -i
chrome-use wait 1000
chrome-use snapshot -i
```
### Too Many Elements
```bash
# Snapshot specific container
agent-browser snapshot @e5
chrome-use snapshot @e5
# Or use get text for content-only extraction
agent-browser get text @e5
chrome-use get text @e5
```
@@ -1,6 +1,6 @@
# Trust boundaries
Safety rules that apply to every agent-browser task, across all sites and
Safety rules that apply to every chrome-use task, across all sites and
frameworks. Read before driving a real user's browser session.
**Related**: [SKILL.md](../SKILL.md), [authentication.md](authentication.md).
+42 -42
View File
@@ -17,29 +17,29 @@ Capture browser automation as video for debugging, documentation, or verificatio
```bash
# Start recording
agent-browser record start ./demo.webm
chrome-use record start ./demo.webm
# Perform actions
agent-browser open https://example.com
agent-browser snapshot -i
agent-browser click @e1
agent-browser fill @e2 "test input"
chrome-use open https://example.com
chrome-use snapshot -i
chrome-use click @e1
chrome-use fill @e2 "test input"
# Stop and save
agent-browser record stop
chrome-use record stop
```
## Recording Commands
```bash
# Start recording to file
agent-browser record start ./output.webm
chrome-use record start ./output.webm
# Stop current recording
agent-browser record stop
chrome-use record stop
# Restart with new file (stops current + starts new)
agent-browser record restart ./take2.webm
chrome-use record restart ./take2.webm
```
## Use Cases
@@ -50,18 +50,18 @@ agent-browser record restart ./take2.webm
#!/bin/bash
# Record automation for debugging
agent-browser record start ./debug-$(date +%Y%m%d-%H%M%S).webm
chrome-use record start ./debug-$(date +%Y%m%d-%H%M%S).webm
# Run your automation
agent-browser open https://app.example.com
agent-browser snapshot -i
agent-browser click @e1 || {
chrome-use open https://app.example.com
chrome-use snapshot -i
chrome-use click @e1 || {
echo "Click failed - check recording"
agent-browser record stop
chrome-use record stop
exit 1
}
agent-browser record stop
chrome-use record stop
```
### Documentation Generation
@@ -70,23 +70,23 @@ agent-browser record stop
#!/bin/bash
# Record workflow for documentation
agent-browser record start ./docs/how-to-login.webm
chrome-use record start ./docs/how-to-login.webm
agent-browser open https://app.example.com/login
agent-browser wait 1000 # Pause for visibility
chrome-use open https://app.example.com/login
chrome-use wait 1000 # Pause for visibility
agent-browser snapshot -i
agent-browser fill @e1 "demo@example.com"
agent-browser wait 500
chrome-use snapshot -i
chrome-use fill @e1 "demo@example.com"
chrome-use wait 500
agent-browser fill @e2 "password"
agent-browser wait 500
chrome-use fill @e2 "password"
chrome-use wait 500
agent-browser click @e3
agent-browser wait --load networkidle
agent-browser wait 1000 # Show result
chrome-use click @e3
chrome-use wait --load networkidle
chrome-use wait 1000 # Show result
agent-browser record stop
chrome-use record stop
```
### CI/CD Test Evidence
@@ -99,7 +99,7 @@ TEST_NAME="${1:-e2e-test}"
RECORDING_DIR="./test-recordings"
mkdir -p "$RECORDING_DIR"
agent-browser record start "$RECORDING_DIR/$TEST_NAME-$(date +%s).webm"
chrome-use record start "$RECORDING_DIR/$TEST_NAME-$(date +%s).webm"
# Run test
if run_e2e_test; then
@@ -108,7 +108,7 @@ else
echo "Test failed - recording saved"
fi
agent-browser record stop
chrome-use record stop
```
## Best Practices
@@ -117,16 +117,16 @@ agent-browser record stop
```bash
# Slow down for human viewing
agent-browser click @e1
agent-browser wait 500 # Let viewer see result
chrome-use click @e1
chrome-use wait 500 # Let viewer see result
```
### 2. Use Descriptive Filenames
```bash
# Include context in filename
agent-browser record start ./recordings/login-flow-2024-01-15.webm
agent-browser record start ./recordings/checkout-test-run-42.webm
chrome-use record start ./recordings/login-flow-2024-01-15.webm
chrome-use record start ./recordings/checkout-test-run-42.webm
```
### 3. Handle Recording in Error Cases
@@ -136,12 +136,12 @@ agent-browser record start ./recordings/checkout-test-run-42.webm
set -e
cleanup() {
agent-browser record stop 2>/dev/null || true
agent-browser close 2>/dev/null || true
chrome-use record stop 2>/dev/null || true
chrome-use close 2>/dev/null || true
}
trap cleanup EXIT
agent-browser record start ./automation.webm
chrome-use record start ./automation.webm
# ... automation steps ...
```
@@ -149,15 +149,15 @@ agent-browser record start ./automation.webm
```bash
# Record video AND capture key frames
agent-browser record start ./flow.webm
chrome-use record start ./flow.webm
agent-browser open https://example.com
agent-browser screenshot ./screenshots/step1-homepage.png
chrome-use open https://example.com
chrome-use screenshot ./screenshots/step1-homepage.png
agent-browser click @e1
agent-browser screenshot ./screenshots/step2-after-click.png
chrome-use click @e1
chrome-use screenshot ./screenshots/step2-after-click.png
agent-browser record stop
chrome-use record stop
```
## Output Format
@@ -4,8 +4,8 @@
# Usage: ./authenticated-session.sh <login-url> [state-file]
#
# RECOMMENDED: Use the auth vault instead of this template:
# echo "<pass>" | agent-browser auth save myapp --url <login-url> --username <user> --password-stdin
# agent-browser auth login myapp
# echo "<pass>" | chrome-use auth save myapp --url <login-url> --username <user> --password-stdin
# chrome-use auth login myapp
# The auth vault stores credentials securely and the LLM never sees passwords.
#
# Environment variables:
@@ -34,17 +34,17 @@ echo "Authentication workflow: $LOGIN_URL"
# ================================================================
if [[ -f "$STATE_FILE" ]]; then
echo "Loading saved state from $STATE_FILE..."
if agent-browser --state "$STATE_FILE" open "$LOGIN_URL" 2>/dev/null; then
agent-browser wait --load networkidle
if chrome-use --state "$STATE_FILE" open "$LOGIN_URL" 2>/dev/null; then
chrome-use wait --load networkidle
CURRENT_URL=$(agent-browser get url)
CURRENT_URL=$(chrome-use get url)
if [[ "$CURRENT_URL" != *"login"* ]] && [[ "$CURRENT_URL" != *"signin"* ]]; then
echo "Session restored successfully"
agent-browser snapshot -i
chrome-use snapshot -i
exit 0
fi
echo "Session expired, performing fresh login..."
agent-browser close 2>/dev/null || true
chrome-use close 2>/dev/null || true
else
echo "Failed to load state, re-authenticating..."
fi
@@ -55,13 +55,13 @@ fi
# DISCOVERY MODE: Shows form structure (delete after setup)
# ================================================================
echo "Opening login page..."
agent-browser open "$LOGIN_URL"
agent-browser wait --load networkidle
chrome-use open "$LOGIN_URL"
chrome-use wait --load networkidle
echo ""
echo "Login form structure:"
echo "---"
agent-browser snapshot -i
chrome-use snapshot -i
echo "---"
echo ""
echo "Next steps:"
@@ -70,7 +70,7 @@ echo " 2. Update the LOGIN FLOW section below with your refs"
echo " 3. Set: export APP_USERNAME='...' APP_PASSWORD='...'"
echo " 4. Delete this DISCOVERY MODE section"
echo ""
agent-browser close
chrome-use close
exit 0
# ================================================================
@@ -79,27 +79,27 @@ exit 0
# : "${APP_USERNAME:?Set APP_USERNAME environment variable}"
# : "${APP_PASSWORD:?Set APP_PASSWORD environment variable}"
#
# agent-browser open "$LOGIN_URL"
# agent-browser wait --load networkidle
# agent-browser snapshot -i
# chrome-use open "$LOGIN_URL"
# chrome-use wait --load networkidle
# chrome-use snapshot -i
#
# # Fill credentials (update refs to match your form)
# agent-browser fill @e1 "$APP_USERNAME"
# agent-browser fill @e2 "$APP_PASSWORD"
# agent-browser click @e3
# agent-browser wait --load networkidle
# chrome-use fill @e1 "$APP_USERNAME"
# chrome-use fill @e2 "$APP_PASSWORD"
# chrome-use click @e3
# chrome-use wait --load networkidle
#
# # Verify login succeeded
# FINAL_URL=$(agent-browser get url)
# FINAL_URL=$(chrome-use get url)
# if [[ "$FINAL_URL" == *"login"* ]] || [[ "$FINAL_URL" == *"signin"* ]]; then
# echo "Login failed - still on login page"
# agent-browser screenshot /tmp/login-failed.png
# agent-browser close
# chrome-use screenshot /tmp/login-failed.png
# chrome-use close
# exit 1
# fi
#
# # Save state for future runs
# echo "Saving state to $STATE_FILE"
# agent-browser state save "$STATE_FILE"
# chrome-use state save "$STATE_FILE"
# echo "Login successful"
# agent-browser snapshot -i
# chrome-use snapshot -i
+14 -14
View File
@@ -22,47 +22,47 @@ mkdir -p "$OUTPUT_DIR"
# Optional: Load authentication state
# if [[ -f "./auth-state.json" ]]; then
# echo "Loading authentication state..."
# agent-browser state load "./auth-state.json"
# chrome-use state load "./auth-state.json"
# fi
# Navigate to target
agent-browser open "$TARGET_URL"
agent-browser wait --load networkidle
chrome-use open "$TARGET_URL"
chrome-use wait --load networkidle
# Get metadata
TITLE=$(agent-browser get title)
URL=$(agent-browser get url)
TITLE=$(chrome-use get title)
URL=$(chrome-use get url)
echo "Title: $TITLE"
echo "URL: $URL"
# Capture full page screenshot
agent-browser screenshot --full "$OUTPUT_DIR/page-full.png"
chrome-use screenshot --full "$OUTPUT_DIR/page-full.png"
echo "Saved: $OUTPUT_DIR/page-full.png"
# Get page structure with refs
agent-browser snapshot -i > "$OUTPUT_DIR/page-structure.txt"
chrome-use snapshot -i > "$OUTPUT_DIR/page-structure.txt"
echo "Saved: $OUTPUT_DIR/page-structure.txt"
# Extract all text content
agent-browser get text body > "$OUTPUT_DIR/page-text.txt"
chrome-use get text body > "$OUTPUT_DIR/page-text.txt"
echo "Saved: $OUTPUT_DIR/page-text.txt"
# Save as PDF
agent-browser pdf "$OUTPUT_DIR/page.pdf"
chrome-use pdf "$OUTPUT_DIR/page.pdf"
echo "Saved: $OUTPUT_DIR/page.pdf"
# Optional: Extract specific elements using refs from structure
# agent-browser get text @e5 > "$OUTPUT_DIR/main-content.txt"
# chrome-use get text @e5 > "$OUTPUT_DIR/main-content.txt"
# Optional: Handle infinite scroll pages
# for i in {1..5}; do
# agent-browser scroll down 1000
# agent-browser wait 1000
# chrome-use scroll down 1000
# chrome-use wait 1000
# done
# agent-browser screenshot --full "$OUTPUT_DIR/page-scrolled.png"
# chrome-use screenshot --full "$OUTPUT_DIR/page-scrolled.png"
# Cleanup
agent-browser close
chrome-use close
echo ""
echo "Capture complete:"
+20 -20
View File
@@ -18,45 +18,45 @@ FORM_URL="${1:?Usage: $0 <form-url>}"
echo "Form automation: $FORM_URL"
# Step 1: Navigate to form
agent-browser open "$FORM_URL"
agent-browser wait --load networkidle
chrome-use open "$FORM_URL"
chrome-use wait --load networkidle
# Step 2: Snapshot to discover form elements
echo ""
echo "Form structure:"
agent-browser snapshot -i
chrome-use snapshot -i
# Step 3: Fill form fields (customize these refs based on snapshot output)
#
# Common field types:
# agent-browser fill @e1 "John Doe" # Text input
# agent-browser fill @e2 "user@example.com" # Email input
# agent-browser fill @e3 "SecureP@ss123" # Password input
# agent-browser select @e4 "Option Value" # Dropdown
# agent-browser check @e5 # Checkbox
# agent-browser click @e6 # Radio button
# agent-browser fill @e7 "Multi-line text" # Textarea
# agent-browser upload @e8 /path/to/file.pdf # File upload
# chrome-use fill @e1 "John Doe" # Text input
# chrome-use fill @e2 "user@example.com" # Email input
# chrome-use fill @e3 "SecureP@ss123" # Password input
# chrome-use select @e4 "Option Value" # Dropdown
# chrome-use check @e5 # Checkbox
# chrome-use click @e6 # Radio button
# chrome-use fill @e7 "Multi-line text" # Textarea
# chrome-use upload @e8 /path/to/file.pdf # File upload
#
# Uncomment and modify:
# agent-browser fill @e1 "Test User"
# agent-browser fill @e2 "test@example.com"
# agent-browser click @e3 # Submit button
# chrome-use fill @e1 "Test User"
# chrome-use fill @e2 "test@example.com"
# chrome-use click @e3 # Submit button
# Step 4: Wait for submission
# agent-browser wait --load networkidle
# agent-browser wait --url "**/success" # Or wait for redirect
# chrome-use wait --load networkidle
# chrome-use wait --url "**/success" # Or wait for redirect
# Step 5: Verify result
echo ""
echo "Result:"
agent-browser get url
agent-browser snapshot -i
chrome-use get url
chrome-use snapshot -i
# Optional: Capture evidence
agent-browser screenshot /tmp/form-result.png
chrome-use screenshot /tmp/form-result.png
echo "Screenshot saved: /tmp/form-result.png"
# Cleanup
agent-browser close
chrome-use close
echo "Done"
+25 -25
View File
@@ -1,7 +1,7 @@
---
name: dogfood
description: Systematically explore and test a web application to find bugs, UX issues, and other problems. Use when asked to "dogfood", "QA", "exploratory test", "find issues", "bug hunt", "test this app/site/platform", or review the quality of a web application. Produces a structured report with full reproduction evidence -- step-by-step screenshots, repro videos, and detailed repro steps for every issue -- so findings can be handed directly to the responsible teams.
allowed-tools: Bash(agent-browser:*), Bash(agent-browser-stealth:*), Bash(abs:*), Bash(npx agent-browser:*), Bash(npx agent-browser-stealth:*)
allowed-tools: Bash(chrome-use:*), Bash(chrome-use:*), Bash(abs:*), Bash(npx chrome-use:*), Bash(npx chrome-use:*)
---
# Dogfood
@@ -22,7 +22,7 @@ Only the **Target URL** is required. Everything else has sensible defaults -- us
If the user says something like "dogfood vercel.com", start immediately with defaults. Do not ask clarifying questions unless authentication is mentioned but credentials are missing.
Always use `agent-browser` directly -- never `npx agent-browser`. The direct binary uses the fast Rust client. `npx` routes through Node.js and is significantly slower.
Always use `chrome-use` directly -- never `npx chrome-use`. The direct binary uses the fast Rust client. `npx` routes through Node.js and is significantly slower.
## Workflow
@@ -50,8 +50,8 @@ cp {SKILL_DIR}/templates/dogfood-report-template.md {OUTPUT_DIR}/report.md
Start a named session:
```bash
agent-browser --session {SESSION} open {TARGET_URL}
agent-browser --session {SESSION} wait --load networkidle
chrome-use --session {SESSION} open {TARGET_URL}
chrome-use --session {SESSION} wait --load networkidle
```
### 2. Authenticate
@@ -59,12 +59,12 @@ agent-browser --session {SESSION} wait --load networkidle
If the app requires login:
```bash
agent-browser --session {SESSION} snapshot -i
chrome-use --session {SESSION} snapshot -i
# Identify login form refs, fill credentials
agent-browser --session {SESSION} fill @e1 "{EMAIL}"
agent-browser --session {SESSION} fill @e2 "{PASSWORD}"
agent-browser --session {SESSION} click @e3
agent-browser --session {SESSION} wait --load networkidle
chrome-use --session {SESSION} fill @e1 "{EMAIL}"
chrome-use --session {SESSION} fill @e2 "{PASSWORD}"
chrome-use --session {SESSION} click @e3
chrome-use --session {SESSION} wait --load networkidle
```
For OTP/email codes: ask the user, wait for their response, then enter the code.
@@ -72,7 +72,7 @@ For OTP/email codes: ask the user, wait for their response, then enter the code.
After successful login, save state for potential reuse:
```bash
agent-browser --session {SESSION} state save {OUTPUT_DIR}/auth-state.json
chrome-use --session {SESSION} state save {OUTPUT_DIR}/auth-state.json
```
### 3. Orient
@@ -80,8 +80,8 @@ agent-browser --session {SESSION} state save {OUTPUT_DIR}/auth-state.json
Take an initial annotated screenshot and snapshot to understand the app structure:
```bash
agent-browser --session {SESSION} screenshot --annotate {OUTPUT_DIR}/screenshots/initial.png
agent-browser --session {SESSION} snapshot -i
chrome-use --session {SESSION} screenshot --annotate {OUTPUT_DIR}/screenshots/initial.png
chrome-use --session {SESSION} snapshot -i
```
Identify the main navigation elements and map out the sections to visit.
@@ -96,15 +96,15 @@ Read [references/issue-taxonomy.md](references/issue-taxonomy.md) for the full l
- Within each section, test interactive elements: click buttons, fill forms, open dropdowns/modals.
- Check edge cases: empty states, error handling, boundary inputs.
- Try realistic end-to-end workflows (create, edit, delete flows).
- Check the browser console for errors periodically. **Console/error capture is off by default in this stealth fork** — start the dogfood session with `AGENT_BROWSER_CAPTURE_CONSOLE=1` (e.g. `AGENT_BROWSER_CAPTURE_CONSOLE=1 agent-browser --session {SESSION} open <url>`) or `console`/`errors` will return empty.
- Check the browser console for errors periodically. **Console/error capture is off by default in this stealth fork** — start the dogfood session with `AGENT_BROWSER_CAPTURE_CONSOLE=1` (e.g. `AGENT_BROWSER_CAPTURE_CONSOLE=1 chrome-use --session {SESSION} open <url>`) or `console`/`errors` will return empty.
**At each page:**
```bash
agent-browser --session {SESSION} snapshot -i
agent-browser --session {SESSION} screenshot --annotate {OUTPUT_DIR}/screenshots/{page-name}.png
agent-browser --session {SESSION} errors
agent-browser --session {SESSION} console
chrome-use --session {SESSION} snapshot -i
chrome-use --session {SESSION} screenshot --annotate {OUTPUT_DIR}/screenshots/{page-name}.png
chrome-use --session {SESSION} errors
chrome-use --session {SESSION} console
```
Use your judgment on how deep to go. Spend more time on core features and less on peripheral pages. If you find a cluster of issues in one area, investigate deeper.
@@ -124,17 +124,17 @@ These require user interaction to reproduce -- use full repro with video and ste
1. **Start a repro video** _before_ reproducing:
```bash
agent-browser --session {SESSION} record start {OUTPUT_DIR}/videos/issue-{NNN}-repro.webm
chrome-use --session {SESSION} record start {OUTPUT_DIR}/videos/issue-{NNN}-repro.webm
```
2. **Walk through the steps at human pace.** Pause 1-2 seconds between actions so the video is watchable. Take a screenshot at each step:
```bash
agent-browser --session {SESSION} screenshot {OUTPUT_DIR}/screenshots/issue-{NNN}-step-1.png
chrome-use --session {SESSION} screenshot {OUTPUT_DIR}/screenshots/issue-{NNN}-step-1.png
sleep 1
# Perform action (click, fill, etc.)
sleep 1
agent-browser --session {SESSION} screenshot {OUTPUT_DIR}/screenshots/issue-{NNN}-step-2.png
chrome-use --session {SESSION} screenshot {OUTPUT_DIR}/screenshots/issue-{NNN}-step-2.png
sleep 1
# ...continue until the issue manifests
```
@@ -143,13 +143,13 @@ sleep 1
```bash
sleep 2
agent-browser --session {SESSION} screenshot --annotate {OUTPUT_DIR}/screenshots/issue-{NNN}-result.png
chrome-use --session {SESSION} screenshot --annotate {OUTPUT_DIR}/screenshots/issue-{NNN}-result.png
```
4. **Stop the video:**
```bash
agent-browser --session {SESSION} record stop
chrome-use --session {SESSION} record stop
```
5. Write numbered repro steps in the report, each referencing its screenshot.
@@ -159,7 +159,7 @@ agent-browser --session {SESSION} record stop
These are visible without interaction -- a single annotated screenshot is sufficient. No video, no multi-step repro:
```bash
agent-browser --session {SESSION} screenshot --annotate {OUTPUT_DIR}/screenshots/issue-{NNN}.png
chrome-use --session {SESSION} screenshot --annotate {OUTPUT_DIR}/screenshots/issue-{NNN}.png
```
Write a brief description and reference the screenshot in the report. Set **Repro Video** to `N/A`.
@@ -182,7 +182,7 @@ After exploring:
2. Close the session:
```bash
agent-browser --session {SESSION} close
chrome-use --session {SESSION} close
```
3. Tell the user the report is ready and summarize findings: total issues, breakdown by severity, and the most critical items.
@@ -205,7 +205,7 @@ agent-browser --session {SESSION} close
- **Test like a user, not a robot.** Try common workflows end-to-end. Click things a real user would click. Enter realistic data.
- **Type like a human.** When filling form fields during video recording, use `type` instead of `fill` -- it types character-by-character. Use `fill` only outside of video recording when speed matters.
- **Pace repro videos for humans.** Add `sleep 1` between actions and `sleep 2` before the final result screenshot. Videos should be watchable at 1x speed -- a human reviewing the report needs to see what happened, not a blur of instant state changes.
- **Be efficient with commands.** Batch multiple `agent-browser` commands in a single shell call when they are independent (e.g., `agent-browser ... screenshot ... && agent-browser ... console`). Use `agent-browser --session {SESSION} scroll down 300` for scrolling -- do not use `key` or `evaluate` to scroll.
- **Be efficient with commands.** Batch multiple `chrome-use` commands in a single shell call when they are independent (e.g., `chrome-use ... screenshot ... && chrome-use ... console`). Use `chrome-use --session {SESSION} scroll down 300` for scrolling -- do not use `key` or `evaluate` to scroll.
## References
+50 -50
View File
@@ -1,17 +1,17 @@
---
name: electron
description: Automate Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify, etc.) using agent-browser via Chrome DevTools Protocol. Use when the user needs to interact with an Electron app, automate a desktop app, connect to a running app, control a native app, or test an Electron application. Triggers include "automate Slack app", "control VS Code", "interact with Discord app", "test this Electron app", "connect to desktop app", or any task requiring automation of a native Electron application.
allowed-tools: Bash(agent-browser:*), Bash(agent-browser-stealth:*), Bash(abs:*), Bash(npx agent-browser:*), Bash(npx agent-browser-stealth:*)
description: Automate Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify, etc.) using chrome-use via Chrome DevTools Protocol. Use when the user needs to interact with an Electron app, automate a desktop app, connect to a running app, control a native app, or test an Electron application. Triggers include "automate Slack app", "control VS Code", "interact with Discord app", "test this Electron app", "connect to desktop app", or any task requiring automation of a native Electron application.
allowed-tools: Bash(chrome-use:*), Bash(chrome-use:*), Bash(abs:*), Bash(npx chrome-use:*), Bash(npx chrome-use:*)
---
# Electron App Automation
Automate any Electron desktop app using agent-browser. Electron apps are built on Chromium and expose a Chrome DevTools Protocol (CDP) port that agent-browser can connect to, enabling the same snapshot-interact workflow used for web pages.
Automate any Electron desktop app using chrome-use. Electron apps are built on Chromium and expose a Chrome DevTools Protocol (CDP) port that chrome-use can connect to, enabling the same snapshot-interact workflow used for web pages.
## Core Workflow
1. **Launch** the Electron app with remote debugging enabled
2. **Connect** agent-browser to the CDP port
2. **Connect** chrome-use to the CDP port
3. **Snapshot** to discover interactive elements
4. **Interact** using element refs
5. **Re-snapshot** after navigation or state changes
@@ -20,13 +20,13 @@ Automate any Electron desktop app using agent-browser. Electron apps are built o
# Launch an Electron app with remote debugging
open -a "Slack" --args --remote-debugging-port=9222
# Connect agent-browser to the app
agent-browser connect 9222
# Connect chrome-use to the app
chrome-use connect 9222
# Standard workflow from here
agent-browser snapshot -i
agent-browser click @e5
agent-browser screenshot slack-desktop.png
chrome-use snapshot -i
chrome-use click @e5
chrome-use screenshot slack-desktop.png
```
## Launching Electron Apps with CDP
@@ -76,13 +76,13 @@ discord --remote-debugging-port=9224
```bash
# Connect to a specific port
agent-browser connect 9222
chrome-use connect 9222
# Or use --cdp on each command
agent-browser --cdp 9222 snapshot -i
chrome-use --cdp 9222 snapshot -i
# Auto-discover a running Chromium-based app
agent-browser --auto-connect snapshot -i
chrome-use --auto-connect snapshot -i
```
After `connect`, all subsequent commands target the connected app without needing `--cdp`.
@@ -93,13 +93,13 @@ Electron apps often have multiple windows or webviews. Use tab commands to list
```bash
# List all available targets (windows, webviews, etc.)
agent-browser tab
chrome-use tab
# Switch to a specific tab by id (t1, t2, …; integers not accepted)
agent-browser tab t2
chrome-use tab t2
# Switch by URL pattern
agent-browser tab --url "*settings*"
chrome-use tab --url "*settings*"
```
## Webview Support
@@ -108,21 +108,21 @@ Electron `<webview>` elements are automatically discovered and can be controlled
```bash
# Connect to running Electron app
agent-browser connect 9222
chrome-use connect 9222
# List targets -- webviews appear alongside pages
agent-browser tab
chrome-use tab
# Example output:
# 0: [page] Slack - Main Window https://app.slack.com/
# 1: [webview] Embedded Content https://example.com/widget
# Switch to a webview
agent-browser tab t1
chrome-use tab t1
# Interact with the webview normally
agent-browser snapshot -i
agent-browser click @e3
agent-browser screenshot webview.png
chrome-use snapshot -i
chrome-use click @e3
chrome-use screenshot webview.png
```
**Note:** Webview support works via raw CDP connection.
@@ -134,40 +134,40 @@ agent-browser screenshot webview.png
```bash
open -a "Slack" --args --remote-debugging-port=9222
sleep 3 # Wait for app to start
agent-browser connect 9222
agent-browser snapshot -i
chrome-use connect 9222
chrome-use snapshot -i
# Read the snapshot output to identify UI elements
agent-browser click @e10 # Navigate to a section
agent-browser snapshot -i # Re-snapshot after navigation
chrome-use click @e10 # Navigate to a section
chrome-use snapshot -i # Re-snapshot after navigation
```
### Take Screenshots of Desktop Apps
```bash
agent-browser connect 9222
agent-browser screenshot app-state.png
agent-browser screenshot --full full-app.png
agent-browser screenshot --annotate annotated-app.png
chrome-use connect 9222
chrome-use screenshot app-state.png
chrome-use screenshot --full full-app.png
chrome-use screenshot --annotate annotated-app.png
```
### Extract Data from a Desktop App
```bash
agent-browser connect 9222
agent-browser snapshot -i
agent-browser get text @e5
agent-browser snapshot --json > app-state.json
chrome-use connect 9222
chrome-use snapshot -i
chrome-use get text @e5
chrome-use snapshot --json > app-state.json
```
### Fill Forms in Desktop Apps
```bash
agent-browser connect 9222
agent-browser snapshot -i
agent-browser fill @e3 "search query"
agent-browser press Enter
agent-browser wait 1000
agent-browser snapshot -i
chrome-use connect 9222
chrome-use snapshot -i
chrome-use fill @e3 "search query"
chrome-use press Enter
chrome-use wait 1000
chrome-use snapshot -i
```
### Run Multiple Apps Simultaneously
@@ -176,14 +176,14 @@ Use named sessions to control multiple Electron apps at the same time:
```bash
# Connect to Slack
agent-browser --session slack connect 9222
chrome-use --session slack connect 9222
# Connect to VS Code
agent-browser --session vscode connect 9223
chrome-use --session vscode connect 9223
# Interact with each independently
agent-browser --session slack snapshot -i
agent-browser --session vscode snapshot -i
chrome-use --session slack snapshot -i
chrome-use --session vscode snapshot -i
```
## Color Scheme
@@ -191,14 +191,14 @@ agent-browser --session vscode snapshot -i
The default color scheme when connecting via CDP may be `light`. To preserve dark mode:
```bash
agent-browser connect 9222
agent-browser --color-scheme dark snapshot -i
chrome-use connect 9222
chrome-use --color-scheme dark snapshot -i
```
Or set it globally:
```bash
AGENT_BROWSER_COLOR_SCHEME=dark agent-browser connect 9222
AGENT_BROWSER_COLOR_SCHEME=dark chrome-use connect 9222
```
## Troubleshooting
@@ -216,12 +216,12 @@ AGENT_BROWSER_COLOR_SCHEME=dark agent-browser connect 9222
### Elements not appearing in snapshot
- The app may use multiple webviews. Use `agent-browser tab` to list targets and switch to the right one
- The app may use multiple webviews. Use `chrome-use tab` to list targets and switch to the right one
### Cannot type in input fields
- Try `agent-browser keyboard type "text"` to type at the current focus without a selector
- Some Electron apps use custom input components; use `agent-browser keyboard inserttext "text"` to bypass key events
- Try `chrome-use keyboard type "text"` to type at the current focus without a selector
- Some Electron apps use custom input components; use `chrome-use keyboard inserttext "text"` to bypass key events
## Supported Apps
@@ -233,4 +233,4 @@ Any app built on Electron works, including:
- **Media:** Spotify, Tidal
- **Productivity:** Todoist, Linear, 1Password
If an app is built with Electron, it supports `--remote-debugging-port` and can be automated with agent-browser.
If an app is built with Electron, it supports `--remote-debugging-port` and can be automated with chrome-use.
+62 -62
View File
@@ -1,7 +1,7 @@
---
name: slack
description: Interact with Slack workspaces using browser automation. Use when the user needs to check unread channels, navigate Slack, send messages, extract data, find information, search conversations, or automate any Slack task. Triggers include "check my Slack", "what channels have unreads", "send a message to", "search Slack for", "extract from Slack", "find who said", or any task requiring programmatic Slack interaction.
allowed-tools: Bash(agent-browser:*), Bash(agent-browser-stealth:*), Bash(abs:*), Bash(npx agent-browser:*), Bash(npx agent-browser-stealth:*)
allowed-tools: Bash(chrome-use:*), Bash(chrome-use:*), Bash(abs:*), Bash(npx chrome-use:*), Bash(npx chrome-use:*)
---
# Slack Automation
@@ -14,16 +14,16 @@ Connect to an existing Slack browser session or open Slack:
```bash
# Connect to existing session on port 9222 (typical for already-open Slack)
agent-browser connect 9222
chrome-use connect 9222
# Or open Slack if not already running
agent-browser open https://app.slack.com
chrome-use open https://app.slack.com
```
Then take a snapshot to see what's available:
```bash
agent-browser snapshot -i
chrome-use snapshot -i
```
## Core Workflow
@@ -36,11 +36,11 @@ agent-browser snapshot -i
```bash
# Example: Check unread channels
agent-browser connect 9222
agent-browser snapshot -i
chrome-use connect 9222
chrome-use snapshot -i
# Look for "More unreads" button
agent-browser click @e21 # Ref for "More unreads" button
agent-browser screenshot slack-unreads.png
chrome-use click @e21 # Ref for "More unreads" button
chrome-use screenshot slack-unreads.png
```
## Common Tasks
@@ -49,10 +49,10 @@ agent-browser screenshot slack-unreads.png
```bash
# Connect to Slack
agent-browser connect 9222
chrome-use connect 9222
# Take snapshot to locate unreads button
agent-browser snapshot -i
chrome-use snapshot -i
# Look for:
# - "More unreads" button (usually near top of sidebar)
@@ -60,50 +60,50 @@ agent-browser snapshot -i
# - Channel names with badges/bold text indicating unreads
# Navigate to Activity tab to see all unreads in one view
agent-browser click @e14 # Activity tab (ref may vary)
agent-browser wait 1000
agent-browser screenshot activity-unreads.png
chrome-use click @e14 # Activity tab (ref may vary)
chrome-use wait 1000
chrome-use screenshot activity-unreads.png
# Or check DMs tab
agent-browser click @e13 # DMs tab
agent-browser screenshot dms.png
chrome-use click @e13 # DMs tab
chrome-use screenshot dms.png
# Or expand "More unreads" in sidebar
agent-browser click @e21 # More unreads button
agent-browser wait 500
agent-browser screenshot expanded-unreads.png
chrome-use click @e21 # More unreads button
chrome-use wait 500
chrome-use screenshot expanded-unreads.png
```
### Navigating to a Channel
```bash
# Search for channel in sidebar or by name
agent-browser snapshot -i
chrome-use snapshot -i
# Look for channel name in the list (e.g., "engineering", "product-design")
# Click on the channel treeitem ref
agent-browser click @e94 # Example: engineering channel ref
agent-browser wait --load networkidle
agent-browser screenshot channel.png
chrome-use click @e94 # Example: engineering channel ref
chrome-use wait --load networkidle
chrome-use screenshot channel.png
```
### Finding Messages/Threads
```bash
# Use Slack search
agent-browser snapshot -i
agent-browser click @e5 # Search button (typical ref)
agent-browser fill @e_search "keyword"
agent-browser press Enter
agent-browser wait --load networkidle
agent-browser screenshot search-results.png
chrome-use snapshot -i
chrome-use click @e5 # Search button (typical ref)
chrome-use fill @e_search "keyword"
chrome-use press Enter
chrome-use wait --load networkidle
chrome-use screenshot search-results.png
```
### Extracting Channel Information
```bash
# Get list of all visible channels
agent-browser snapshot --json > slack-snapshot.json
chrome-use snapshot --json > slack-snapshot.json
# Parse for channel names and metadata
# Look for treeitem elements with level=2 (sub-channels under sections)
@@ -113,16 +113,16 @@ agent-browser snapshot --json > slack-snapshot.json
```bash
# Open a channel
agent-browser click @e_channel_ref
agent-browser wait 1000
chrome-use click @e_channel_ref
chrome-use wait 1000
# Get channel info (members, description, etc.)
agent-browser snapshot -i
agent-browser screenshot channel-details.png
chrome-use snapshot -i
chrome-use screenshot channel-details.png
# Scroll through messages
agent-browser scroll down 500
agent-browser screenshot channel-messages.png
chrome-use scroll down 500
chrome-use screenshot channel-messages.png
```
### Taking Notes/Capturing State
@@ -131,16 +131,16 @@ When you need to document findings from Slack:
```bash
# Take annotated screenshot (shows element numbers)
agent-browser screenshot --annotate slack-state.png
chrome-use screenshot --annotate slack-state.png
# Take full-page screenshot
agent-browser screenshot --full slack-full.png
chrome-use screenshot --full slack-full.png
# Get current URL for reference
agent-browser get url
chrome-use get url
# Get page title
agent-browser get title
chrome-use get title
```
## Sidebar Structure
@@ -185,14 +185,14 @@ Click tab refs to switch views and get different information.
```bash
# Get a message or element's text
agent-browser get text @e_message_ref
chrome-use get text @e_message_ref
```
### Parse Accessibility Tree
```bash
# Full snapshot as JSON for programmatic parsing
agent-browser snapshot --json > output.json
chrome-use snapshot --json > output.json
# Look for:
# - Channel names (name field in treeitem)
@@ -205,19 +205,19 @@ agent-browser snapshot --json > output.json
```bash
# After expanding unreads section:
agent-browser snapshot -i | grep -c "treeitem"
chrome-use snapshot -i | grep -c "treeitem"
# Each treeitem with a channel name in the unreads section is one unread
```
## Best Practices
- **Connect to existing sessions**: Use `agent-browser connect 9222` if Slack is already open. This is faster than opening a new browser.
- **Connect to existing sessions**: Use `chrome-use connect 9222` if Slack is already open. This is faster than opening a new browser.
- **Take snapshots before clicking**: Always `snapshot -i` to identify refs before clicking buttons.
- **Re-snapshot after navigation**: After navigating to a new channel or section, take a fresh snapshot to find new refs.
- **Use JSON snapshots for parsing**: When you need to extract structured data, use `snapshot --json` for machine-readable output.
- **Pace interactions**: Add `sleep 1` between rapid interactions to let the UI update.
- **Check accessibility tree**: The accessibility tree shows what screen readers (and your automation) can see. If an element isn't in the snapshot, it may be hidden or require scrolling.
- **Scroll in sidebar**: Use `agent-browser scroll down 300 --selector ".p-sidebar"` to scroll within the Slack sidebar if channel list is long.
- **Scroll in sidebar**: Use `chrome-use scroll down 300 --selector ".p-sidebar"` to scroll within the Slack sidebar if channel list is long.
## Limitations
@@ -234,16 +234,16 @@ Console/error capture is off by default in this stealth fork — launch the sess
`AGENT_BROWSER_CAPTURE_CONSOLE=1` first, or these return empty.
```bash
agent-browser console
agent-browser errors
chrome-use console
chrome-use errors
```
### Get current page state
```bash
agent-browser get url
agent-browser get title
agent-browser screenshot page-state.png
chrome-use get url
chrome-use get title
chrome-use screenshot page-state.png
```
## Example: Full Unread Check
@@ -252,29 +252,29 @@ agent-browser screenshot page-state.png
#!/bin/bash
# Connect to Slack
agent-browser connect 9222
chrome-use connect 9222
# Take initial snapshot
echo "=== Checking Slack unreads ==="
agent-browser snapshot -i > snapshot.txt
chrome-use snapshot -i > snapshot.txt
# Check Activity tab for unreads
agent-browser click @e14 # Activity tab
agent-browser wait 1000
agent-browser screenshot activity.png
ACTIVITY_RESULT=$(agent-browser get text @e_main_area)
chrome-use click @e14 # Activity tab
chrome-use wait 1000
chrome-use screenshot activity.png
ACTIVITY_RESULT=$(chrome-use get text @e_main_area)
echo "Activity: $ACTIVITY_RESULT"
# Check DMs
agent-browser click @e13 # DMs tab
agent-browser wait 1000
agent-browser screenshot dms.png
chrome-use click @e13 # DMs tab
chrome-use wait 1000
chrome-use screenshot dms.png
# Check unread channels in sidebar
agent-browser click @e21 # More unreads button
agent-browser wait 500
agent-browser snapshot -i > unreads-expanded.txt
agent-browser screenshot unreads.png
chrome-use click @e21 # More unreads button
chrome-use wait 500
chrome-use snapshot -i > unreads-expanded.txt
chrome-use screenshot unreads.png
# Summary
echo "=== Summary ==="
+54 -54
View File
@@ -11,16 +11,16 @@ Determine which channels and DMs have unread messages.
1. **Connect to Slack**
```bash
agent-browser connect 9222
chrome-use connect 9222
```
2. **Check Activity Tab**
- Take snapshot: `agent-browser snapshot -i`
- Take snapshot: `chrome-use snapshot -i`
- Look for Activity tab ref (usually `@e14`)
- Click: `agent-browser click @e14`
- Wait: `agent-browser wait 1000`
- Click: `chrome-use click @e14`
- Wait: `chrome-use wait 1000`
- If you see "You've read all the unreads", you have no unread messages
- Screenshot: `agent-browser screenshot activity.png`
- Screenshot: `chrome-use screenshot activity.png`
3. **Check DMs**
- Click DMs tab ref (usually `@e13`)
@@ -52,25 +52,25 @@ Get a complete list of all channels you have access to.
1. **Navigate to Channels section**
```bash
agent-browser connect 9222
agent-browser snapshot -i
chrome-use connect 9222
chrome-use snapshot -i
```
2. **Look for "Channels" treeitem**
- This is usually a collapsed section header
- Click to expand if collapsed
- Screenshot: `agent-browser screenshot all-channels.png`
- Screenshot: `chrome-use screenshot all-channels.png`
3. **Scroll through sidebar**
```bash
# If the list is long, scroll within the sidebar
agent-browser scroll down 500 --selector ".p-sidebar"
agent-browser screenshot channels-page-2.png
chrome-use scroll down 500 --selector ".p-sidebar"
chrome-use screenshot channels-page-2.png
```
4. **Parse snapshot for channel list**
```bash
agent-browser snapshot --json > channels.json
chrome-use snapshot --json > channels.json
# Search JSON for treeitem elements with level=2 under "Channels" section
```
@@ -90,24 +90,24 @@ Find all messages/threads mentioning specific terms.
1. **Open search**
```bash
agent-browser snapshot -i
chrome-use snapshot -i
# Find Search button ref (usually @e5)
agent-browser click @e5
agent-browser wait 500
chrome-use click @e5
chrome-use wait 500
```
2. **Enter search term**
```bash
# Identify search input ref from snapshot
agent-browser fill @e_search_input "your keyword"
agent-browser press Enter
agent-browser wait --load networkidle
chrome-use fill @e_search_input "your keyword"
chrome-use press Enter
chrome-use wait --load networkidle
```
3. **Capture results**
```bash
agent-browser screenshot search-results.png
agent-browser snapshot -i > search-snapshot.txt
chrome-use screenshot search-results.png
chrome-use snapshot -i > search-snapshot.txt
```
4. **Parse results**
@@ -137,35 +137,35 @@ Watch a channel and capture new messages/engagement.
1. **Navigate to channel**
```bash
agent-browser connect 9222
agent-browser snapshot -i
chrome-use connect 9222
chrome-use snapshot -i
# Find channel ref from sidebar
agent-browser click @e_channel_ref
agent-browser wait --load networkidle
chrome-use click @e_channel_ref
chrome-use wait --load networkidle
```
2. **Check channel info**
- Screenshot channel details: `agent-browser screenshot channel-header.png`
- Screenshot channel details: `chrome-use screenshot channel-header.png`
- Look for member count, description, topic
3. **View messages**
```bash
# Jump to recent/unread
agent-browser press j # Jump to unread in Slack
agent-browser wait 500
agent-browser screenshot recent-messages.png
chrome-use press j # Jump to unread in Slack
chrome-use wait 500
chrome-use screenshot recent-messages.png
```
4. **Scroll to see more**
```bash
agent-browser scroll down 500
agent-browser screenshot more-messages.png
chrome-use scroll down 500
chrome-use screenshot more-messages.png
```
5. **Check threads**
- Click on messages with thread indicators
- View replies in thread view
- Screenshot: `agent-browser screenshot thread.png`
- Screenshot: `chrome-use screenshot thread.png`
### Evidence
- Channel info screenshot
@@ -183,13 +183,13 @@ Find who said what, when, and in what context.
1. **Navigate to relevant channel or DM**
```bash
agent-browser click @e_conversation_ref
agent-browser wait 1000
chrome-use click @e_conversation_ref
chrome-use wait 1000
```
2. **Take snapshot with context**
```bash
agent-browser snapshot --json > conversation.json
chrome-use snapshot --json > conversation.json
```
3. **Find message blocks**
@@ -204,8 +204,8 @@ Find who said what, when, and in what context.
5. **Screenshot key messages**
```bash
agent-browser screenshot important-message.png
agent-browser screenshot --annotate annotated-message.png
chrome-use screenshot important-message.png
chrome-use screenshot --annotate annotated-message.png
```
---
@@ -219,19 +219,19 @@ See who reacted to a message and with what emoji.
1. **Find message with reactions**
```bash
agent-browser snapshot -i
chrome-use snapshot -i
# Look for "N reaction(s)" buttons in messages
```
2. **Click reaction button to expand**
```bash
agent-browser click @e_reaction_button
agent-browser wait 500
chrome-use click @e_reaction_button
chrome-use wait 500
```
3. **Capture reaction details**
```bash
agent-browser screenshot reactions.png
chrome-use screenshot reactions.png
# You'll see emoji, count, and list of users who reacted
```
@@ -251,26 +251,26 @@ See messages that have been pinned in a channel.
1. **Open a channel**
```bash
agent-browser click @e_channel_ref
agent-browser wait 1000
agent-browser snapshot -i
chrome-use click @e_channel_ref
chrome-use wait 1000
chrome-use snapshot -i
```
2. **Click Pins tab**
- In channel view, look for "Pins" tab ref (usually near Messages, Files tabs)
- Click it: `agent-browser click @e_pins_tab`
- Wait: `agent-browser wait 500`
- Click it: `chrome-use click @e_pins_tab`
- Wait: `chrome-use wait 500`
3. **View pinned messages**
```bash
agent-browser screenshot pins.png
agent-browser snapshot -i > pins-snapshot.txt
chrome-use screenshot pins.png
chrome-use snapshot -i > pins-snapshot.txt
```
4. **Review each pin**
- Click pin to see context
- Note who pinned it, when, and why
- Screenshot: `agent-browser screenshot pin-detail.png`
- Screenshot: `chrome-use screenshot pin-detail.png`
---
@@ -323,26 +323,26 @@ If you can't find an element:
1. **Check it's visible**
```bash
# Is the element on screen or off-screen?
agent-browser screenshot current-state.png
chrome-use screenshot current-state.png
# Compare screenshot to what you expected
```
2. **Try expanding/scrolling**
```bash
# Sidebar might need scrolling
agent-browser scroll down 300 --selector ".p-sidebar"
agent-browser snapshot -i
chrome-use scroll down 300 --selector ".p-sidebar"
chrome-use snapshot -i
```
3. **Check current URL**
```bash
agent-browser get url
chrome-use get url
# Verify you're in the right section
```
4. **Wait for page to load**
```bash
agent-browser wait --load networkidle
agent-browser wait 1000
agent-browser snapshot -i
chrome-use wait --load networkidle
chrome-use wait 1000
chrome-use snapshot -i
```
+30 -30
View File
@@ -1,11 +1,11 @@
---
name: vercel-sandbox
description: Run agent-browser + Chrome inside Vercel Sandbox microVMs for browser automation from any Vercel-deployed app. Use when the user needs browser automation in a Vercel app (Next.js, SvelteKit, Nuxt, Remix, Astro, etc.), wants to run headless Chrome without binary size limits, needs persistent browser sessions across commands, or wants ephemeral isolated browser environments. Triggers include "Vercel Sandbox browser", "microVM Chrome", "agent-browser in sandbox", "browser automation on Vercel", or any task requiring Chrome in a Vercel Sandbox.
description: Run chrome-use + Chrome inside Vercel Sandbox microVMs for browser automation from any Vercel-deployed app. Use when the user needs browser automation in a Vercel app (Next.js, SvelteKit, Nuxt, Remix, Astro, etc.), wants to run headless Chrome without binary size limits, needs persistent browser sessions across commands, or wants ephemeral isolated browser environments. Triggers include "Vercel Sandbox browser", "microVM Chrome", "chrome-use in sandbox", "browser automation on Vercel", or any task requiring Chrome in a Vercel Sandbox.
---
# Browser Automation with Vercel Sandbox
Run agent-browser + headless Chrome inside ephemeral Vercel Sandbox microVMs. A Linux VM spins up on demand, executes browser commands, and shuts down. Works with any Vercel-deployed framework (Next.js, SvelteKit, Nuxt, Remix, Astro, etc.).
Run chrome-use + headless Chrome inside ephemeral Vercel Sandbox microVMs. A Linux VM spins up on demand, executes browser commands, and shuts down. Works with any Vercel-deployed framework (Next.js, SvelteKit, Nuxt, Remix, Astro, etc.).
## Dependencies
@@ -13,7 +13,7 @@ Run agent-browser + headless Chrome inside ephemeral Vercel Sandbox microVMs. A
pnpm add @vercel/sandbox
```
The sandbox VM needs system dependencies for Chromium plus agent-browser itself. Use sandbox snapshots (below) to pre-install everything for sub-second startup.
The sandbox VM needs system dependencies for Chromium plus chrome-use itself. Use sandbox snapshots (below) to pre-install everything for sub-second startup.
## Core Pattern
@@ -63,8 +63,8 @@ async function withBrowser<T>(
"-c",
`sudo dnf clean all 2>&1 && sudo dnf install -y --skip-broken ${CHROMIUM_SYSTEM_DEPS.join(" ")} 2>&1 && sudo ldconfig 2>&1`,
]);
await sandbox.runCommand("npm", ["install", "-g", "agent-browser"]);
await sandbox.runCommand("npx", ["agent-browser", "install"]);
await sandbox.runCommand("npm", ["install", "-g", "chrome-use"]);
await sandbox.runCommand("npx", ["chrome-use", "install"]);
}
try {
@@ -82,21 +82,21 @@ The `screenshot --json` command saves to a file and returns the path. Read the f
```ts
export async function screenshotUrl(url: string) {
return withBrowser(async (sandbox) => {
await sandbox.runCommand("agent-browser", ["open", url]);
await sandbox.runCommand("chrome-use", ["open", url]);
const titleResult = await sandbox.runCommand("agent-browser", [
const titleResult = await sandbox.runCommand("chrome-use", [
"get", "title", "--json",
]);
const title = JSON.parse(await titleResult.stdout())?.data?.title || url;
const ssResult = await sandbox.runCommand("agent-browser", [
const ssResult = await sandbox.runCommand("chrome-use", [
"screenshot", "--json",
]);
const ssPath = JSON.parse(await ssResult.stdout())?.data?.path;
const b64Result = await sandbox.runCommand("base64", ["-w", "0", ssPath]);
const screenshot = (await b64Result.stdout()).trim();
await sandbox.runCommand("agent-browser", ["close"]);
await sandbox.runCommand("chrome-use", ["close"]);
return { title, screenshot };
});
@@ -108,19 +108,19 @@ export async function screenshotUrl(url: string) {
```ts
export async function snapshotUrl(url: string) {
return withBrowser(async (sandbox) => {
await sandbox.runCommand("agent-browser", ["open", url]);
await sandbox.runCommand("chrome-use", ["open", url]);
const titleResult = await sandbox.runCommand("agent-browser", [
const titleResult = await sandbox.runCommand("chrome-use", [
"get", "title", "--json",
]);
const title = JSON.parse(await titleResult.stdout())?.data?.title || url;
const snapResult = await sandbox.runCommand("agent-browser", [
const snapResult = await sandbox.runCommand("chrome-use", [
"snapshot", "-i", "-c",
]);
const snapshot = await snapResult.stdout();
await sandbox.runCommand("agent-browser", ["close"]);
await sandbox.runCommand("chrome-use", ["close"]);
return { title, snapshot };
});
@@ -134,29 +134,29 @@ The sandbox persists between commands, so you can run full automation sequences:
```ts
export async function fillAndSubmitForm(url: string, data: Record<string, string>) {
return withBrowser(async (sandbox) => {
await sandbox.runCommand("agent-browser", ["open", url]);
await sandbox.runCommand("chrome-use", ["open", url]);
const snapResult = await sandbox.runCommand("agent-browser", [
const snapResult = await sandbox.runCommand("chrome-use", [
"snapshot", "-i",
]);
const snapshot = await snapResult.stdout();
// Parse snapshot to find element refs...
for (const [ref, value] of Object.entries(data)) {
await sandbox.runCommand("agent-browser", ["fill", ref, value]);
await sandbox.runCommand("chrome-use", ["fill", ref, value]);
}
await sandbox.runCommand("agent-browser", ["click", "@e5"]);
await sandbox.runCommand("agent-browser", ["wait", "--load", "networkidle"]);
await sandbox.runCommand("chrome-use", ["click", "@e5"]);
await sandbox.runCommand("chrome-use", ["wait", "--load", "networkidle"]);
const ssResult = await sandbox.runCommand("agent-browser", [
const ssResult = await sandbox.runCommand("chrome-use", [
"screenshot", "--json",
]);
const ssPath = JSON.parse(await ssResult.stdout())?.data?.path;
const b64Result = await sandbox.runCommand("base64", ["-w", "0", ssPath]);
const screenshot = (await b64Result.stdout()).trim();
await sandbox.runCommand("agent-browser", ["close"]);
await sandbox.runCommand("chrome-use", ["close"]);
return { screenshot };
});
@@ -165,15 +165,15 @@ export async function fillAndSubmitForm(url: string, data: Record<string, string
## Sandbox Snapshots (Fast Startup)
A **sandbox snapshot** is a saved VM image of a Vercel Sandbox with system dependencies + agent-browser + Chromium already installed. Think of it like a Docker image -- instead of installing dependencies from scratch every time, the sandbox boots from the pre-built image.
A **sandbox snapshot** is a saved VM image of a Vercel Sandbox with system dependencies + chrome-use + Chromium already installed. Think of it like a Docker image -- instead of installing dependencies from scratch every time, the sandbox boots from the pre-built image.
This is unrelated to agent-browser's *accessibility snapshot* feature (`agent-browser snapshot`), which dumps a page's accessibility tree. A sandbox snapshot is a Vercel infrastructure concept for fast VM startup.
This is unrelated to chrome-use's *accessibility snapshot* feature (`chrome-use snapshot`), which dumps a page's accessibility tree. A sandbox snapshot is a Vercel infrastructure concept for fast VM startup.
Without a sandbox snapshot, each run installs system deps + agent-browser + Chromium (~30s). With one, startup is sub-second.
Without a sandbox snapshot, each run installs system deps + chrome-use + Chromium (~30s). With one, startup is sub-second.
### Creating a sandbox snapshot
The snapshot must include system dependencies (via `dnf`), agent-browser, and Chromium:
The snapshot must include system dependencies (via `dnf`), chrome-use, and Chromium:
```ts
import { Sandbox } from "@vercel/sandbox";
@@ -196,8 +196,8 @@ async function createSnapshot(): Promise<string> {
"-c",
`sudo dnf clean all 2>&1 && sudo dnf install -y --skip-broken ${CHROMIUM_SYSTEM_DEPS.join(" ")} 2>&1 && sudo ldconfig 2>&1`,
]);
await sandbox.runCommand("npm", ["install", "-g", "agent-browser"]);
await sandbox.runCommand("npx", ["agent-browser", "install"]);
await sandbox.runCommand("npm", ["install", "-g", "chrome-use"]);
await sandbox.runCommand("npx", ["chrome-use", "install"]);
const snapshot = await sandbox.snapshot();
return snapshot.snapshotId;
@@ -238,9 +238,9 @@ Combine with Vercel Cron Jobs for recurring browser tasks:
// app/api/cron/route.ts (or equivalent in your framework)
export async function GET() {
const result = await withBrowser(async (sandbox) => {
await sandbox.runCommand("agent-browser", ["open", "https://example.com/pricing"]);
const snap = await sandbox.runCommand("agent-browser", ["snapshot", "-i", "-c"]);
await sandbox.runCommand("agent-browser", ["close"]);
await sandbox.runCommand("chrome-use", ["open", "https://example.com/pricing"]);
const snap = await sandbox.runCommand("chrome-use", ["snapshot", "-i", "-c"]);
await sandbox.runCommand("chrome-use", ["close"]);
return await snap.stdout();
});
@@ -277,4 +277,4 @@ The pattern works identically across frameworks. The only difference is where yo
## Example
See `examples/environments/` in the agent-browser repo for a working app with the Vercel Sandbox pattern, including a sandbox snapshot creation script, streaming progress UI, and rate limiting.
See `examples/environments/` in the chrome-use repo for a working app with the Vercel Sandbox pattern, including a sandbox snapshot creation script, streaming progress UI, and rate limiting.