feat(shots): macOS app capture + Mac App Store canvas framing#784
Merged
rudrankriyam merged 6 commits intororkai:mainfrom Feb 26, 2026
Merged
Conversation
8cc97cc to
df9deb7
Compare
Add MacOSProvider that captures a running macOS app window via screencapture -l. Uses an inline Swift script to resolve the CGWindowID by bundle ID, requiring no external tools beyond Xcode Command Line Tools and Screen Recording permission. Build-tagged for darwin; non-darwin returns a clear error.
Add FrameDeviceMac (--device mac) targeting APP_DESKTOP at 2880x1800. Canvas mode renders screenshots on a gradient background without a device bezel, with optional title/subtitle text overlays and color customization via CanvasOptions. Unit tests cover canvas no-text, subtitle-only, and custom-color paths.
Wire the macOS capture provider and mac canvas framing into the CLI. Add --title, --subtitle, --bg-color, --title-color, --subtitle-color flags for canvas-mode devices. Validate canvas flags are rejected on non-canvas devices. Add ContextWithTimeout to capture and frame paths.
597f496 to
e7bc4b3
Compare
Replace the local mac2880 alias with AppDesktop_2880 so ASC relies on upstream Koubou named output sizes instead of maintaining a private preset mapping.
Prevent silent no-op behavior by failing fast when canvas text/color flags are passed with --config, since those flags only apply to auto-generated input mode.
Collaborator
Collaborator
|
I am thinking of adding a frame to it, like how we have for iOS and iPad devices. What do you think? |
Detect missing Swift and common Command Line Tools misconfiguration errors and surface a direct install hint so users get actionable setup guidance instead of blank or vague failures.
Contributor
Author
|
Yea. I tried to keep the PR as lean and un-opinionated as possible so I went without the frame, but we can deff add a '-frame' flag and allow the user to choose. Koubou already has the frames, they just need to be dropped in. https://github.com/bitomule/Koubou/tree/main/src/koubou/frames |
Collaborator
|
I think it would be nice to have the screenshots inside the frame and the text outside, like how it is with the iphone devices. I would love if you can add it! I also moved the presets to Koubou as a PR so the commands act as a wrapper around it |
Collaborator
|
I am merging this as it is; can have a follow-up PR for the frames. Awesome work! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Adds Mac App Store screenshot support.
--provider macosgrabs the frontmost window of a running macOS app by bundle ID usingscreencapture -l <windowID>. Window ID comes from a Swift one-liner piped toswift -viaCGWindowListCopyWindowInfo. No cgo, no extra binaries.--device macrenders to 2880x1800 (APP_DESKTOP) without a device bezel. Screenshot scales to fill the canvas. Optional title/subtitle overlays and background color via--title,--subtitle,--bg-color,--title-color,--subtitle-color. Using canvas flags on a non-canvas device returns an error.Running
--provider macosrequires Screen Recording permission for your terminal (Ghostty, iTerm2, Terminal.app) and Xcode Command Line Tools forswift. Both are macOS-only.Also fixed
ASC_TIMEOUTbeing silently ignored forscreenshots captureandscreenshots frame. Both now useContextWithTimeout.Tested on a regular window app and a menubar panel app. Results looked good so figured I'd open it. Ping me if anything breaks.