Skip to main content
Once a session is running (Browser sessions), these commands act on the live page: click, fill, hover, keypress, scroll, drag, wait-for, dialog, screenshot, bounds, and tabs. Interaction targets are either a numeric probe ID from sightmap snapshot output or a component query — a small CSS-shaped language that addresses elements by their sightmap identity.
All commands on this page except the tabs subcommands (which resolve the session address themselves) accept --addr (default localhost:7892) and --tab; pass --tab whenever two or more content tabs are open, and put flags before positional arguments (shared conventions). Session lifecycle commands live on the Browser sessions page.

Component queries

Probe IDs are extraction-local: every snapshot reassigns them, so on a page that re-renders, an ID from an earlier snapshot goes stale. A component query avoids that — the command extracts the live tree, applies your corpus, and acts, all in one atomic pass, so nothing can go stale in between. Prefer queries on dynamic pages. Queries match over component names and extracted property values, not the DOM: The only predicate operators are = (exact), ^= (prefix), and *= (substring). Quote values that contain spaces. --sightmap-dir (default .sightmap) selects the corpus that resolves the query. A query that matches zero components is an error. A query that matches several is also an error — the CLI lists the candidates with their distinguishing properties so you can add a predicate or an #N index:
Property predicates depend on properties: extraction in your corpus, which is a draft spec extension — implemented by the Go CLI but not part of sightmap spec v1, and subject to change. Robust targeting and property authoring reinforce each other: a component with no properties can only be addressed by name or #N index.

browser click

Clicks an element. The target is a probe ID, a component query, or raw --x/--y coordinates (a layout-fragile escape hatch). Prints nothing on success.
Off-screen targets can be missed. Scroll the element into view first with browser scroll --component-id, then click.

browser fill

Types a value into an input. Takes two positionals: the target (probe ID or component query) and the value. Prints nothing on success.
React-controlled inputs may append instead of replace. Pass --clear, or set the value through the native setter with browser eval:

browser hover

Moves the pointer over an element — for hover-revealed menus and tooltips. Same targeting as click: probe ID, component query, or --x/--y. Prints nothing on success.

browser keypress

Sends a key event to the currently focused element — click or fill a field first to focus it. The key name is a positional argument: Enter, Tab, Escape, Backspace, Delete, ArrowUp, ArrowDown, Space, and so on. Prints nothing on success.

browser scroll

Scrolls the page by pixel deltas, scrolls a component into view, or both — --component-id first brings the target into view, then any deltas apply. Prints nothing on success.

browser drag

Drags an element by pixel deltas — for sliders and drag handles. The target is a positional probe ID from snapshot output (component queries are not supported here). Prints nothing on success.

browser wait-for

Blocks until a condition holds — exactly one of --url, --selector, or --load. Prints nothing on success; exits 1 if the timeout elapses first. Use it after a click that triggers navigation or async rendering, before you snapshot or act again.

browser dialog

Resolves a blocking JavaScript dialog (alert, confirm, prompt). The action is a positional argument: accept or dismiss. Prints nothing on success.

browser screenshot

Captures the current page as a PNG.

browser bounds

Emits bounding boxes as JSON — as viewport percentages (mapping directly onto a screenshot taken at the same browser state) plus raw pixels. Query by positional component names (exact, case-insensitive — this is name lookup, not the component-query DSL), by raw CSS selector, or dump every matched component with --all. Offscreen matches are skipped unless you ask for them.

browser tabs

Tab management for the session. browser start prints your tab’s ID; tabs list shows every open content tab.

Typical flow

1

Read the page

sightmap snapshot prints the annotated component tree — component names, extracted properties, and probe IDs (Capturing pages).
2

Act by identity

browser click 'ProductCard[name^="Weber"] AddToCartButton', browser fill --clear SearchInput 'garden hose' — component queries stay valid across re-renders.
3

Wait for the result

browser wait-for --url '/cart' (or --selector/--load) before the next action.
4

Verify

Re-snapshot to read the new state, or browser screenshot --out after.png — pair with browser bounds to locate components in the image.