Skip to content

How it works

maximlevey edited this page Feb 28, 2026 · 1 revision

How it works

setapp-cli is a single Swift binary with two data sources:

  1. Setapp's SQLite database -- read-only access to ~/Library/Application Support/Setapp/Default/Databases/Apps.sqlite for app metadata (names, bundle identifiers, numeric app IDs).

  2. Setapp's XPC service -- connects to com.setapp.AppsManagementService via Setapp's SetappInterface.framework to install and uninstall apps programmatically.

XPC connection

The binary loads SetappInterface.framework from Setapp's LaunchAgent bundle at runtime using dlopen. It then creates a connection to the XPC service through AFXRegularInterprocessClientAdaptor, the same adaptor class that Setapp's own tools use internally.

Install and uninstall requests are sent as AFXInstallVendorAppRequest and AFXUninstallVendorAppRequest objects. The app to operate on is identified by its numeric app ID (from the SQLite database), wrapped in an AFXFetchAppByIDRequest to retrieve the full app descriptor before passing it to the install/uninstall request.

No private APIs or accessibility

setapp-cli does not use any macOS private APIs, does not require Accessibility permissions, and does not perform UI automation. It communicates with Setapp's own service layer using the same mechanism that Setapp's LaunchAgent uses.

Installed app detection

Installed apps are detected by scanning /Applications/Setapp/ and ~/Applications/Setapp/ for .app bundles. Setapp uses the first path for admin accounts and the second for standard user accounts.

Clone this wiki locally