feat: playwright-cli command compatibility (v0.2.0)#1
Merged
Conversation
Clean-break redesign of the bowser CLI surface so it becomes a drop-in command-compatible replacement for Microsoft playwright-cli for the core agent loop (17 commands). Engine reused; CLI layer and snapshot output formatter rewritten. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
11-task TDD plan, bite-sized steps, file-by-file. Foundation tasks (state, snapshot, parser) before commands; commands before CLI dispatch; docs/version bump last. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds CommandContext.flags, renames cmdSnap→cmdSnapshot, adds cmdGoto and cmdList, drops cmdSession, adds detect injection to cmdInstall. Updates tests to use new ctx() helper with flags field. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ncheck/screenshot/history) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rewrites src/cli.ts to use the new parser/schemas and wire all 18 commands (install, open, goto, close, snapshot, click, fill, type, press, hover, select, check, uncheck, screenshot, go-back, go-forward, reload, list) with correct exit-code policy (1 for user errors, 2 for unexpected). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace cmdSnap with cmdSnapshot, add flags: {} to all CommandContext
literals, update snapshot assertions to aria-tree YAML format.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
Playwright's headless-shell distribution uses the binary name 'chrome-headless-shell' on every platform, not 'headless_shell'. detectChromium() never found the bowser-managed install on macOS as a result. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
- Run unit tests on Ubuntu + macOS. - Pin Bun to >=1.3.12 (Bun.WebView requirement). - Use --frozen-lockfile so CI fails on uncommitted lockfile changes. - Add a build job that compiles the single-file binary. - E2E job now locates the installed chrome-headless-shell and passes it via BOWSER_CHROMIUM_PATH so HOME-redirected tests find it. - Add concurrency cancel-in-progress and workflow_dispatch trigger. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
CI runners ship with system Chrome at /usr/bin/google-chrome, so 'bowser install' would skip the download. The e2e tests redirect $HOME, which makes the system install invisible — they need the bowser-managed cache. --force guarantees it. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
- Extract loadRef() helper to replace the 6-way duplicated loadState/guard/resolveRef prelude across click/fill/hover/select/ check/uncheck/screenshot. - Extract emptyState() helper for null-state fallbacks. - Hoist loadState() in cmdGoto and cmdHistory before withClient so the FS read overlaps with the daemon connect. - Hoist node:fs/promises, node:os, node:path imports for cmdList. - Remove dead 'flags' field from CommandContext: cli.ts already destructured them into per-command opts; nothing read ctx.flags. - Delete unused clearState() (had a TOCTOU pre-check). 71/71 unit tests pass; 2/2 offline e2e pass against real Chromium. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
…link - Add CI + npm badges. - Move drop-in playwright-cli claim to the very top intro. - 'Why' section now lists differentiators only (no repeat of intro). - Add /usr/bin/chromium-browser to detection order list. - Note --depth is parsed but flat in v0.2. - Migration section linking to CHANGELOG. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
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.
Summary
playwright-clifor the core agent loop (17 commands).eN(no@), snapshot output is aria-tree YAML,bowser snap → bowser snapshot,bowser session list/show → bowser list. Full migration table inCHANGELOG.md.goto,type,press,hover,select,check,uncheck,screenshot,go-back,go-forward,reload.-s=name/--session=nameboth accepted.Design:
docs/superpowers/specs/2026-04-26-playwright-cli-compatibility-design.mdPlan:
docs/superpowers/plans/2026-04-26-playwright-cli-compatibility.mdTest plan
bun test— 71 pass, 10 skipped (e2e gated), 0 failbun build src/cli.ts --compile --outfile dist/bowsersucceeds./dist/bowser --helpprints the new command surfaceBOWSER_E2E=1 bun testagainst real Chromium (requires Bun ≥ 1.3.12 on CI host)bowser open https://example.com && bowser snapshot && bowser close🤖 Generated with Claude Code
via Happy