Skip to content

feat: playwright-cli command compatibility (v0.2.0)#1

Merged
drakulavich merged 19 commits into
mainfrom
feat/playwright-cli-compat
Apr 26, 2026
Merged

feat: playwright-cli command compatibility (v0.2.0)#1
drakulavich merged 19 commits into
mainfrom
feat/playwright-cli-compat

Conversation

@drakulavich
Copy link
Copy Markdown
Owner

Summary

  • Bowser becomes a drop-in command-compatible alternative to Microsoft playwright-cli for the core agent loop (17 commands).
  • Clean break: ref format is bare eN (no @), snapshot output is aria-tree YAML, bowser snap → bowser snapshot, bowser session list/show → bowser list. Full migration table in CHANGELOG.md.
  • Adds goto, type, press, hover, select, check, uncheck, screenshot, go-back, go-forward, reload. -s=name / --session=name both accepted.

Design: docs/superpowers/specs/2026-04-26-playwright-cli-compatibility-design.md
Plan: docs/superpowers/plans/2026-04-26-playwright-cli-compatibility.md

Test plan

  • bun test — 71 pass, 10 skipped (e2e gated), 0 fail
  • bun build src/cli.ts --compile --outfile dist/bowser succeeds
  • ./dist/bowser --help prints the new command surface
  • BOWSER_E2E=1 bun test against real Chromium (requires Bun ≥ 1.3.12 on CI host)
  • Manual: bowser open https://example.com && bowser snapshot && bowser close

🤖 Generated with Claude Code
via Happy

drakulavich and others added 19 commits April 26, 2026 13:52
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>
@drakulavich drakulavich merged commit 577cc39 into main Apr 26, 2026
4 checks passed
@drakulavich drakulavich deleted the feat/playwright-cli-compat branch April 26, 2026 11:59
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