Add a kapture CLI so agents can capture windows and screens

kapture capture --app <name> (or --window-id / --screen) writes a PNG and
prints its path; kapture list enumerates on-screen windows. The CLI is a
thin client: requests go to the running menu-bar app over distributed
notifications plus JSON files in Application Support, so captures use the
app's Screen Recording grant and its window/display logic — no second
permission. The app launches automatically when needed, and the bundled
CLI opens its own app bundle rather than a stale installed copy.

Built as `kapture-cli` (Kapture/kapture collide on the case-insensitive
filesystem), signed nested in the app bundle, and installed on PATH as
`kapture` by the Homebrew cask's binary stanza.

Generated with OpenCode

Assisted-by: Kimi:k3
This commit is contained in:
2026-10-27 23:38:43 +08:00
parent cac85402a3
commit 6f8f436987
5 changed files with 488 additions and 3 deletions
+1
View File
@@ -42,6 +42,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
}
}
HotkeyManager.shared.register()
CLIService.shared.start()
}
func applicationWillTerminate(_ notification: Notification) {