agent-desktop: How Vercel's CLI Gives AI Agents a Desktop

2026-11-09
A CLI and C library that turns the accessibility tree into refs an agent can click. What works, what breaks, and why the missing planner is the point.
Most AI computer use tools watch pixels. They take a screenshot, guess where the button is, and click at coordinates. It works until a window moves, a theme changes, or a dialog appears half a second late.
agent-desktop takes a different route. The Vercel Labs project reads the operating system's accessibility tree, the same structure screen readers use, and hands the agent a list of elements with stable references. The agent clicks a reference, takes a new snapshot, and checks what changed. No pixel matching anywhere in the loop.
It hit the top of GitHub's daily trending list on November 3 with roughly 2,275 stars in a day, taking the repository to about 9,874 stars since it was created in February.
What agent-desktop Does Differently
The project is a CLI plus a C library, written in Rust, licensed under Apache 2.0, and shipped for macOS, Windows and Linux. Both the command line and the in-process library call the same core.
The design choice that matters: the agent loop stays in your agent. agent-desktop doesn't ship its own planner, model or orchestration. It exposes commands that observe the screen and act on it, prints one JSON envelope per call, and gets out of the way. You bring the model and the loop.
That's a smaller product than it sounds, and a more useful one. Most computer use frameworks bundle a vision model, a task planner and a screenshot pipeline into one opinionated stack. agent-desktop is closer to a driver: dumb, precise, and reusable inside whatever setup you already built.
How the Accessibility Tree Replaces Pixel Matching
So what does the agent actually see? Every desktop app exposes a tree of roles, names and available actions through the OS accessibility API. A button is a button. A text field is a text field. A checkbox knows whether it's checked.
A snapshot from agent-desktop returns that tree as JSON, with a reference for every element an agent can act on. The agent then runs a command against a reference, like a click on one node, and takes another snapshot to verify the result. Because the reference points at a semantic object rather than a location, a resized window or a different theme doesn't break the action.
The trade-offs are real. Apps with poor accessibility support expose almost nothing, and games or canvas-based interfaces are effectively invisible. Dense apps like Slack produce enormous trees, which is why the tool ships a skeleton mode: map the window first, then drill into one region at a time.
Installing the agent-desktop CLI
Installation is one npm command:
npm install -g agent-desktop
agent-desktop version
Bun, Yarn and pnpm install the same package, and it bundles native binaries for x64 and ARM64. If you'd rather skip the JavaScript launcher, the project publishes native archives on GitHub Releases, and the release also ships the FFI library for calling the tool in-process.
Platform setup is where people get stuck, so here's the short version:
| Platform | Requirement | Notes |
|---|---|---|
| macOS | Accessibility permission | Run agent-desktop permissions --guide |
| Windows | No grant for apps at your terminal's integrity level | Elevation mismatches still block input |
| Linux | Graphical session with at-spi2-core | X11 gets full input; Wayland is partial |
On Linux, clipboard access needs wl-clipboard under Wayland, and mouse input is X11 only unless you run headed. Those are the two gaps that surprise people.
What an Agent Loop Looks Like
The loop is observe, act, observe. A minimal session against Finder looks like this:
agent-desktop snapshot --app Finder -i
agent-desktop click @s8f3k2p9:e8
agent-desktop snapshot --app Finder -i
The -i flag limits the snapshot to interactive elements, which keeps the output readable. References belong to the snapshot that produced them, so a bare @e8 gets rejected with an invalid arguments error, and a stale reference returns a specific error code telling you to take a new snapshot.
That strictness is the feature. Most pixel-based agents fail silently: they click the wrong thing and report success. agent-desktop fails loudly, with error codes for ambiguous targets, stale references and missing windows. The docs also spell out which errors are safe to retry, which is more thought than most tools put into failure.
Headless is the default. Actions go through the accessibility API without moving the pointer or stealing focus, so an agent can work while you use the machine. The global --headed flag allows real input when a task needs it.
Where AI Desktop Automation Breaks
The failure modes are predictable once you see the architecture.
Apps that draw their own UI, including most games, Electron apps with custom rendering, and anything built on a canvas, expose little to the accessibility tree. The agent sees a blank window and hasn'thing to click.
Timing is the second problem. A click that opens a dialog returns before the dialog renders, so the next snapshot may catch a half-built state. The tool has a wait command, and you'll use it more than you expect.
The third is permissions. macOS requires an explicit accessibility grant, and that grant follows the terminal or the launcher, not the binary. Update your terminal and you may have to grant it again.
Practical Uses, Including Android Development
The obvious use is test automation for desktop software, where a semantic tree is more stable than screenshot diffs. QA teams that already script Selenium or Playwright will recognize the shape.
The less obvious one is Android development. Android Studio, Gradle daemons and emulator managers are desktop apps, and an agent that can read their windows can start an emulator, wait for boot, run a build and read the log pane without a human clicking through menus. If your workflow is "build, install, test on device," the desktop side of that loop is exactly what agent-desktop automates.
For phone-side AI desktop automation, the equivalent on Android is an accessibility service, which is how automation apps drive other apps on a handset. agent-desktop doesn't target Android devices, and it doesn't pretend to. It drives the computer you develop on.
Privacy and Permissions
Snapshots contain everything on screen: window titles, document names, message previews, clipboard contents. The project's own documentation warns that snapshots, clipboard reads, screenshots, command output and debug artifacts can contain private desktop content and should stay out of public logs and uploads.
That warning deserves weight. An agent that reads your desktop reads your email subject lines, your calendar and whatever else happens to be visible. The optional JEV helper sends screen descriptions to a configured model provider, which is a separate component from the native CLI and a separate privacy decision.
If you run this on a work machine, check whether your company allows an agent to read screen contents through the accessibility API. In many organizations that counts as monitoring software, and the answer is no.
The Verdict on agent-desktop
This is the most sensible architecture for computer use I've seen from a major lab, mostly because it refuses to do the hard part. No vision model, no planner, no opinion about how your agent should think. Just a reliable way to see and touch desktop apps, with error codes honest enough to build on.
It won't work on games, it won't work on poorly built apps, and it needs a permission grant that will annoy you at least once. For automating developer tools, internal dashboards and anything with decent accessibility support, it's a better foundation than clicking coordinates and hoping.
Install it from npm, run agent-desktop skills get desktop before your first session, and start with one app you understand. The agent will do the rest, badly at first, then well enough that you stop watching.