agentchrome 1.62.0

A CLI tool for browser automation via the Chrome DevTools Protocol
Documentation
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.TH interact 1  "interact "
.SH NAME
interact \- Mouse, keyboard, and scroll interactions
.SH SYNOPSIS
\fBinteract\fR [\fB\-\-frame\fR] [\fB\-h\fR|\fB\-\-help\fR] <\fIsubcommands\fR>
.SH DESCRIPTION
Simulate user interactions: click elements, type text, press key combinations, scroll the page, hover over elements, and perform drag\-and\-drop operations. Target elements by UID (from \*(Aqpage snapshot\*(Aq) or CSS selector (prefixed with \*(Aqcss:\*(Aq).
.SH OPTIONS
.TP
\fB\-\-frame\fR \fI<FRAME>\fR
Target frame by index, path (1/0), or \*(Aqauto\*(Aq
.TP
\fB\-h\fR, \fB\-\-help\fR
Print help (see a summary with \*(Aq\-h\*(Aq)
.SH SUBCOMMANDS
.TP
interact\-click(1)
Click an element by UID or CSS selector
.TP
interact\-click\-at(1)
Click at viewport coordinates
.TP
interact\-hover(1)
Hover over an element
.TP
interact\-drag(1)
Drag from one element to another
.TP
interact\-drag\-at(1)
Drag from coordinates to coordinates
.TP
interact\-mousedown\-at(1)
Press mouse button at coordinates (no release)
.TP
interact\-mouseup\-at(1)
Release mouse button at coordinates
.TP
interact\-type(1)
Type text character\-by\-character into the focused element
.TP
interact\-key(1)
Press a key or key combination (e.g. Enter, Control+A)
.TP
interact\-scroll(1)
Scroll the page or a container element
.TP
interact\-help(1)
Print this message or the help of the given subcommand(s)
.SH EXTRA
EXAMPLES:
  # Click an element by UID
  agentchrome interact click s5

  # Click by CSS selector
  agentchrome interact click css:#submit\-btn

  # Type text into the focused element
  agentchrome interact type "Hello, world!"

  # Press a key combination
  agentchrome interact key Control+A

  # Scroll down one viewport height
  agentchrome interact scroll
.SH CAPABILITIES
.PP
Mouse, keyboard, and scroll interactions
.TP
.B interact click
Click an element by UID or CSS selector
.TP
.B target
Target element (UID like 's1' or CSS selector like 'css:#button')
.TP
.B --double
Perform a double-click instead of single click (conflicts with --right)
.TP
.B --right
Perform a right-click (context menu) instead of left click (conflicts with --double)
.TP
.B --include-snapshot
Include updated accessibility snapshot in output
.TP
.B --compact
Use compact mode for the included snapshot (only interactive and landmark elements)
.TP
.B --wait-until
Wait strategy after click (e.g., for SPA navigation). If omitted, click returns immediately with a brief navigation check
.TP
.B interact click-at
Click at viewport coordinates
.TP
.B x
X coordinate: absolute pixels (e.g., 100) or percentage (e.g., 50%) when --relative-to is set
.TP
.B y
Y coordinate: absolute pixels (e.g., 200) or percentage (e.g., 50%) when --relative-to is set
.TP
.B --relative-to
Resolve X/Y as offsets or percentages relative to this element's top-left corner. Accepts a UID (e.g., s7) or CSS selector (e.g., css:#submit)
.TP
.B --double
Perform a double-click instead of single click (conflicts with --right)
.TP
.B --right
Perform a right-click (context menu) instead of left click (conflicts with --double)
.TP
.B --include-snapshot
Include updated accessibility snapshot in output
.TP
.B --compact
Use compact mode for the included snapshot (only interactive and landmark elements)
.TP
.B --wait-until
Wait strategy after click (e.g., for SPA navigation). If omitted, click returns immediately after dispatching
.TP
.B interact hover
Hover over an element
.TP
.B target
Target element (UID like 's1' or CSS selector like 'css:#button')
.TP
.B --include-snapshot
Include updated accessibility snapshot in output
.TP
.B --compact
Use compact mode for the included snapshot (only interactive and landmark elements)
.TP
.B interact drag
Drag from one element to another
.TP
.B from
Source element to drag from (UID or CSS selector)
.TP
.B to
Target element to drag to (UID or CSS selector)
.TP
.B --include-snapshot
Include updated accessibility snapshot in output
.TP
.B --compact
Use compact mode for the included snapshot (only interactive and landmark elements)
.TP
.B interact drag-at
Drag from coordinates to coordinates
.TP
.B from_x
Source X coordinate: absolute pixels or percentage (e.g., 50%) when --relative-to is set
.TP
.B from_y
Source Y coordinate: absolute pixels or percentage (e.g., 50%) when --relative-to is set
.TP
.B to_x
Target X coordinate: absolute pixels or percentage (e.g., 100%) when --relative-to is set
.TP
.B to_y
Target Y coordinate: absolute pixels or percentage (e.g., 100%) when --relative-to is set
.TP
.B --relative-to
Resolve from/to coordinates as offsets or percentages relative to this element. Accepts a UID (e.g., s7) or CSS selector (e.g., css:#submit)
.TP
.B --steps
Number of intermediate mousemove steps for interpolated drag movement
.TP
.B --include-snapshot
Include updated accessibility snapshot in output
.TP
.B --compact
Use compact mode for the included snapshot (only interactive and landmark elements)
.TP
.B interact mousedown-at
Press mouse button at coordinates (no release)
.TP
.B x
X coordinate: absolute pixels or percentage (e.g., 50%) when --relative-to is set
.TP
.B y
Y coordinate: absolute pixels or percentage (e.g., 50%) when --relative-to is set
.TP
.B --relative-to
Resolve X/Y as offsets or percentages relative to this element's top-left corner. Accepts a UID (e.g., s7) or CSS selector (e.g., css:#submit)
.TP
.B --button
Mouse button to press
.TP
.B --include-snapshot
Include updated accessibility snapshot in output
.TP
.B --compact
Use compact mode for the included snapshot (only interactive and landmark elements)
.TP
.B interact mouseup-at
Release mouse button at coordinates
.TP
.B x
X coordinate: absolute pixels or percentage (e.g., 50%) when --relative-to is set
.TP
.B y
Y coordinate: absolute pixels or percentage (e.g., 50%) when --relative-to is set
.TP
.B --relative-to
Resolve X/Y as offsets or percentages relative to this element's top-left corner. Accepts a UID (e.g., s7) or CSS selector (e.g., css:#submit)
.TP
.B --button
Mouse button to release
.TP
.B --include-snapshot
Include updated accessibility snapshot in output
.TP
.B --compact
Use compact mode for the included snapshot (only interactive and landmark elements)
.TP
.B interact type
Type text character-by-character into the focused element
.TP
.B text
Text to type character-by-character
.TP
.B --delay
Delay between keystrokes in milliseconds (default: 0 for instant)
.TP
.B --include-snapshot
Include updated accessibility snapshot in output
.TP
.B --compact
Use compact mode for the included snapshot (only interactive and landmark elements)
.TP
.B interact key
Press a key or key combination (e.g. Enter, Control+A)
.TP
.B keys
Key or key combination to press (e.g. Enter, Control+A, Shift+ArrowDown)
.TP
.B --repeat
Number of times to press the key
.TP
.B --include-snapshot
Include updated accessibility snapshot in output
.TP
.B --compact
Use compact mode for the included snapshot (only interactive and landmark elements)
.TP
.B interact scroll
Scroll the page or a container element
.TP
.B --direction
Scroll direction
.TP
.B --amount
Scroll distance in pixels (default: viewport height for vertical, viewport width for horizontal)
.TP
.B --to-element
Scroll until a specific element is in view (UID like 's5' or CSS selector like 'css:#footer')
.TP
.B --to-top
Scroll to the top of the page
.TP
.B --to-bottom
Scroll to the bottom of the page
.TP
.B --smooth
Use smooth scrolling behavior
.TP
.B --selector
CSS selector to target a scrollable container (e.g., '.stage', '#panel')
.TP
.B --uid
Accessibility UID to target a scrollable container (e.g., 's42', requires prior snapshot)
.TP
.B --container
Scroll within a container element (UID like 's3' or CSS selector like 'css:.scrollable')
.TP
.B --include-snapshot
Include updated accessibility snapshot in output
.TP
.B --compact
Use compact mode for the included snapshot (only interactive and landmark elements)
.SH EXAMPLES
.PP
Examples:
.TP
.B \`agentchrome interact click s5\`
Click an element by UID
.TP
.B \`agentchrome interact click css:#submit-btn\`
Click an element by CSS selector
.TP
.B \`agentchrome interact click s12 --wait-until networkidle\`
Click and wait for network idle (for SPA navigation)
.TP
.B \`agentchrome interact type "Hello, world!"\`
Type text into the focused element
.TP
.B \`agentchrome interact key Control+A\`
Press a key combination
.TP
.B \`agentchrome interact scroll --to-bottom\`
Scroll to the bottom of the page
.TP
.B \`agentchrome interact --frame 1 click s3\`
Click an element inside an iframe
.TP
.B \`agentchrome interact --frame 1 click-at 100 200\`
Click at coordinates inside an iframe
.TP
.B \`agentchrome interact drag-at 100 200 300 400\`
Drag from coordinates to coordinates
.TP
.B \`agentchrome interact drag-at 0 0 500 500 --steps 10\`
Drag with interpolated movement steps
.TP
.B \`agentchrome interact mousedown-at 100 200\`
Press mouse button at coordinates (no release)
.TP
.B \`agentchrome interact mouseup-at 300 400\`
Release mouse button at coordinates
.TP
.B \`agentchrome interact click-at 50% 50% --relative-to css:#submit\`
Click the center of an element using percentage coordinates
.TP
.B \`agentchrome interact click-at 0% 0% --relative-to css:#submit\`
Click the top-left corner of an element
.TP
.B \`agentchrome interact click-at 100% 100% --relative-to s7\`
Click the bottom-right pixel of an element by UID
.TP
.B \`agentchrome interact drag-at 10% 50% 90% 50% --relative-to css:#track\`
Drag a slider from 10% to 90% across an element