Computer actions

One-shot computer actions (screenshot, click, type, windows) against a selected target, and their recorded trajectories.

CommandDescription
cua doOne-shot computer actions against the selected target.
cua do switchSelect the target: a sandbox name or ref, a relay Space (relay:<id>), host, url <URL>, or a legacy <provider> <name> pair.
cua do statusShow the current target and zoom state.
cua do lsList targets (optionally of one provider).
cua do zoomCrop screenshots to a window and map coordinates into it.
cua do unzoomReturn to full-screen screenshots.
cua do screenshotTake a screenshot (saved to ~/.cua/screenshots, newest 20 kept, unless --save).
cua do snapshotScreenshot plus an AI summary of the screen and its interactive elements (needs ANTHROPIC_API_KEY).
cua do clickClick at image coordinates.
cua do dclickDouble-click at image coordinates.
cua do moveMove the cursor (image coordinates).
cua do typeType text.
cua do keyPress a key (enter, escape, tab, ...).
cua do hotkeyKeyboard shortcut (cmd+c, ctrl+shift+s).
cua do scrollScroll in a direction.
cua do dragDrag between two points (image coordinates).
cua do shellRun a shell command, or open an interactive terminal (PTY) when no command is given on a terminal.
cua do openOpen a file or URL.
cua do launchLaunch an application.
cua do windowWindow management.
cua do window lsList windows (optionally filtered by app or title).
cua do window unfocusRemove focus from the current window (presses Escape).
cua do window focusFocus a window.
cua do window minimizeMinimize a window.
cua do window maximizeMaximize a window.
cua do window restoreRestore a minimized or maximized window.
cua do window closeClose a window.
cua do window resizeResize a window.
cua do window moveMove a window.
cua do window infoShow a window as JSON.
cua do a11yAccessibility tree and actions.
cua do a11y treePrint the accessibility tree (JSON).
cua do a11y findFind elements by name (and role).
cua do a11y actAct on an element: press, focus, set-value, increment, ...
cua do cursorPrint the cursor position (screen points).
cua do clipboardClipboard text.
cua do clipboard getPrint clipboard text.
cua do clipboard setSet clipboard text.
cua do-host-consentGrant consent for cua do switch host.
cua trajectoryRecorded cua do trajectories.
cua trajectory lsList sessions.
cua trajectory viewZip, serve on loopback and open the hosted viewer.
cua trajectory stopStop the file server started by view.
cua trajectory cleanDelete sessions.

Every command also accepts the global options.

cua do#

One-shot computer actions against the selected target.

cua do [OPTIONS] <COMMAND>
FlagTypeDefaultDescription
--no-recordbooleanfalseDisable trajectory recording for this command.

Examples

# Act on a sandbox, then take a screenshot
cua do switch dev
cua do screenshot
 
# A relay Space (`cua spaces ls`)
cua do switch relay:0123abcd4567ef89

cua do switch#

Select the target: a sandbox name or ref, a relay Space (relay:<id>), host, url <URL>, or a legacy <provider> <name> pair.

cua do switch [OPTIONS] <TARGET> [NAME]
ArgumentTypeDefaultDescription
<TARGET>stringrequiredSandbox name or ref, relay:<id>, host, url, or a legacy provider word.
<NAME>stringoptionalThe URL after url, or the sandbox name after a provider word.
FlagTypeDefaultEnv varDescription
--tokenstringCUA_ENV_TOKENspacesd token (url and host).
--asstringSandbox name to register a url target under.

Examples

cua do switch dev
cua do switch relay:0123abcd4567ef89
 
# This machine (after `cua do-host-consent`)
cua do switch host

cua do status#

Show the current target and zoom state.

cua do status [OPTIONS]

Examples

cua do status

cua do ls#

List targets (optionally of one provider).

cua do ls [OPTIONS] [PROVIDER]
ArgumentTypeDefaultDescription
<PROVIDER>stringoptionalOnly targets of this provider.

Examples

cua do ls

cua do zoom#

Crop screenshots to a window and map coordinates into it.

cua do zoom [OPTIONS] <WINDOW_NAME>
ArgumentTypeDefaultDescription
<WINDOW_NAME>stringrequiredWindow title or app name.

Examples

cua do zoom Firefox

cua do unzoom#

Return to full-screen screenshots.

cua do unzoom [OPTIONS]

Examples

cua do unzoom

cua do screenshot#

Take a screenshot (saved to ~/.cua/screenshots, newest 20 kept, unless --save).

cua do screenshot [OPTIONS]
FlagShortTypeDefaultDescription
--save-spathSave the PNG here.

Examples

cua do screenshot
cua do screenshot --save desktop.png

cua do snapshot#

Screenshot plus an AI summary of the screen and its interactive elements (needs ANTHROPIC_API_KEY).

cua do snapshot [OPTIONS] [INSTRUCTIONS]...
ArgumentTypeDefaultDescription
<INSTRUCTIONS>...stringoptionalWhat to focus the summary on. Repeatable.
FlagTypeDefaultDescription
--modelstringModel (default claude-haiku-4-5, or CUA_SNAPSHOT_MODEL).

Examples

cua do snapshot
cua do snapshot find the search box

cua do click#

Click at image coordinates.

cua do click [OPTIONS] <X> <Y> [BUTTON]
ArgumentTypeDefaultDescription
<X>integerrequiredX in screenshot pixels.
<Y>integerrequiredY in screenshot pixels.
<BUTTON>left | right | middleleftMouse button.

Examples

cua do click 640 360
cua do click 640 360 right

cua do dclick#

Double-click at image coordinates.

cua do dclick [OPTIONS] <X> <Y>
ArgumentTypeDefaultDescription
<X>integerrequiredX in screenshot pixels.
<Y>integerrequiredY in screenshot pixels.

Examples

cua do dclick 640 360

cua do move#

Move the cursor (image coordinates).

cua do move [OPTIONS] <X> <Y>
ArgumentTypeDefaultDescription
<X>integerrequiredX in screenshot pixels.
<Y>integerrequiredY in screenshot pixels.

Examples

cua do move 640 360

cua do type#

Type text.

cua do type [OPTIONS] <TEXT>
ArgumentTypeDefaultDescription
<TEXT>stringrequiredText to type.

Examples

cua do type 'hello world'

cua do key#

Press a key (enter, escape, tab, ...).

cua do key [OPTIONS] <KEY>
ArgumentTypeDefaultDescription
<KEY>stringrequiredKey name.

Examples

cua do key enter

cua do hotkey#

Keyboard shortcut (cmd+c, ctrl+shift+s).

cua do hotkey [OPTIONS] <KEYS>
ArgumentTypeDefaultDescription
<KEYS>stringrequiredKeys joined with +.

Examples

cua do hotkey ctrl+shift+s

cua do scroll#

Scroll in a direction.

cua do scroll [OPTIONS] <DIRECTION> [AMOUNT]
ArgumentTypeDefaultDescription
<DIRECTION>up | down | left | rightrequiredDirection.
<AMOUNT>integer3Scroll steps.

Examples

cua do scroll down
cua do scroll up 10

cua do drag#

Drag between two points (image coordinates).

cua do drag [OPTIONS] <X1> <Y1> <X2> <Y2>
ArgumentTypeDefaultDescription
<X1>integerrequiredStart X in screenshot pixels.
<Y1>integerrequiredStart Y in screenshot pixels.
<X2>integerrequiredEnd X in screenshot pixels.
<Y2>integerrequiredEnd Y in screenshot pixels.

Examples

cua do drag 100 200 400 200

cua do shell#

Run a shell command, or open an interactive terminal (PTY) when no command is given on a terminal.

cua do shell [OPTIONS] [COMMAND]...
ArgumentTypeDefaultDescription
<COMMAND>...stringoptionalCommand and arguments. Repeatable.
FlagTypeDefaultDescription
--colsintegerTerminal width (default: this terminal's).
--rowsintegerTerminal height (default: this terminal's).

Examples

cua do shell ls -la /tmp
 
# An interactive terminal
cua do shell

cua do open#

Open a file or URL.

cua do open [OPTIONS] <PATH>
ArgumentTypeDefaultDescription
<PATH>stringrequiredFile path or URL in the target.

Examples

cua do open https://example.com

cua do launch#

Launch an application.

cua do launch [OPTIONS] <APP> [ARGS]...
ArgumentTypeDefaultDescription
<APP>stringrequiredApplication name or path.
<ARGS>...stringoptionalArguments passed to the application. Repeatable.

Examples

cua do launch firefox
cua do launch firefox --private-window

cua do window#

Window management.

cua do window [OPTIONS] <COMMAND>

cua do window ls#

List windows (optionally filtered by app or title).

cua do window ls [OPTIONS] [APP]
ArgumentTypeDefaultDescription
<APP>stringoptionalOnly windows whose app or title contains this.

Examples

cua do window ls
cua do window ls firefox

cua do window unfocus#

Remove focus from the current window (presses Escape).

cua do window unfocus [OPTIONS]

Examples

cua do window unfocus

cua do window focus#

Focus a window.

cua do window focus [OPTIONS] <WINDOW_ID>
ArgumentTypeDefaultDescription
<WINDOW_ID>stringrequiredWindow id (from cua do window ls).

Examples

cua do window focus <window-id>

cua do window minimize#

Minimize a window.

cua do window minimize [OPTIONS] <WINDOW_ID>
ArgumentTypeDefaultDescription
<WINDOW_ID>stringrequiredWindow id (from cua do window ls).

Examples

cua do window minimize <window-id>

cua do window maximize#

Maximize a window.

cua do window maximize [OPTIONS] <WINDOW_ID>
ArgumentTypeDefaultDescription
<WINDOW_ID>stringrequiredWindow id (from cua do window ls).

Examples

cua do window maximize <window-id>

cua do window restore#

Restore a minimized or maximized window.

cua do window restore [OPTIONS] <WINDOW_ID>
ArgumentTypeDefaultDescription
<WINDOW_ID>stringrequiredWindow id (from cua do window ls).

Examples

cua do window restore <window-id>

cua do window close#

Close a window.

cua do window close [OPTIONS] <WINDOW_ID>
ArgumentTypeDefaultDescription
<WINDOW_ID>stringrequiredWindow id (from cua do window ls).

Examples

cua do window close <window-id>

cua do window resize#

Resize a window.

cua do window resize [OPTIONS] <WINDOW_ID> <WIDTH> <HEIGHT>
ArgumentTypeDefaultDescription
<WINDOW_ID>stringrequiredWindow id (from cua do window ls).
<WIDTH>integerrequiredWidth in screen points.
<HEIGHT>integerrequiredHeight in screen points.

Examples

cua do window resize <window-id> 1280 800

cua do window move#

Move a window.

cua do window move [OPTIONS] <WINDOW_ID> <X> <Y>
ArgumentTypeDefaultDescription
<WINDOW_ID>stringrequiredWindow id (from cua do window ls).
<X>integerrequiredLeft edge in screen points.
<Y>integerrequiredTop edge in screen points.

Examples

cua do window move <window-id> 0 0

cua do window info#

Show a window as JSON.

cua do window info [OPTIONS] <WINDOW_ID>
ArgumentTypeDefaultDescription
<WINDOW_ID>stringrequiredWindow id (from cua do window ls).

Examples

cua do window info <window-id>

cua do a11y#

Accessibility tree and actions.

cua do a11y [OPTIONS] <COMMAND>

cua do a11y tree#

Print the accessibility tree (JSON).

cua do a11y tree [OPTIONS]
FlagTypeDefaultDescription
--windowstringOnly this window (default: the focused one).
--depthinteger0Maximum depth (0: unlimited).

Examples

cua do a11y tree
cua do a11y tree --window <window-id> --depth 4

cua do a11y find#

Find elements by name (and role).

cua do a11y find [OPTIONS] <NAME>
ArgumentTypeDefaultDescription
<NAME>stringrequiredElement name (substring).
FlagTypeDefaultDescription
--rolestringOnly elements with this role.
--windowstringOnly this window (default: the focused one).

Examples

cua do a11y find Save --role button

cua do a11y act#

Act on an element: press, focus, set-value, increment, ...

cua do a11y act [OPTIONS] <ELEMENT> [ACTION] [VALUE]
ArgumentTypeDefaultDescription
<ELEMENT>stringrequiredElement id from tree or find.
<ACTION>stringpressAction.
<VALUE>stringoptionalValue for set-value.
FlagTypeDefaultDescription
--snapshotstringSnapshot id from tree/find (default: the latest).

Examples

cua do a11y act <element-id>
cua do a11y act <element-id> set-value 'hello'

cua do cursor#

Print the cursor position (screen points).

cua do cursor [OPTIONS]

Examples

cua do cursor

cua do clipboard#

Clipboard text.

cua do clipboard [OPTIONS] <COMMAND>

cua do clipboard get#

Print clipboard text.

cua do clipboard get [OPTIONS]

Examples

cua do clipboard get

cua do clipboard set#

Set clipboard text.

cua do clipboard set [OPTIONS] <TEXT>
ArgumentTypeDefaultDescription
<TEXT>stringrequiredText to put on the clipboard.

Examples

cua do clipboard set 'hello'

Grant consent for cua do switch host.

cua do-host-consent [OPTIONS]

Examples

# Allow `cua do` to act on this machine's desktop
cua do-host-consent

cua trajectory#

Recorded cua do trajectories.

cua trajectory [OPTIONS] <COMMAND>

Alias: cua traj.

cua trajectory ls#

List sessions.

cua trajectory ls [OPTIONS] [MACHINE]
ArgumentTypeDefaultDescription
<MACHINE>stringoptionalOnly sessions of this target (sandbox name or host).

Examples

cua traj ls
 
# Only the sessions recorded on the sandbox dev
cua traj ls dev

cua trajectory view#

Zip, serve on loopback and open the hosted viewer.

cua trajectory view [OPTIONS] [TARGET]
ArgumentTypeDefaultDescription
<TARGET>stringoptionalSession id or target name (default: the latest session).
FlagShortTypeDefaultDescription
--port-pinteger8089Loopback port of the file server.

Examples

# The latest session
cua traj view
cua traj view <session> --port 8090

cua trajectory stop#

Stop the file server started by view.

cua trajectory stop [OPTIONS]

Examples

cua traj stop

cua trajectory clean#

Delete sessions.

cua trajectory clean [OPTIONS]
FlagShortTypeDefaultDescription
--older-thanintegerOnly sessions older than this many days.
--machinestringOnly sessions of this target.
--yes-ybooleanfalseDo not ask for confirmation.

Examples

# Sessions older than a week, without the prompt
cua traj clean --older-than 7 --yes

Exit codes#

CodeMeaning
0Success.
1Failure, or cua do reported an error.
2Invalid argument, or an ambiguous sandbox name (qualify it: local:NAME).
3Not found: sandbox, window, skill or image (or an image not published yet).
4Not supported, or not configured (for example no provider credentials).
5No cua-spacesd answered, or a transport failure.
6Unauthenticated or permission denied (by Cua or your cloud account).
7Not enough free disk space (see cua cache).
130Cancelled (Ctrl-C during a create): what it made was removed.