Skip to content

agentsctl browser and desktop commands

browser and desktop drive the app of a running instance. browser <op> opens it in Chromium, Firefox or WebKit. desktop <op> opens the Electron desktop app. Both take the same operations. The first operation starts a browser session, and reset closes it.

bin/agentsctl browser <op> --help lists one operation’s flags.

These flags name the element an operation acts on. An operation that needs an element takes --role with --name or --text. press takes an element and works on the page without one.

Flag What it does
--role <value> The ARIA role of the element, such as button or textbox.
--name <value> Its accessible name, matched whole.
--text <value> Text inside it.
--within <value> Its container, as role:name, such as list:Agents, or a role with --within-text.
--within-text <value> Text inside the container named by --within <role>.

The operations that take them are click, fill, select, check, uncheck, press, wait, text, count, tab-to. goto opens / when it gets no route.

Every operation but reset takes these flags.

Flag What it does
--engine <value> One of chromium, firefox or webkit. The default is chromium. desktop accepts only chromium, because the desktop app is Electron.
--width <value> One of desktop or phone. The default is desktop.
--as <value> Who is signed in. One of ada, ben, a name given to seed person, or a full login.
--timeout <value> Seconds to wait for the element. The default is 15.
Operation What it does
goto <route> Opens a route, such as / or #/a/<agent id>, loading the page afresh.
click Clicks the element.
fill Replaces what the element holds with --value.
select Picks a choice in a select box, by --option (its label) or --value.
check Ticks a checkbox.
uncheck Unticks a checkbox.
press <key> Presses a key, such as Enter or Tab, in the element or on the page.
type <text> Types text where the keyboard focus is.
wait Waits until the element is there, or with --gone until it is not.
text Prints the element’s text. With --expect, waits until it holds that text.
count Counts the matching elements. With --expect, waits until there are that many.
snapshot Saves and prints the page’s ARIA tree.
screenshot Saves a screenshot.
console Lists page and console errors since the last look. Fails on any.
network Lists requests since the last look. Fails on any that failed or answered 400 or more.
trace start|stop Records a Playwright trace from start to stop.
overflow Fails when the page scrolls sideways, naming what sticks out.
a11y Runs axe on the page. Fails on serious or critical violations.
focus Prints what has the keyboard focus.
tab-to Presses Tab until the element has the focus, or fails.
record start|stop Records a video of the page from start to stop.
close Closes this page.
reset Closes the whole browser session. The next command opens a fresh one.

An operation not listed here takes only the page flags, plus the element flags if it is one of the operations that takes them.

Operation Flag What it does
fill --value <value> The text to put in.
select --option <value> The choice’s label.
select --value <value> The choice’s value.
wait --gone Wait for it to go.
text --expect <value> Text it must hold.
count --expect <value> How many there must be.
snapshot --aria The ARIA tree, which is the one snapshot there is.
snapshot --path <value> Where to save it.
snapshot --label <value> A name for the file in the evidence folder.
screenshot --page The whole page, not only what shows.
screenshot --path <value> Where to save it.
screenshot --label <value> A name for the file in the evidence folder.
network --path <value> Where to save it.
network --label <value> A name for the file in the evidence folder.
trace --path <value> Where to save it.
trace --label <value> A name for the file in the evidence folder.
record --label <value> What the recording shows.
tab-to --max <value> Presses to try. The default is 40.