Commands

Complete reference for all AGENT BROWSER commands. All commands operate on the active browser session unless otherwise noted.

Core navigation

Navigation & interaction
agent-browser open                    # Launch browser (no navigation)
agent-browser open <url>              # Launch + navigate to URL
agent-browser read [url]              # Fetch agent-readable text
agent-browser click <sel>             # Click element
agent-browser dblclick <sel>          # Double-click element
agent-browser focus <sel>             # Focus element
agent-browser type <sel> <text>       # Type into element
agent-browser fill <sel> <text>       # Clear and fill
agent-browser press <key>             # Press key (Enter, Tab, Control+a)
agent-browser hover <sel>             # Hover over element
agent-browser select <sel> <value>    # Select dropdown option
agent-browser check <sel>             # Check checkbox/radio
agent-browser uncheck <sel>           # Uncheck checkbox
agent-browser scroll <sel> <dir>      # Scroll element (up/down/left/right)
agent-browser drag <src> <dest>       # Drag and drop

Capturing state

Capture & control
agent-browser screenshot [path]       # Screenshot viewport (PNG)
agent-browser screenshot --full       # Full-page screenshot
agent-browser pdf <path>              # Save page as PDF
agent-browser snapshot                # Accessibility tree with refs
agent-browser snapshot -i             # Interactive compact snapshot
agent-browser eval <js>               # Run JavaScript
agent-browser connect <port|url>      # Connect to browser via CDP
agent-browser stream enable           # Start runtime WebSocket streaming
agent-browser stream status           # Show streaming state
agent-browser stream disable          # Stop streaming
agent-browser close                   # Close browser
agent-browser close --all             # Close all active sessions
agent-browser mcp                     # Start MCP stdio server

Get info

Get information
agent-browser get text <sel>          # Get text content
agent-browser get html <sel>          # Get innerHTML
agent-browser get value <sel>         # Get input value
agent-browser get attr <sel> <attr>   # 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 <sel>         # Count matching elements
agent-browser get box <sel>           # Get bounding box
agent-browser get styles <sel>        # Get computed styles

Read agent-friendly text

Read command options
agent-browser read
agent-browser read https://example.com/article
agent-browser read https://example.com/article --filter overview
agent-browser read https://example.com/article --outline
agent-browser read https://docs.example.com --llms index --filter auth
agent-browser read https://docs.example.com --llms full --filter auth
agent-browser read example.com/article --require-md
agent-browser read https://example.com/article --json

Check state

State checks
agent-browser is visible <sel>        # Check if visible
agent-browser is enabled <sel>        # Check if enabled
agent-browser is checked <sel>        # Check if checked

Find elements (semantic locators)

Semantic element finders
agent-browser find role <role> <action> [value]       # By ARIA role
agent-browser find text <text> <action>               # By text content
agent-browser find label <label> <action> [value]     # By label
agent-browser find placeholder <ph> <action> [value]  # By placeholder
agent-browser find alt <text> <action>                # By alt text
agent-browser find title <text> <action>              # By title attr
agent-browser find testid <id> <action> [value]       # By data-testid
agent-browser find first <sel> <action> [value]       # First match

Network

Network control
agent-browser network block <pattern>       # Block URL pattern
agent-browser network unblock <pattern>     # Unblock URL pattern
agent-browser network unblock --all         # Remove all blocks
agent-browser network throttle slow-3g      # Throttle network
agent-browser network throttle --reset      # Remove throttle

Storage

Storage commands
agent-browser storage get local <key>       # Get localStorage value
agent-browser storage set local <key> <val> # Set localStorage value
agent-browser storage remove local <key>    # Remove localStorage key
agent-browser storage clear local          # Clear all localStorage
agent-browser storage get session <key>    # Same for sessionStorage
agent-browser storage get cookie <name>    # Get cookie value
agent-browser storage set cookie <n> <v>   # Set cookie
agent-browser storage remove cookie <name> # Delete cookie

Tabs

Tab management
agent-browser tab list                  # List open tabs
agent-browser tab new [url]             # Open new tab
agent-browser tab switch <index|title>  # Switch active tab
agent-browser tab close [index]         # Close a tab

Selectors

All commands accept the following selector formats:

FormatExampleNotes
Ref@e1From snapshot. Preferred for agents.
CSS selector#submitStandard CSS. Works with any valid selector.
XPath//button[@type='submit']Full XPath support.
Texttext=SubmitMatches by visible text content.

Next: Configuration