Skip to content

prima browser opens a playwright-cli session when none is open - #308

Open
DavertMik wants to merge 1 commit into
mainfrom
prima-browser-open
Open

DavertMik wants to merge 1 commit into
mainfrom
prima-browser-open

Conversation

@DavertMik

Copy link
Copy Markdown
Contributor

What

prima browser used to only print playwright-cli open <url> when no session was open. Now it runs that command itself, then attaches and prints the session as before.

  • Runs playwright-cli open; if the binary is missing, falls back to npx -y @playwright/cli open (the unscoped playwright-cli npm package is deprecated).
  • Opens at --url, else the configured base URL, else a blank page.
  • --pw-session <title> / PLAYWRIGHT_CLI_SESSION is passed as -s=<title>; a named session that is not open yet gets opened even when other sessions exist.
  • Several open sessions with none named still fail asking for --pw-session — no launch.
  • playwright-cli output goes to stderr; stdout stays the single browser: line.
  • Other commands (do, check, …) still never launch a browser.
prima browser --url https://app.example.com
browser: playwright-cli session "default" at /tmp/pw-…/browser-….sock

Testing

  • bun test boat/prima/tests/ — 159 pass; unit tests cover launching when none is open, opening a named session beside others, refusing when ambiguous, and failing when the launch opened nothing.
  • Manual: real launch via installed playwright-cli (~3.4s), second call reuses the session; with playwright-cli removed from PATH the npx fallback opened it (~5.5s).

🤖 Generated with Claude Code

Runs `playwright-cli open`, falling back to `npx -y @playwright/cli open`
(the unscoped `playwright-cli` npm package is deprecated), at --url or the
configured base URL, then attaches. A --pw-session name that is not open yet
is opened under that name; several open sessions with none named still fail
asking for --pw-session.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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