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:
+13
-1
@@ -4,10 +4,22 @@ import PackageDescription
|
||||
let package = Package(
|
||||
name: "Kapture",
|
||||
platforms: [.macOS(.v13)],
|
||||
products: [
|
||||
.executable(name: "Kapture", targets: ["Kapture"]),
|
||||
// Command-line client for agents and scripts; talks to the running
|
||||
// menu-bar app over distributed notifications (no extra permissions).
|
||||
// Named kapture-cli because "Kapture" and "kapture" collide on the
|
||||
// case-insensitive filesystem; the cask installs it as `kapture`.
|
||||
.executable(name: "kapture-cli", targets: ["KaptureCLI"]),
|
||||
],
|
||||
targets: [
|
||||
.executableTarget(
|
||||
name: "Kapture",
|
||||
path: "Sources/Kapture"
|
||||
)
|
||||
),
|
||||
.executableTarget(
|
||||
name: "KaptureCLI",
|
||||
path: "Sources/KaptureCLI"
|
||||
),
|
||||
]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user