Computer Use (macOS and Windows)
GUI control goes through the script bundled with this skill. The computer-use extension is
off by default, so if you are reading this the user has switched it on.
Platform support
| Host | Backend | Needs |
|---|---|---|
| macOS | CoreGraphics + Quartz events | Screen Recording and Accessibility grants |
| Windows | PowerShell agent launched from inside WSL | WSL running in an interactive desktop session |
On Windows the script only works from a WSL shell on the same machine: it reaches the
Windows desktop through WSL interop, which inherits the logged-on user's session. Run
from a service, an SSH session or anything on session 0 and doctor will say so —
screenshots come back black and input goes nowhere. This does not work on plain Linux
without Windows, and there is no macOS-side fallback for it.
Everything below is the same on both platforms. Key combos keep the macOS spelling
(cmd, shift), so cmd means the Windows key on Windows.
When to use it
- Native apps, dialogs, menu bars, installers, file pickers, System Settings.
- Anything on screen that
terminalcannot reach andbrowsercannot automate. - For web automation prefer the
browsertool while it works. If it fails because remote debugging is unavailable, fall back here immediately — do not openchrome://inspector run the browser-setup skill unless the user asks for it.
Workflow
-
Bring the target app forward if another window may cover it:
bashruby <skill_dir>/bin/computer.rb activate "WorkBuddy"It needs no extra permission on either platform. If the name does not match (localized app names differ), it prints what is actually frontmost — take a screenshot to see the real window order instead of guessing.
-
Screenshot — with a labelled grid when you will need to click precise spots:
bashruby <skill_dir>/bin/computer.rb screenshot --gridIt prints
image WxH scale S origin (x,y)and writes a sidecar.jsonnext to the PNG. The grid image is the one to read: its magenta lines and pixel labels give exact coordinates, so prefer it over writing your own crop or PIL overlay scripts.--grid 100sets a denser step; the default is 200. -
Read that PNG with the
readtool — it is attached to the conversation as an image. Need to read small text, or click inside a region? Crop and upscale it first, with--grid:bashruby <skill_dir>/bin/computer.rb zoom 400,300,900,600 --grid --out /tmp/clacky-shot-2.pngAlways pass
--grid: its labels are in the zoomed image's own pixel space, ready to feed straight intoclick, so you never convert coordinates yourself. Hand-converting a downscaled image is the usual source of misclicks — do not do it.zoomalso pads the region it captures, so theorigin (x,y)it prints is not the region you asked for; the grid labels are what to trust, not the origin.Note: the read tool downscales every image to 800px wide by default. That is fine for
--gridcaptures; passimage_max_width: 0only when reading ascreenshot --originalcapture, since re-downscaling would defeat it. -
Act, always passing the image you are looking at:
bashruby <skill_dir>/bin/computer.rb click 812 430 --from /tmp/clacky-shot-1.png ruby <skill_dir>/bin/computer.rb type "hello world" ruby <skill_dir>/bin/computer.rb key "cmd+s"--fromaccepts the grid copy too (shot-1-grid.png); it resolves back to the capture's sidecar automatically.typeandkeygo to whatever holds the focus, and the script cannot tell where that is — akeyaimed at a field that never got focus lands on another panel and fails silently. Screenshot to confirm the focus is where you mean it, andclickthe field once before typing or sending. If a field ignorestypealtogether (common with IME-backed native inputs), paste instead —pbcopyon macOS,clipon Windows — thenkey "cmd+v". -
Screenshot again to verify the result.
Locating elements
Follow this order and do not invent your own image-processing pipeline (no PIL scripts, no pixel counting):
- Plain screenshot for overall layout.
--gridwhen you need to click something and coordinates are not obvious.zoomon a region to read small text,zoom --gridwhen it must be clicked.screenshot --original(read withimage_max_width: 0) when small detail is needed across many regions at once and zooming one by one costs more rounds — full resolution costs many more tokens, so prefer zoom first.- Only then click, using the coordinates read off the image you last looked at.
Coordinates
X Yare pixels of the image you last looked at, origin at its top-left corner.- Always pass
--from <that png>. Without it the script falls back to the most recent screenshot if it is under 120 seconds old; otherwise it fails and you must screenshot again. - Never carry coordinates over from an older screenshot — the window may have moved.
Commands
| Command | Notes |
|---|---|
screenshot [--out PATH] [--display N] [--max-width W] [--grid [STEP]] | prints image size, scale, display origin; --grid blends labelled pixel lines |
zoom x1,y1,x2,y2 [--out PATH] [--grid [STEP]] | crop + upscale for reading small text |
click X Y [--from IMG] [--button left/right/middle] [--count 1-3] [--mods cmd,shift] | |
move X Y [--from IMG] | |
drag X1 Y1 X2 Y2 [--from IMG] | |
scroll X Y --dx N --dy N [--from IMG] | |
type "text" | types into the focused field |
key "cmd+shift+t" [--repeat N] | |
hold "shift" --duration 1.5 | holds modifiers while other actions run |
cursor | the pointer position: Windows reads it, macOS reports unknown |
activate "AppName" [--wait SECONDS] | brings an app to the front, no automation grant needed |
doctor | platform, backend and permission self-check |
Safety
- Ask the user before changing system, browser or application settings, and before anything destructive (deleting files, sending messages, installing software).
- Exit codes:
0ok ·2permission missing or backend unusable ·3screenshot state missing or stale ·4disabled by~/.clacky/computer.yml. - On a permission error, relay the System Settings → Privacy & Security grant it asks for and wait for the user. Do not retry in a loop.


