Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

agent-desktop-ffi

Skill by vercel-labs

Agent-desktop-ffi exposes agent-desktop's operations as a C-ABI library. Developers call it from Python, Swift, Node, Go, C++ or Ruby instead of spawning the CLI for each call.

  • Score 89
  • 28k stars
  • Apache-2.0
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install agent-desktop-ffi

Built from the published package, never by AI.

git clone --depth 1 https://github.com/vercel-labs/agent-desktop /tmp/agent-desktop && mkdir -p ~/.claude/skills && cp -r /tmp/agent-desktop/skills/agent-desktop-ffi ~/.claude/skills/agent-desktop-ffi

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install agent-desktop-ffi in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

Agent-desktop-ffi builds a cdylib named libagent_desktop_ffi from agent-desktop's PlatformAdapter. Host programs load the library and call ad_* functions directly, rather than starting the CLI binary for every operation. The source names Python ctypes, Swift, Node ffi-napi, Go cgo, C++ and Ruby fiddle as consumers. A typical observe-act flow starts with ad_init, creates an adapter, takes a snapshot, and runs an action on a qualified ref such as @s8f3k2p9:e5. It then frees the strings and destroys the adapter.

The library returns the same JSON envelope as the CLI and provides a last-error contract, ownership rules and a threading model. Desktop mutations take the same cross-process lease as the CLI. The source is aimed at developers who build desktop automation or agent tooling in these host languages and want in-process access to the platform adapter.

Written from the project's SKILL.md and checked against it.

What it can do

  • ad_initChecks that the header and dylib ABI major versions match before other calls.
  • ad_snapshotReturns a CLI-style JSON envelope with snapshot-qualified refs for interactive elements.
  • ad_execute_by_refResolves a qualified ref, runs a preflight check, and performs the requested action.
  • ad_adapter_create_with_sessionCreates an adapter whose ref persistence is scoped to a session namespace.
  • ad_waitBlocks until a pause, element, window, text or surface condition is met, up to a timeout.
  • ad_list_displaysLists displays so callers can pick a screenshot target by index.
  • ad_trace_showReturns the session's merged trace timeline as a JSON envelope.
  • ad_set_log_callbackRegisters a process-wide callback that receives tracing events as JSON.

What you need

  • Rust toolchain with Cargo to build the cdylib
  • A host language such as Python, Swift, Node, Go, C++ or Ruby
  • macOS, Linux or Windows

Try asking

  • Use the agent desktop FFI to snapshot the Finder window and list its refs.
  • Click the element @s8f3k2p9:e5 using ad_execute_by_ref in my Python script.
  • Wait for a window titled Settings to appear, then take a snapshot.

Good to know

  • Window targeting, skeleton mode and --root drill-down are not exposed over the ABI.
  • Exact-ref actions and resolve_element_exact always fail with ACTION_NOT_SUPPORTED.
  • A session with the overlay enabled cannot start a cursor overlay from a host process.
  • Calls without a policy input, such as mouse events and clipboard writes, act with no headless check.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: skills/agent-desktop-ffi/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • SKILL.md12 KB
  • references/build-and-link.md9 KB
  • references/error-handling.md9 KB
  • references/ownership.md9 KB
  • references/threading.md6 KB

Alternatives to agent-desktop-ffi

All alternatives →
openclaw-github-repo-commandersickn33
94

Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.

AAA Skill 50k
gradiogradio-app
94

Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.

AAA Skill 44k
hig-components-menussickn33
94

Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.

AAA Skill 50k
fastapi-templateswshobson
94

Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.

AAA Skill 43k
appfunctionsandroid
94

Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.

AAA Skill 11k
agent-qa-authoringsickn33
94

Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.

AAA Skill 50k

Compare with openclaw-github-repo-commander, gradio or hig-components-menus

agent-desktop-ffi: common questions

Why use the FFI instead of the agent-desktop CLI?

The source says the FFI lets consumers call ad_* functions directly instead of spawning the CLI binary per call. It exposes the same operations as the CLI.

Why does the release-ffi profile exist?

The default release profile uses panic = abort, which would SIGABRT the host on a Rust panic. release-ffi keeps panic = unwind, which the panic traps need.

How do I avoid leaking snapshot or result strings?

Free each returned JSON string with ad_free_string and release action results with ad_free_action_result. The source's ownership reference describes who allocates and frees each pointer.

How do I install agent-desktop-ffi?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is agent-desktop-ffi free?

The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.

Is agent-desktop-ffi safe to use?

It scores 89 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to agent-desktop-ffi?

Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.

agent-desktop-ffi Install

Add to stack

Loading.