agent-desktop FAQ

July 20, 2026 ยท View on GitHub

What is agent-desktop?

agent-desktop is a native desktop automation CLI for AI agents. It lets agents observe and control desktop apps through OS accessibility trees, using structured JSON instead of screenshots, pixel matching, or browser-only automation.

Does agent-desktop require screenshots or pixel matching?

No. The core workflow reads native accessibility trees and assigns refs to interactive elements. Screenshots are available as a separate command, but agents do not need screenshots or pixel matching to click buttons, type into fields, inspect menus, or navigate app windows.

How does agent-desktop work?

ComponentFunction
Native Rust CLIFast, single binary, no runtime dependencies
C-ABI cdylibLoad once from Python, Swift, Go, Ruby, Node, or C instead of forking
58 CommandsObservation, interaction, keyboard, mouse, notifications, clipboard, window management, session lifecycle, trace read/export, and bundled skills docs
Snapshot & RefsCompact snapshot IDs and deterministic element refs like @e1, @e2
Structured JSONMachine-readable responses with error codes and recovery hints

What makes agent-desktop useful for AI agents?

FeatureBenefit
Progressive Skeleton Traversal78โ€“96% token reduction on dense apps
Headless-by-Default ActionsRef actions use accessibility APIs and block unintended physical side effects
Snapshot RefsAgents act on stable refs within a snapshot instead of guessing coordinates
Recovery HintsErrors include machine-readable codes and suggestions for the next agent step
Cross-Language FFIPython, Swift, Go, Ruby, Node, C, and C++ hosts can call the native library directly

Which platforms are supported?

FeaturemacOSWindowsLinux
Accessibility treeYesPlannedPlanned
Click/type/keyboardYesPlannedPlanned
Mouse inputYesPlannedPlanned
ScreenshotYesPlannedPlanned
ClipboardYesPlannedPlanned
App/window managementYesPlannedPlanned
NotificationsYesPlannedPlanned

How do I install agent-desktop?

Install the CLI from npm:

npm install -g agent-desktop
agent-desktop snapshot --app Safari

Build the FFI library from source:

cargo build --profile release-ffi -p agent-desktop-ffi
# Outputs under target/release-ffi/: libagent_desktop_ffi.dylib/.so or agent_desktop_ffi.dll

What is the ref system?

snapshot assigns qualified refs to interactive elements in depth-first order, such as @s8f3k2p9:e1. The embedded snapshot ID removes the separate --snapshot flag. Snapshot lookup remains confined to the selected namespace, so refs created under a session still require that session's --session or AGENT_DESKTOP_SESSION scope. Legacy bare refs such as @e1 require an explicit --snapshot in the same namespace.

Interactive roles that receive refs:

button, textfield, checkbox, link, menuitem, tab, slider, combobox, treeitem, cell, radiobutton, incrementor, menubutton, switch, colorwell, dockitem.

Stale ref recovery:

snapshot -> act -> STALE_REF? -> snapshot again -> retry

Is agent-desktop free and open source?

Yes. agent-desktop is Apache-2.0 licensed for personal and commercial use.

Where can I get help?

ResourceLink
Repositorygithub.com/lahfir/agent-desktop
ClawHub Skillclawhub.ai/lahfir/agent-desktop
skills.sh Listingskills.sh/lahfir/agent-desktop/agent-desktop
npm Packagenpmjs.com/package/agent-desktop
CI StatusGitHub Actions
ReleasesGitHub Releases
IssuesGitHub Issues