# agent-desktop

> Computer use CLI letting AI agents control the desktop via accessibility APIs.

- Type: agent or tool
- Field: Automation & Workflows
- Repository: https://github.com/vercel-labs/agent-desktop
- GitHub stars: 27091
- Licence: Apache-2.0
- Language: Rust
- Last push: 2026-11-27
- Page: https://imutechz.in/agents/agent-desktop

## What it is
agent-desktop is a CLI and C library that lets AI agents control desktop applications on macOS, Windows, and Linux through OS accessibility APIs. It reads the accessibility tree of a target app and returns it as JSON with actionable refs for each interactive element. The agent uses these refs to click, type, or set values, then takes a new snapshot to verify the result. The tool has no built-in model; the control loop runs in the agent.

## Features
- Reads accessibility tree (AX API, UI Automation, AT-SPI) and returns JSON with refs
- Supports click, type, set-value, clipboard-set, and snapshot commands
- Headless operation by default with optional --headed flag for physical input
- Refs scoped to snapshots with stale/ambiguous detection
- Ships as global npm CLI, Homebrew package, and native binaries
- Includes agent skills for desktop and platform-specific guidance

## Best for
- AI agents needing desktop automation without screenshots
- Cross-platform GUI testing via accessibility APIs
- Automating legacy or non-scriptable desktop apps
- Agents that verify actions by re-reading UI state

## Pros
- No pixel matching or screenshots required
- Works on macOS, Windows, and Linux
- Refs include available actions for each element
- Provides agent skills for integration guidance

## Cons
- Requires accessibility permissions on macOS
- Refs become stale when UI changes, requiring new snapshots
- Multiple windows can cause ambiguous targets needing --window-id

## Install
```
npm install -g agent-desktop
```

## Usage
```
agent-desktop snapshot --app Finder -i
```

Tags: accessibility-api, desktop-automation, ai-agent, cli-tool, cross-platform, ui-automation, vercel-labs, computer-use
