Browser automation that stays logged into every account you give it. Built on top of @playwright/cli, with a shell wrapper, a Claude Code Skill, and the one trick that gets you past Google's "this browser may not be secure" wall.
pw-login mygmail https://gmail.com # one-time login, in real Chrome
pw mygmail open https://gmail.com # daily use, already signed in
That's the whole API.
Try logging into Gmail from a Playwright browser. Google rejects you:
This browser or app may not be secure.
It's not a CAPTCHA. It's not 2FA. Google detects that the browser is being driven via the Chrome DevTools Protocol and refuses to authenticate. There is no user-agent string, no header, no flag that gets you past it.
pw-login solves this by logging in once in real Chrome (no CDP), saving the
profile to disk, then letting Playwright reuse the saved cookies. The login
persists forever. You only ever do it once per account.
Full writeup: google-login-bypass.md.
macOS / Linux:
curl -fsSL https://raw.githubusercontent.com/RyanCollinsAI/playwright-personas/main/install.sh | bashWindows (PowerShell):
irm https://raw.githubusercontent.com/RyanCollinsAI/playwright-personas/main/install.ps1 | iexThe installer:
- Verifies Node.js >= 18 is installed.
- Runs
npm install -g @playwright/cli. - Downloads Playwright's bundled Chromium.
- Clones this repo into
~/.playwright-personas. - Wires
pw/pw-logininto your shell rc (idempotent — safe to rerun). - Installs the Claude Code Skill into
~/.claude/skills/playwright-personas.
Open a new terminal and you're done.
pwcollides with a few password-manager aliases. Ifwhich pwshows something other than the wrapper, rename the function inshell/pw.shtopwa(or anything else) and re-source your rc. The toolkit doesn't depend on the name.
pw-login work-gmail https://mail.google.com
# Real Chrome opens. Sign in by hand, including 2FA. Close the window.
pw work-gmail open https://mail.google.com
# Playwright Chrome opens, already signed in.
pw work-gmail snapshot
# Standard playwright-cli — accessibility tree of the current page.
pw work-gmail click "text=Compose"
pw work-gmail close
pw accounts # list configured accounts
pw list # list running sessions
pw close-all # close all sessionsEvery playwright-cli subcommand works after pw <account>. The wrapper just
adds -s=<account> --profile=... --browser=chrome for you.
playwright-personas/
├── shell/
│ ├── pw.sh # bash + zsh wrapper (macOS, Linux, Git Bash)
│ └── pw.ps1 # PowerShell wrapper (Windows)
├── python/
│ └── pw_helpers.py # importable helpers for browser-automation scripts
├── claude-skill/
│ ├── SKILL.md # the skill Claude Code loads
│ └── references/
│ ├── google-login-bypass.md
│ ├── token-discipline.md
│ ├── youtube-studio.md
│ └── instagram.md
├── examples/
│ └── multi-account-dashboard.py
├── install.sh / install.ps1
├── uninstall.sh / uninstall.ps1
└── LICENSE
A small sample of what gets easier once your accounts stay logged in:
- Multi-channel YouTube ops. Drive YouTube Studio for two or three channels in parallel — analytics scrapes, end-screen edits, bulk metadata changes — without re-authing each one. The included youtube-studio.md documents the interstitial trick and the Polymer-input rule that breaks most Studio automation.
- Cross-platform posting. One script logs into Instagram, TikTok, and X via
three separate
pwprofiles and posts the same content. See instagram.md for the obfuscated-DOM workaround. - Personal dashboards. Aggregate balances, stats, or notifications from
five different accounts into one local HTML page. The
examples/multi-account-dashboard.pyscript is a 50-line starting point. - Claude Code as your browser. With the bundled Skill installed, Claude
knows about
pw, the Google bypass, and the token-discipline rules. Ask it to "open my work Gmail and summarize unread emails" and it picks the right commands without you teaching it the wrapper.
The Skill at claude-skill/SKILL.md is installed to
~/.claude/skills/playwright-personas/ by the installer. Claude Code
auto-loads skills from that directory; nothing else to wire up.
Test it:
# Open Claude Code in any project, ask:
"Open https://example.com using playwright-personas and screenshot it."
If Claude runs playwright-cli commands instead of asking you to install
something, the Skill is loaded.
A full snapshot of a modern web app is tens of thousands of tokens. If you're paying per token (Claude Code is), undisciplined browser use is the most expensive thing you can do.
See token-discipline.md for the full rules. The summary:
- Prefer stable CSS / text= selectors over snapshot-then-
eNNrefs. evalfor values,snapshot --depth=4 "#area"for exploring.Grepsnapshot files; neverReadthem.- Batch multi-step flows into one
run-codecall. - Two failures of the same action means stop and debug.
~/.playwright-personas/uninstall.sh # macOS / Linux / Git Bash& "$HOME\.playwright-personas\uninstall.ps1" # WindowsRemoves the shell wrapper, the Claude Code skill, and the cloned repo.
Leaves your account profiles intact at ~/.playwright-profiles/ — those
hold your real logins. Delete them manually if you want a clean slate.
MIT. See LICENSE.
Ryan Collins. This toolkit is the layer I
built on top of @playwright/cli to drive my own YouTube channels and
accounts from Claude Code. The free version of the AI Skills Lab community
(skool.com/ai-skills-society-7281)
has a video walkthrough and a few longer-form recipes.
Issues and PRs welcome.