guiauto skill
guiauto drives graphical desktop applications for an LLM agent. It captures annotated screenshots, lists the interactive controls of an application with numbers, and injects real mouse and keyboard input. It runs as a command line tool that prints JSON, or as a local HTTP server with the same commands.
Purpose
Use guiauto to operate applications that have no API: fill forms, click buttons and menus, read what is on screen and confirm the result. The loop is observe, act, verify. A screenshot shows the window with a grid of real screen coordinates and, with the marks option, a numbered box around every interactive control. The agent then clicks or types by element number or by coordinates, and takes another screenshot to check the outcome.
When to use it
Choose guiauto when the task needs a real desktop application on Windows or on a Linux X11 session, for example a legacy Win32, WinForms, WPF, GTK or Electron program, an installer, or an end-to-end test of a desktop UI. Prefer an application's own CLI or API when one exists. guiauto cannot control native Wayland windows, so on Linux run the target under X11 (Xorg, XWayland, or a virtual display such as Xvfb).
Install
Download the archive for the platform from https://github.com/lmctl-ai/guiauto/releases and verify it against SHA256SUMS. The Windows exe is statically linked and can be copied anywhere. On Linux extract the tarball and install the runtime packages (Debian and Ubuntu names): libx11-6, libxtst6, libxrandr2, libatspi2.0-0 and zlib1g. To build from source, use CMake 3.20 or newer with g++, clang or MSVC; the Linux build also needs the matching development packages.
tar xzf guiauto-TAG-linux-x64.tar.gz
./guiauto help
./guiauto info
Commands
Every command prints one JSON object on stdout. The first group observes, the second acts. Any command accepts a target (window title substring, window handle, process id, executable name or the foreground window) which is focused first unless no-focus is given. Actions wait 200 milliseconds by default (the settle option) so the next screenshot shows the result.
# Observe
guiauto info
guiauto windows [--all] [--window TEXT] [--exe NAME] [--pid N]
guiauto screenshot [TARGET] [--marks] [--grid 100] [--out FILE] [--cursor] [--base64]
guiauto elements [TARGET] [--name TEXT] [--type Button] [--all]
# Act
guiauto click X Y | --id N [--button right] [--double] [--mods ctrl+shift]
guiauto move X Y | --id N
guiauto drag --x1 100 --y1 200 --x2 400 --y2 200
guiauto scroll X Y --dy 5
guiauto type "text" [--id N] [--clear] [--enter]
guiauto key ctrl+s
guiauto key "ctrl+a delete"
guiauto focus --window "Order Entry"
guiauto wait 500
# Server
guiauto serve --port 8765
Inputs and outputs
A screenshot returns the path of a PNG, the image size, the capture rectangle in screen pixels and the scale. With the marks option it also returns the element list: each element has an id, a type such as Button, Edit, CheckBox, ListItem or MenuItem, a name, a rectangle and a center point. The ids are saved to a state file so a later click --id 14 works from a separate process. Ids change on every scan, so always scan again after the screen changes.
The server exposes the same commands as GET or POST on /COMMAND at 127.0.0.1. Options go in the query string or a JSON body. GET /screenshot?marks=1 returns JSON with image_base64, and format=png returns the raw PNG. Commands that send input require POST.
curl "http://127.0.0.1:8765/screenshot?marks=1&window=Order+Entry"
curl -X POST http://127.0.0.1:8765/click -d '{"id": 14}'
curl -X POST http://127.0.0.1:8765/key -d '{"keys": ["ctrl", "s"]}'
Safety rules
guiauto moves the real mouse and types on the real keyboard, so it can change or delete data in whatever application has focus. Confirm the target window before destructive actions, take a screenshot first, and do not touch the mouse or keyboard while an action runs. The server binds to 127.0.0.1 by default and binding elsewhere requires a token. It refuses any request with an Origin header, refuses a non-loopback Host header, and requires POST for input commands, so web pages cannot drive the desktop. Run it on a virtual display or a dedicated test session when automating untrusted flows.
Worked examples
Fill in and submit a form: scan the window, then use the element ids from the list.
guiauto screenshot --window "Order Entry" --marks
guiauto type --window "Order Entry" --id 2 --text "1042" --clear --enter
guiauto click --window "Order Entry" --id 14
guiauto screenshot --window "Order Entry"
Click something that has no accessibility element by reading its position off the grid labels of the screenshot.
guiauto screenshot --window "Canvas App" --grid 50
guiauto click 450 320 --double
On a headless Linux machine run guiauto inside a virtual display with its own session bus so toolkits export their accessibility tree.
xvfb-run -a dbus-run-session -- bash -c 'myapp & sleep 2; guiauto elements'
Errors and exit codes
Success exits with 0 and prints ok true. Failure exits with 1 and prints ok false with a readable error. A warning field may accompany a successful result, for example when the target window could not be brought to the front.
guiauto key
{ "ok": false, "error": "key needs KEYS, e.g. `key ctrl+s` or `key \"ctrl+a delete\"`" }
| Error | Meaning and fix |
|---|---|
| no visible window matches | The target filter matched nothing. Run guiauto windows and use the exact title, pid or exe. |
| no element map yet | click --id was used before any scan. Run screenshot --marks or elements first. |
| element N is not in the latest element map | Ids change on every scan. Scan again. |
| cannot open X display | Linux only. Set DISPLAY, or use xvfb-run. A Wayland-only session has no X server for guiauto. |
| token is required when binding to a non-loopback address | Pass the token option to serve, or bind to 127.0.0.1. |
Platform limits: on Windows an application running as Administrator needs guiauto to run as Administrator as well, otherwise input is silently dropped, and the screen must be unlocked. On Linux the accessibility tree needs the toolkit's accessibility support enabled (GTK is automatic; Qt needs QT_LINUX_ACCESSIBILITY_ALWAYS_ON=1; Chromium and Electron need --force-renderer-accessibility). Without a tree, use the grid and coordinates.
How to verify
Verify every action with a fresh observation instead of assuming it worked. Take a screenshot after the action and check the expected change on the image, or run elements with a name filter and check that the control or value is present. Run guiauto info once at the start to confirm the monitors, the cursor position and the foreground window, and run a harmless action such as guiauto move on an empty area to confirm that input reaches the screen.
guiauto info
guiauto screenshot --window "Order Entry" --marks
guiauto elements --window "Order Entry" --name "Saved"