Skip to main content

Overview

Interaction commands allow you to simulate user interactions with page elements.

Mouse Interactions

click

Click an element.
ParameterDescription
selectorCSS selector, ref (@e1), or text locator
Options:
OptionDescription
—new-tabOpen link in new tab
Examples:
# Click by ref
agent-browser click @e2

# Click by CSS selector
agent-browser click "#submit-button"

# Click by text
agent-browser click "text=Sign In"

# Click and open in new tab
agent-browser click @e5 --new-tab

dblclick

Double-click an element.
ParameterDescription
selectorElement selector
Examples:
agent-browser dblclick @e3
agent-browser dblclick ".file-name"

hover

Hover over an element.
ParameterDescription
selectorElement selector
Examples:
agent-browser hover @e4
agent-browser hover ".dropdown-trigger"

focus

Focus an element.
ParameterDescription
selectorElement selector
Examples:
agent-browser focus @e1
agent-browser focus "#email-input"

Text Input

fill

Clear and fill an input field.
ParameterDescription
selectorInput element selector
textText to fill (multiple words joined with spaces)
Examples:
# Fill by ref
agent-browser fill @e3 "test@example.com"

# Fill by selector
agent-browser fill "#email" "user@domain.com"

# Fill with multiple words
agent-browser fill @e2 "John Doe"

type

Type text into an element (without clearing).
ParameterDescription
selectorInput element selector
textText to type
Examples:
agent-browser type @e1 "additional text"
agent-browser type "#search" "query"

press

Press a keyboard key.
ParameterDescription
keyKey name (Enter, Tab, Escape) or key combination (Control+a)
Alias: key Examples:
# Press Enter
agent-browser press Enter

# Press Tab
agent-browser press Tab

# Keyboard shortcuts
agent-browser press Control+a
agent-browser press Meta+v

keyboard type

Type text with real keystrokes (current focus).
ParameterDescription
textText to type
Examples:
agent-browser keyboard type "Hello World"

keyboard inserttext

Insert text without key events (current focus).
ParameterDescription
textText to insert
Examples:
agent-browser keyboard inserttext "pasted content"

Form Controls

check

Check a checkbox.
ParameterDescription
selectorCheckbox selector
Examples:
agent-browser check @e5
agent-browser check "#agree-terms"

uncheck

Uncheck a checkbox.
ParameterDescription
selectorCheckbox selector
Examples:
agent-browser uncheck @e6
agent-browser uncheck "#newsletter"

select

Select dropdown option(s).
ParameterDescription
selectorSelect element selector
valueOption value(s) to select
Examples:
# Select single option
agent-browser select @e4 "option1"

# Select multiple options
agent-browser select "#country" "US" "CA"

Scrolling

scroll

Scroll the page or an element.
ParameterDescription
directionDirection: up, down, left, right (default: down)
amountPixels to scroll (default: 300)
Options:
OptionDescription
-s, —selectorScroll specific element instead of page
Examples:
# Scroll down 300px (default)
agent-browser scroll

# Scroll down 500px
agent-browser scroll down 500

# Scroll up
agent-browser scroll up

# Scroll specific element
agent-browser scroll down 200 --selector "#content"

scrollintoview

Scroll element into view.
ParameterDescription
selectorElement selector
Alias: scrollinto Examples:
agent-browser scrollintoview @e10
agent-browser scrollinto "#footer"

Drag and Drop

drag

Drag an element to another element.
ParameterDescription
sourceSource element selector
targetTarget element selector
Examples:
agent-browser drag @e1 @e2
agent-browser drag ".draggable" ".drop-zone"

File Upload

upload

Upload file(s) to an input element.
ParameterDescription
selectorFile input selector
filesFile path(s) to upload
Examples:
# Upload single file
agent-browser upload @e7 "/path/to/file.pdf"

# Upload multiple files
agent-browser upload "#file-input" "/path/to/file1.jpg" "/path/to/file2.jpg"

Workflow Examples

Login Form

agent-browser open example.com/login
agent-browser fill @e1 "user@example.com"
agent-browser fill @e2 "password123"
agent-browser check @e3  # Remember me
agent-browser click @e4  # Submit button

Search and Navigate

agent-browser open example.com
agent-browser fill @e1 "search query"
agent-browser press Enter
agent-browser wait --load networkidle
agent-browser click @e5  # First result

Form with Dropdowns

agent-browser fill @e1 "John Doe"
agent-browser select @e2 "United States"
agent-browser check @e3
agent-browser upload @e4 "/path/to/resume.pdf"
agent-browser click @e5

Build docs developers (and LLMs) love