Show HN: pw-repl - A Playwright-powered REPL for you and your agents to share

  • Posted 2 hours ago by arcanemachiner
  • 1 points
https://github.com/arcanemachine/pw-repl
For the busy people out there, the GitHub repo has a demo video so you can see if this is worth your time: https://github.com/arcanemachine/pw-repl

The video was created by Opus 5.5; I just asked it to create a demo video (it has a 'record' tool), so I think this is a good idea of how well it can work with the tool.

---

pw-repl is a tool that makes it easy for you and your agents to work with Playwright+CDP in a browser (your current headed session, or a headless one, or both at the same time; take your pick).

It's basically a Playwright-powered swiss army knife that helps you and agents poke around your browser: Try out different features of a website, break things (e.g. mock backend responses), take screenshots, record videos, etc.

The GitHub repo shows a video, recorded by an agent using pw-repl: https://github.com/arcanemachine/pw-repl

One cool thing it can do: create videos of bug reports. You can tell an agent about a bug and to use pw-repl to capture it, and it can record a video with the built-in toast feature to narrate its actions, and show a virtual mouse to simulate actions on the screen, as if it were a user. It's also useful for capturing screenshots (which can be combined with the toast and highlight tools to emphasize certain elements or information), and has many useful features that can help agents to use it efficiently.

This isn't intended to be commercialized in any way. It's just a neat tool that I (with Claude's help) cobbled together. It's completely vibe-coded, and is intended mainly as a debugging aid. I use all the time, and hope it may be helpful for others.

It's basically just Playwright + CDP under the hood, but has some extra tools and an interface that make it easier for agents to work with.

The quickest way to try it out is to tell your agent to run `npx pw-repl@latest serve --background --launch`, which starts a headless Chromium of its own. No browser setup needed. (If you don't like such `curl | bash`-esque installation instructions, read the code, or get your agent to take a look at it.)

To use it in your own browser instead, start Chrome with CDP enabled (`chrome --remote-debugging-port=9222 --user-data-dir="$HOME/.config/chrome-debug"`), and tell your agent to run `npx pw-repl@latest serve --background`. (The separate `--user-data-dir` is needed because recent versions of Chrome don't open the debugging port on your default profile.)

It also can generate a skill so that you can just run `/pw-repl do some stuff`. Get your agent to run `npx pw-repl@latest skill > <skills folder>/pw-repl/SKILL.md` (e.g. `~/.claude/skills/pw-repl/SKILL.md` for Claude Code).

NOTE: This has only been tested on my Linux machine, so not sure if it will work on macOS. It should, but I haven't tried it out personally.

Fun fact: This tool was originally a random REPL that Claude generated on-the-fly to do some random thing. I saw it and was blown away, so I got Claude to make it into its own application. I suspect that Claude may have taken "inspiration" from an existing project with a similar name, so credit where credit is due to this other `playwright-repl` package: https://github.com/stevez/playwright-repl

0 comments