Skip to content

CLI commands for scripting and automation#2

Merged
ignaciotcrespo merged 4 commits into
mainfrom
electron-disable
Apr 17, 2026
Merged

CLI commands for scripting and automation#2
ignaciotcrespo merged 4 commits into
mainfrom
electron-disable

Conversation

@ignaciotcrespo
Copy link
Copy Markdown
Owner

CLI commands for scripting and automation

Add command-line flags so compose-preview can be used headlessly from scripts, CI, and other tools — without launching the TUI.

New flags

Flag Description
--list / -l Output all discovered @Preview composables as JSON to stdout
--run <name> / -r Launch a specific preview on a connected device (supports exact name, FQN, or partial match)
--screenshot <name> Launch a preview and capture a device screenshot to PNG
--output <file> Set screenshot output path (default: preview.png)
--delay <seconds> Wait time before capturing screenshot (default: 3s)
--port <port> / -p Set web viewer port (default: 9999)

Other changes

  • Rename [b] build keybinding to [i] install
  • Install task picker now uses a selectable modal list (same as device picker) instead of inline prompt
  • Install task discovery is async — modal shows loading state immediately
  • Disable Electron build workflow (manual trigger only)
  • Update README with all current features, new CLI flags, and corrected Homebrew install instructions

Example usage

# List all previews as JSON
compose-preview --list | jq '.[].fqn'

# Run a preview headlessly
compose-preview --run SplashScreenPreview

# Capture a screenshot for CI/docs
compose-preview --screenshot LoginPreview --output login.png --delay 5

# Web preview on custom port
compose-preview --web --port 8080

@ignaciotcrespo ignaciotcrespo merged commit fc797f0 into main Apr 17, 2026
3 checks passed
@ignaciotcrespo ignaciotcrespo deleted the electron-disable branch April 18, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant