guiauto reference

Complete list of guiauto commands, targets, common options, JSON output shapes and HTTP routes for the Windows and Linux builds.

Commands

CommandArgumentsResult
infononeMonitors with dpi and scale, virtual screen, cursor, foreground window, session details.
windows--all --window --exe --pidTop-level windows with hwnd, title, exe, pid, class and rectangle, topmost first.
screenshotTARGET --out --grid --marks --all --all-windows --name --type --max-elements --max-size --scale --monitor --region --cursor --base64PNG path, image size, capture rectangle, scale and, with marks, the element list.
elementsTARGET --all --all-windows --name --type --max-elementsElement list without an image. Saves the element map.
clickX Y or --id N, --button, --double, --count, --modsClicks at the point or element center.
moveX Y or --id NMoves the pointer.
mousedown, mouseupoptional X Y or --id N, --buttonPresses or releases a button.
drag--x1 --y1 --x2 --y2 or --from-id --to-id, --button, --duration, --modsPress, move in steps, release.
scrolloptional X Y or --id N, --dy, --dx, --modsWheel notches. Positive dy scrolls down, positive dx scrolls right.
typeTEXT or --text, --id N or --x --y, --clear, --enter, --delayOptionally clicks the target, then types. A newline in TEXT presses Enter and a tab presses Tab.
keyKEYS, --repeatKey combinations such as ctrl+s, alt+f4, or a sequence like "ctrl+a delete".
focusTARGETBrings the window to the front and reports whether it is focused.
waitMSSleeps up to 600000 milliseconds.
serve--port 8765 --host 127.0.0.1 --token SECRETRuns the HTTP API until stopped.

Targets and common options

OptionMeaning
--window TITLECase-insensitive title substring; an exact match is preferred.
--hwnd IDWindow handle, for example 0x1234 on Windows or an X11 window id on Linux.
--pid N, --exe NAMESelect by process id or executable name.
--foregroundThe current foreground window.
--no-focusDo not focus the target first.
--settle MSWait after an action, default 200.

Platform differences

AreaWindowsLinux
InputSendInputXTEST
ElementsUI AutomationAT-SPI
State directoryGUIAUTO_STATE_DIR, else LOCALAPPDATA\guiautoGUIAUTO_STATE_DIR, else XDG_STATE_HOME/guiauto, else ~/.local/state/guiauto
Typingunicode (default) or vk methodLayout keys first, temporary keycode for other characters; the method option has no effect
Not supportedElevated apps without an elevated guiauto, locked sessionsNative Wayland windows

HTTP routes

GET or POST on /COMMAND, with options as query string or JSON body in snake_case or kebab-case. GET / returns the help. Input commands (click, move, mousedown, mouseup, drag, scroll, type, key, focus) require POST and answer 405 to GET. A request with an Origin header answers 403, as does a Host header that is not loopback. A wrong or missing token answers 401.