Now inviting automation leaders: publish your playbook as a skill, under your own name. Publish yours →
Automation Skills
All skills/Browser mate/Agent-browser
Reference · Browser mate

Agent-browser

Part of Browser mate. Install the skill and your agent reads this page when it needs the depth.

Driving a browser-mate instance with agent-browser

browser-mate only launches/reuses the debug Chrome; interaction is via the agent-browser CLI against the printed port. Pass --cdp <port> on EVERY call.

PORT=$(python3 scripts/browser.py chatgpt)   # ensure up, capture port
SID=$(LC_ALL=C tr -dc 'a-z0-9' < /dev/urandom | head -c 6)   # unique session id

agent-browser --cdp $PORT --session $SID snapshot -i        # interactive snapshot (refs)
agent-browser --cdp $PORT --session $SID open "https://chatgpt.com/"
agent-browser --cdp $PORT --session $SID click @e3
agent-browser --cdp $PORT --session $SID fill @e5 "text"
agent-browser --cdp $PORT --session $SID screenshot /tmp/page.png
agent-browser --cdp $PORT --session $SID eval 'navigator.webdriver'   # expect false/undefined

File upload — hidden <input type=file> (no native dialog)

upload takes a CSS selector or @ref and sets the file via CDP — it does NOT open the OS file picker and works on HIDDEN inputs. Do NOT click the visible "attach"/"+" button (that opens a native dialog you can't drive).

agent-browser --cdp $PORT --session $SID upload "input[type=file]" /abs/file.zip

Pick the right input when there are several: the general attachment input has accept="*" (image-only ones have accept="image/*"). Verify after: eval 'document.body.innerText.includes("file.zip")'.

Text entry — textarea vs contenteditable

Recipe: drive ChatGPT (file + prompt + model) — works first try

  1. open "https://chatgpt.com/"; confirm a composer (#prompt-textarea) exists (logged in).
  2. CHECK THE MODEL FIRST — before touching anything. It is usually already what you want; don't open the switcher unless you must change it. Read the composer model pill (+ ⏱ Pro ⌄), NOT the switcher button (its innerText is just the brand "ChatGPT").
    • To change: click "[data-testid=\"model-switcher-dropdown-button\"]"; the menu is a PORTAL — read [data-radix-popper-content-wrapper] (e.g. "Latest 5.5", "Thinking", "Pro"), click the target, then verify.
  3. upload "input[type=file]" /abs/file (the accept="*" input); verify filename in body.
  4. click "#prompt-textarea" then type "<prompt>" (contenteditable — see above).
  5. click "[data-testid=\"send-button\"]". Generating == [data-testid=\"stop-button\"] present.
  6. Wait until the stop-button disappears, then read the last [data-message-author-role=\"assistant\"] element's innerText.

Reliability

Cleanup

Publish your skill

Copy this prompt into Claude Code, Codex or any agent. It walks you through your first skill in about 20 minutes, with you as the author.

Click to copy.