# amcu — another macOS computer use A single dependency-free binary that lets an AI agent read and drive macOS applications and web pages **without taking over the screen**: the cursor does not move, focus does not change, windows are not raised. You keep using the Mac while the agent works. ```console $ amcu snapshot --app com.apple.TextEdit app: TextEdit [com.apple.TextEdit] window: Untitled id=8471 frame=(320,180 700x520) 0 Window [StandardWindow] "Untitled" @0,0 700x520 1 ScrollArea @0,52 700x468 2 TextArea = "" (focused) @0,52 700x468 3 Button "Close" @12,12 14x14 $ amcu set-value --element 2 --value "hello" set-value ok on element 2 via ax:AXValue (verified) (settled 0.4s) # diff vs previous snapshot: ~1 changed, +0 added, -0 removed ~ 2 TextArea = "hello" (focused) @0,52 700x468 ``` ## Why it is different - **Structure first, pixels last.** The accessibility tree gives roles, labels, values and actions: an order of magnitude fewer tokens than a screenshot, and element indices that survive the window moving. When a window draws its own interface and publishes nothing, `amcu scan` falls back to OCR and coordinate clicks, in the same index space. - **Background delivery that actually lands.** Coordinate clicks, scrolls and drags are posted to the target process and routed to its window (window-id fields plus `CGEventSetWindowLocation`). The real pointer never moves. Because that path relies on a private symbol, `amcu doctor` verifies once per OS build that a routed click lands where it was aimed, and coordinate clicks are refused rather than allowed to misfire. - **Every action reports what happened.** Actions wait for the application to stop emitting accessibility notifications, then re-capture and print only the diff (`~` changed, `+` added, `- [a..b]` removed, or `# no change`). Indices stay stable across captures. Writes are read back and a mismatch is an error, not a caveat. A background input that stole focus is reported instead of hidden. - **Your own browser, no relay.** `amcu browser` drives tabs in your Chrome (or any Chromium) through a small extension that talks to amcu over native messaging: no debug port, no token, no separate profile, logged-in sessions intact. Pages are read as an outline with stable refs; input goes through the debugger protocol so it reaches tabs that are not even visible. Safari works too (`--browser safari`), through a container app amcu builds and a Safari Web Extension; Safari offers extensions no debugger, so input there is synthetic and console/network/dialogs are not available. - **A stage for the windows it drives (and windows you tuck away).** `amcu stage put --app …` moves a window onto a virtual display amcu adds off the corner of your screen: fully drawn, so screenshots stay current, yet never in front of you, and the cursor is kept out. While it runs, an amcu app sits in your Dock: one window with a tab per staged window (a browser profile's windows share one), along the top or down the left as you like, each showing the window live, what agents are doing to it and which session, and a browser window's tabs (clickable to switch or close directly); click the picture to take that window over, hand it back when you are done — or let an agent take it back by acting on it. You can also tuck windows in directly via the `+` window picker (`⌘N`), workspace presets (`amcu stage preset`), the browser extension popup's "Move to Stage" button, or global hotkeys (`⌥⌘S` / `⌥⌘W`); `amcu stage install-app` installs a standalone `~/Applications/amcu Stage.app` that launches from Spotlight with its own permissions. When an agent needs you for a password or a code from your phone, its tab turns orange with what to do and the Dock icon shows a badge. Links you open from other apps never land in a browser window on the stage: they go to the window you used last. The display is kept by a process of its own, so upgrading amcu never drops the windows on your screen. It rests on CoreGraphics' private `CGVirtualDisplay`, resolved at runtime; without it the rest of amcu is unaffected. - **Refuses instead of guessing.** Disabled controls, stale indices, ambiguous app names, password managers, foreground delivery to a background app: each is a structured error with a code and concrete next steps. Never a silent no-op. ## Install Requires macOS 14 or later. Releases ship a universal binary. ```bash curl -fsSL https://raw.githubusercontent.com/uoox/amcu/main/Scripts/install.sh | sh amcu doctor --request # macOS prompts for Accessibility (and Screen Recording for screenshots) amcu doctor # every line should read [ok] ``` Permissions belong to **whatever runs amcu** (your terminal or the agent host), not to the binary; `doctor` names that host on its `subject:` line. For web pages: `amcu browser install`, then load the unpacked extension it names in `chrome://extensions` — once in every profile you want driven. Each profile is then its own connection: `amcu browser profiles` lists them, `--profile NAME` picks one, and a command that could mean several is refused rather than sent to the first. For Safari: `amcu browser install --browser safari`, then the three Safari settings it prints (allow unsigned extensions, enable the extension, allow it on all websites). From source: `swift build -c release` (Command Line Tools are enough) and copy `.build/release/amcu` onto your PATH. Do not put it in a package manager's prefix. ## Use `amcu skill --install` writes a SKILL.md into `~/.agents/skills/amcu` (or `--dir` for other hosts) that tells agents amcu **is** the computer-use and browser-use tool on this machine and comes before any other automation path. The guide (`amcu guide`, `amcu browser guide`) ships inside the binary and is the authoritative usage contract; a CLAUDE.md line is enough: *use `amcu` for desktop apps and `amcu browser` for web pages; run `amcu guide` first.* ```bash amcu apps --recent # running apps, plus recently used ones with bundle ids amcu launch --app com.apple.Notes # start without activating; waits for a real window amcu snapshot --app com.apple.Notes # indexed accessibility tree amcu snapshot --app com.apple.Notes --query /save/ # matching elements + ancestors amcu click --element 12 # semantic press; prints the settled diff amcu set-value --element 7 --value "text" # written through AX, read back, verified amcu type --app com.apple.Notes --text "…" # keystrokes, land on the app's own focus amcu key --app com.apple.Notes --key s --mod cmd amcu menu-item --app com.apple.Notes --path "File > Export" amcu scroll --app com.apple.Notes --dy -300 amcu screenshot --app com.apple.Notes --out shot.png amcu stage put --app com.apple.Notes # onto a display you never see; every verb still works printf '%s\n' '{"cmd":"click","element":3}' '{"cmd":"type","text":"hi"}' | amcu batch --app com.apple.Notes amcu browser tabs amcu browser tab --new --url https://example.com amcu browser snapshot # outline with [ref=e12] amcu browser click --ref e12 amcu browser fill --ref e7 --value "query" --submit ``` `--json` on any command gives structured output on stdout and structured errors on stderr. `--session NAME` keeps concurrent agents from sharing snapshot state. `~/.config/amcu/policy.json` extends the deny/allow lists and settle timing; `amcu policy` shows what is in effect. ### Resume a workspace, verify a state ```bash amcu browser profiles # also remembers verified profile identities amcu browser profiles --known # includes disconnected recorded profiles amcu browser launch --profile shop # explicit reopen; never installs or logs in amcu browser tab --new --stage --profile shop --url https://example.com amcu browser task save --name daily --profile shop --tab 123 --stage amcu browser task status --name daily # read-only; never starts a browser amcu browser task resume --name daily --launch-missing --open-missing amcu browser check --role checkbox --name "Enabled" # at most one click, read-back verified amcu browser wait --selector '#result' --state visible --timeout 10 ``` Task resume only launches explicitly requested missing profiles, opens explicitly requested missing pages, and binds sessions. It never runs site actions or claims the site is logged in. A task can hold one entry per profile; saving another profile adds it. URLs, including query strings, are stored privately under `~/.config/amcu/browser/` and may contain sensitive tokens. Exact-URL ambiguity is refused. A stage work window is owned by one profile and identified with a unique extension marker, never guessed from matching page titles. Existing user windows are not moved by task resume. macOS can ignore a new window’s initial coordinates: its uniquely identified marker window may appear briefly before stage registration; the command warns instead of claiming invisibility. For `click`, `check` and `uncheck`, use a snapshot ref **or** a unique live locator (`--selector`, exact `--role` / `--name`, or their intersection). Ambiguity and stale refs fail rather than clicking the first match. `check`/`uncheck` are idempotent. Clicks report state read-back separately from mere input delivery; mutation counts are not semantic verification. An eval blocked by a JavaScript dialog returns promptly as incomplete; accepting one dialog never accepts the next for you. `amcu lab` starts a disposable Chrome with the DevTools protocol exposed, for extension development and network interception. It is not for automating pages that resist the normal path. ## Development This project is developed by AI agents. `CLAUDE.md` is the entry point; `docs/ARCHITECTURE.md` maps every module and `docs/DESIGN.md` records the decisions. `swift run -c release amcu-tests` runs the unit suite; `AMCU_E2E=1 Tests/e2e/run.sh` runs the live AppKit scenarios. ## License MIT. See `LICENSE`.