guiauto reference
Complete list of guiauto commands, targets, common options, JSON output shapes and HTTP routes for the Windows and Linux builds.
Commands
| Command | Arguments | Result |
|---|---|---|
| info | none | Monitors with dpi and scale, virtual screen, cursor, foreground window, session details. |
| windows | --all --window --exe --pid | Top-level windows with hwnd, title, exe, pid, class and rectangle, topmost first. |
| screenshot | TARGET --out --grid --marks --all --all-windows --name --type --max-elements --max-size --scale --monitor --region --cursor --base64 | PNG path, image size, capture rectangle, scale and, with marks, the element list. |
| elements | TARGET --all --all-windows --name --type --max-elements | Element list without an image. Saves the element map. |
| click | X Y or --id N, --button, --double, --count, --mods | Clicks at the point or element center. |
| move | X Y or --id N | Moves the pointer. |
| mousedown, mouseup | optional X Y or --id N, --button | Presses or releases a button. |
| drag | --x1 --y1 --x2 --y2 or --from-id --to-id, --button, --duration, --mods | Press, move in steps, release. |
| scroll | optional X Y or --id N, --dy, --dx, --mods | Wheel notches. Positive dy scrolls down, positive dx scrolls right. |
| type | TEXT or --text, --id N or --x --y, --clear, --enter, --delay | Optionally clicks the target, then types. A newline in TEXT presses Enter and a tab presses Tab. |
| key | KEYS, --repeat | Key combinations such as ctrl+s, alt+f4, or a sequence like "ctrl+a delete". |
| focus | TARGET | Brings the window to the front and reports whether it is focused. |
| wait | MS | Sleeps up to 600000 milliseconds. |
| serve | --port 8765 --host 127.0.0.1 --token SECRET | Runs the HTTP API until stopped. |
Targets and common options
| Option | Meaning |
|---|---|
| --window TITLE | Case-insensitive title substring; an exact match is preferred. |
| --hwnd ID | Window handle, for example 0x1234 on Windows or an X11 window id on Linux. |
| --pid N, --exe NAME | Select by process id or executable name. |
| --foreground | The current foreground window. |
| --no-focus | Do not focus the target first. |
| --settle MS | Wait after an action, default 200. |
Platform differences
| Area | Windows | Linux |
|---|---|---|
| Input | SendInput | XTEST |
| Elements | UI Automation | AT-SPI |
| State directory | GUIAUTO_STATE_DIR, else LOCALAPPDATA\guiauto | GUIAUTO_STATE_DIR, else XDG_STATE_HOME/guiauto, else ~/.local/state/guiauto |
| Typing | unicode (default) or vk method | Layout keys first, temporary keycode for other characters; the method option has no effect |
| Not supported | Elevated apps without an elevated guiauto, locked sessions | Native 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.