Skip to content

feat(shots): macOS app capture + Mac App Store canvas framing#784

Merged
rudrankriyam merged 6 commits intororkai:mainfrom
ramonclaudio:feat/macos-capture-mac-canvas
Feb 26, 2026
Merged

feat(shots): macOS app capture + Mac App Store canvas framing#784
rudrankriyam merged 6 commits intororkai:mainfrom
ramonclaudio:feat/macos-capture-mac-canvas

Conversation

@ramonclaudio
Copy link
Copy Markdown
Contributor

@ramonclaudio ramonclaudio commented Feb 25, 2026

Adds Mac App Store screenshot support.

--provider macos grabs the frontmost window of a running macOS app by bundle ID using screencapture -l <windowID>. Window ID comes from a Swift one-liner piped to swift - via CGWindowListCopyWindowInfo. No cgo, no extra binaries.

--device mac renders 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.

# Capture
asc screenshots capture --provider macos --bundle-id com.example.MyApp --name home

# Frame
asc screenshots frame \
  --input ./screenshots/raw/home.png \
  --device mac \
  --title "My App" \
  --subtitle "Your tagline" \
  --bg-color "#f5f5f7" \
  --output-dir ./screenshots/framed

Running --provider macos requires Screen Recording permission for your terminal (Ghostty, iTerm2, Terminal.app) and Xcode Command Line Tools for swift. Both are macOS-only.

Also fixed ASC_TIMEOUT being silently ignored for screenshots capture and screenshots frame. Both now use ContextWithTimeout.

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.

@ramonclaudio ramonclaudio force-pushed the feat/macos-capture-mac-canvas branch from 8cc97cc to df9deb7 Compare February 25, 2026 23:14
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.
@ramonclaudio ramonclaudio force-pushed the feat/macos-capture-mac-canvas branch from 597f496 to e7bc4b3 Compare February 26, 2026 01:20
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.
@rudrankriyam rudrankriyam self-assigned this Feb 26, 2026
@rudrankriyam rudrankriyam added the enhancement New feature or request label Feb 26, 2026
@rudrankriyam rudrankriyam added this to the 0.34.2 milestone Feb 26, 2026
@rudrankriyam
Copy link
Copy Markdown
Collaborator

Just tried it out; really cool!

image

@rudrankriyam
Copy link
Copy Markdown
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.
@ramonclaudio
Copy link
Copy Markdown
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

@rudrankriyam
Copy link
Copy Markdown
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

@rudrankriyam
Copy link
Copy Markdown
Collaborator

I am merging this as it is; can have a follow-up PR for the frames. Awesome work!

@rudrankriyam rudrankriyam merged commit 0524733 into rorkai:main Feb 26, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants