-
Notifications
You must be signed in to change notification settings - Fork 4
How it works
setapp-cli is a single Swift binary with two data sources:
-
Setapp's SQLite database -- read-only access to
~/Library/Application Support/Setapp/Default/Databases/Apps.sqlitefor app metadata (names, bundle identifiers, numeric app IDs). -
Setapp's XPC service -- connects to
com.setapp.AppsManagementServicevia Setapp'sSetappInterface.frameworkto install and uninstall apps programmatically.
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.
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 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.
setapp-cli