feat(cli): add --no-open flag to preview and play commands
Problem
hyperframes preview and hyperframes play always open the system default browser on startup.
This is problematic for agent-driven workflows where the browser session is managed separately (e.g., Chrome DevTools Protocol, remote debugging, headless automation).
When an agent or script starts a preview server, the automatically opened browser window:
- Conflicts with an existing managed browser session
- Cannot be easily closed without human intervention
- Breaks automated test pipelines that expect no GUI
Proposed Solution
Add a --no-open flag to both preview and play commands:
npx hyperframes preview --no-open
npx hyperframes play --no-open
This should start the server without calling open() (or equivalent) to launch the browser.
Why This Matters
HyperFrames is positioned as agent-oriented. Agents often need to control the browser lifecycle explicitly. Automatically opening the default browser makes agent-driven workflows brittle.
A concrete scenario: an agent runs hyperframes preview --no-open, waits for HTTP 200, then connects via Chrome DevTools Protocol on a separate managed browser instance. The current behavior makes this impossible without manual cleanup.
Scope
packages/cli/src/commands/preview.ts— guard all 4import("open")calls behind the flagpackages/cli/src/commands/play.ts— guard theimport("open")call behind the flag- Both commands should accept
--no-openas a boolean argument, defaulting tofalse
Alternative
A --browser <browser> flag would also help, but --no-open is the smallest and safest primitive that covers the agent use case without changing existing behavior for human users.
Opened in wrong repo. Will reopen from fork.