# agent-desktop (Vercel Labs) — AX-tree CLI for native apps, driven from the terminal An alternative to `computer_use` when you need a scriptable, headless (no mouse/keyboard/focus) way to read and click native macOS/Windows/Linux apps through the accessibility tree. Apache-2.0, `npm` package `agent-desktop`, docs https://agent-browser.dev/desktop. No model inside; you drive it with shell commands. ## Install / status - `npm install -g agent-desktop`. If the global prefix is root-owned (`EACCES` on `/usr/local/lib/node_modules`), install to a user prefix instead of `sudo`: `npm install -g --prefix ~/.npm-global agent-desktop` and `export PATH="$HOME/.npm-global/bin:$PATH"` in every call that uses it (the gateway's PATH does not carry it). - `agent-desktop version` / `agent-desktop status` (JSON). `status.data.permissions.accessibility` must be `granted`; the permission belongs to the PROCESS that runs the command (Hermes's TCC anchor already covers calls from Hermes tools — `permissions --guide` prints `not_needed`). From another terminal app the user grants it there; never click the dialog for them. ## Recipe: find → click by ref → read back (no mouse movement) ```bash A=Calculator; open -a $A; sleep 1.5 ref() { agent-desktop find --app $A --role button --name "$1" --exact | python3 -c 'import json,sys; m=json.load(sys.stdin)["data"]["matches"]; print(m[0]["ref_id"] if m else "")'; } agent-desktop click "$(ref 7)"; agent-desktop click "$(ref Multiply)"; agent-desktop click "$(ref 6)"; agent-desktop click "$(ref Equals)" agent-desktop snapshot --app $A -i | grep -o '"native_id":{[^}]*}' | grep value # e.g. StandardInputView;value:42 ``` - Refs are per-snapshot (`@:e`); re-`find`/`snapshot` after every action, never reuse. - Buttons are often only reachable by exact AX name; if `find --name` misses (e.g. the Clear key on newer macOS), list `find --app X --role button` and pick from the names instead of guessing. - Values that are not exposed as text land in `native_id.value` (ax_identifier) — grep there before concluding the result is unreadable. - Region snapshots are the token saver: `snapshot --root --compact` is ~30× smaller than the whole window; `--skeleton` barely helps on small apps. Quote the vendor's token numbers as claims. - `agent-desktop skills get desktop|platform` prints the tool's own agent rules; read `platform` once. ## Rules (same red lines as computer_use) Only apps opened for the task; never Messages/Mail/Photos/Passwords/health/browser sessions or personal folders. Snapshots are not logged or copied into notes (they can contain personal data). `--headed` (real input) only with explicit user permission, never as a fallback for a failed headless click. No permission dialogs clicked by the agent. Not wired into cron/automation without a separate decision.