click, fill, hover, keypress, keys, scroll, drag, wait-for, dialog, screenshot, bounds, and tabs. get, expect and run read, check and script it. Most commands target a numeric probe ID from sightmap snapshot or a component query, a CSS-shaped expression that matches Sightmap component names and properties.
All commands on this page except
tabs subcommands resolve a session with --addr (default localhost:7892) and --tab. Pass --tab whenever two or more content tabs are open. Session lifecycle commands are documented under Browser sessions.Iframes
Probe IDs and component queries reach into iframes, including cross-origin and nested ones. An ID minted in a frame carries the frame’s prefix (2_26; the top document’s IDs are bare numbers), and click, fill, hover, drag, keypress, scroll, wait-for (--component and --selector), bounds and screenshot --component resolve it to the frame that holds the element. Boxes are in top-page coordinates. A click’s point is computed from the live layout right before the event is sent, after the element is scrolled into view, and click refuses (covered by another element) when something in the page is drawn over the frame at that point. drag measures its start and drop points the same way and checks the drop target the same way, but the source and the target must be in the same document or in frames of one process: the pointer is sent to one process and cannot be carried into another. See Iframes for how snapshots include frames and match them.
Background tabs
Chrome is reported to deliver mouse and focus events only to the visible tab, accepting them on a background one and doing nothing. Soclick, fill, hover, keypress, scroll and drag first bring the target tab to the front when it is hidden (as browser front does), and say so on stderr: brought tab TAB to front. The tab stays in front afterward.
Component queries
Probe IDs belong to one extraction. A later extraction reassigns them, and a page re-render can replace the target node. Component queries reduce that risk by extracting the live tree and applying the corpus immediately before acting. Prefer queries on pages that re-render often. Queries match component names and extracted property values, not DOM selectors:
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 or several components returns an error. For an ambiguous query, the CLI lists each candidate and its properties so you can add a predicate or #N index:
Property predicates filter on the component’s declared
properties:. A component without properties can be addressed only by name or #N index, and a property withheld by privacy is absent, so a predicate on it matches nothing.browser click
Clicks an element. The target is a probe ID, a component query, or raw --x and --y coordinates. Before dispatching, it scrolls the target to the center of the viewport and verifies that its center is the top-most element there. It errors instead of silently doing nothing when the target cannot be positioned in the viewport, or is covered by another element (an open overlay or modal). On success it echoes a confirmation with the real post-scroll coordinates, e.g. clicked CartNavButton @ (674,30). A click may trigger navigation that settles after the command returns (client-side SPA routing is asynchronous); click does not wait for it. Follow an action that should navigate with an explicit wait-for on the destination — the same act-then-wait split Playwright and Selenium use. (--x/--y coordinate clicks skip the scroll-and-verify step.)
browser fill
Replaces the value of an input, textarea or contenteditable by typing. Takes two positionals: the target (probe ID or component query) and the value. It selects the field’s whole content through the DOM first, then types real key events. After typing it reads the value back and errors when the field is still empty (a React-controlled input where plain typing doesn’t stick) or when the old value was not replaced (the field now holds old and new text); retry with --clear, which empties the field through its native value setter first. On success it echoes filled TARGET = "value" to stderr.
fill also errors when the click meant to focus the field left focus on the page (clicking "N" did not focus it), rather than typing into nothing; with --clear, a field that took no focus is reported as the field did not take focus instead of a raw JS exception.
Inputs whose value is not typed characters — date, time, datetime-local, month, week, color and range — are not typed into: Chrome routes keystrokes into a date control’s segmented year/month/day editor, which mangles them. fill sets their value whole, the way a script would with the native setter, fires input and change, and reads it back. Give the value in the format the control stores (2027-04-16 for a date, 14:45 for a time, #ff0000 for a color); a value the control does not take (a date it cannot parse, a color that is not #rrggbb, a range value that is not a number) is an error, and a range given a number outside its min/max holds the nearest bound, as the control clamps it, and a disabled or read-only control is refused. This works inside iframes too.
browser hover
Moves the pointer over an element, such as a menu or tooltip trigger. It accepts the same targets as click: a probe ID, component query, or --x and --y. On success it echoes a confirmation to stderr.
browser keypress
Sends a key, or a Playwright-style chord, to the focused element. Click or fill a field first when it needs focus, or pass a target after the key and it is focused first, in whichever frame holds it. The key is a positional argument in the form KEY or MODIFIER+...+KEY.
- Modifiers:
Shift,Control(Ctrl),Alt(Option),Meta(Cmd,Command), andControlOrMeta(Meta on macOS, Control elsewhere, chosen by the machine running the CLI). - Keys: a character (
c,C,5,.,?), a code name (KeyC,Digit1,Period,BracketLeft), or one ofEnter,Tab,Escape,Space,Backspace,Delete,Home,End,PageUp,PageDown,ArrowUp,ArrowDown,ArrowLeft,ArrowRight,F1–F12. A name outside this list is an error and nothing is sent. - Text: a character is typed only when no Control, Meta, or Alt is held, so
Meta+Kdoes not insert ak.
pressed KEY to stderr.
browser keys
Presses a sequence of keys and types text in one call, in the order given. Each KEY is a key or chord as for keypress; each --type TEXT types text one character at a time, at its place among the keys. --focus QUERY gives a component keyboard focus first. On success it echoes pressed ... to stderr.
browser get
Prints what the corpus says about the live page, so a check needs no eval. Each argument is a component query; each match prints as one JSON line with its component name, extracted properties, text (cut to 80 characters), visibility, and whether it holds keyboard focus. A property the corpus defines wins over a built-in of the same name (text, visible, focused). get page prints the URL and title and needs no corpus match. A query that matches nothing is an error that says what the page has instead, for example 8 IssueRow on the page; identifier is "WEB-130", ....
browser expect
Waits until every condition holds, then exits 0. On timeout it exits 1 and prints each failed condition with what the page showed, for example want IssueRow[identifier=WEB-130] group="status:done"; saw group "status:todo". With a query and no other condition it waits for the component to be present. --prop, --text, --count, --gone and --focused need a query; --url and --title do not.
browser run
Runs browser subcommands from a file (or - for stdin), one per line, against one session. A step is a subcommand without the sightmap browser prefix. Blank lines and # comments are skipped; quotes, a trailing \ continuation and $VARS work as in sh. A navigate path such as /inbox resolves against the current page’s origin. Every step name is checked before the first one runs. The run stops at the first failing step and prints its line, the failure, and the page’s URL and title.
Steps:
navigate, click, fill, hover, keypress, keys, scroll, drag, wait-for, get, expect, eval, screenshot, dialog.
Settling after an action
navigate, click, fill, keypress, keys and drag take --settle. After acting, the command waits until the DOM, including open shadow roots, has been quiet for 300 ms with no fetch or XMLHttpRequest in flight, for at most 5 seconds, and prints settled in Nms (or that the page was still changing) to stderr. Use it instead of a fixed sleep; to wait for a specific result, use expect. A page that animates or polls never goes quiet and runs to the 5 second cap.
browser scroll
Scrolls the page by pixel deltas, scrolls a component into view, or does both. When both are set, --component-id brings the target into view before applying the deltas. On success it echoes what it scrolled to stderr.
browser drag
Drags an element by pixel deltas. The target is a positional probe ID from snapshot output; this command does not accept component queries. On success it echoes dragged TARGET by (dx,dy) to stderr.
browser wait-for
Waits for exactly one condition. It is the explicit step boundary after an action that triggers navigation or asynchronous rendering: act, then wait-for the postcondition. On success it echoes what it matched to stderr; on timeout it exits 1 with a message like wait-for: timed out after 10000ms waiting for selector "...".
The semantic conditions are corpus-aware and auto-retry until they hold: --view waits until the current URL resolves to a named sightmap view, and --component waits until a component query (name plus optional property filters, e.g. WorkItemRow[key="FALCON-7"]) matches at least one node on the live page. --url (a plain URL substring, not a glob or regex), --selector, and --load are the raw DOM/URL escape hatches — prefer --view/--component when the destination is in the corpus, since they absorb dynamic path segments and wait for real rendered content rather than a URL proxy.
browser dialog
Resolves a blocking JavaScript dialog (alert, confirm, prompt). The action is a positional argument: accept or dismiss. On success it echoes accepted dialog / dismissed dialog to stderr; when no dialog is open it reports that clearly instead of surfacing a raw CDP error.
browser screenshot
Captures the current viewport as a PNG. If the PNG attempt times out, the command retries as JPEG unless you pass --no-retry. Pass --component or --selector to clip the capture to a single element’s bounding box instead of the whole viewport.
browser bounds reports); an off-screen target errors with no in-viewport match to clip to.
browser bounds
Prints bounding boxes as JSON, with viewport percentages and raw pixels. Query by positional component names, by raw CSS selector, or use --all for every matched component. Component-name lookup is exact and case-insensitive by default; it does not use the component-query language. The command skips offscreen matches unless you pass --include-offscreen.
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 component names, extracted properties, and probe IDs (Capturing pages).2
Act by identity
Use a component query, such as
browser click 'ProductCard[name^="Weber"] AddToCartButton' or browser fill --clear SearchInput 'garden hose'.3
Wait for the result
browser wait-for --url '/cart' (or --selector/--load) before the next action.4
Verify
Run another snapshot to read the new state. To inspect it visually, run
browser screenshot --out after.png and use browser bounds to locate components.