playwright-cli
Skill by zebbern
Automates browser interactions for web testing, form filling, screenshots and data extraction through playwright-cli. Built for AI assistants and users who need browser automation without writing a script file.
Install playwright-cli
Built from the published package, never by AI.
git clone --depth 1 https://github.com/zebbern/claude-code-guide /tmp/claude-code-guide && mkdir -p ~/.claude/skills && cp -r /tmp/claude-code-guide/skills/playwright/playwright-cli ~/.claude/skills/playwright-cliRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/zebbern/claude-code-guide /tmp/claude-code-guide && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/claude-code-guide/skills/playwright/playwright-cli ~/.gemini/antigravity-cli/skills/playwright-cliAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
playwright-cli is an agent skill that lets an AI assistant drive a browser from the command line. It covers navigation, clicking and form filling, screenshots and PDFs, cookie and storage handling, network mocking, tracing, and generating test code. The skill works through snapshots: the assistant runs snapshot to list page elements with refs such as e1 or e5, then acts on those refs.
The SKILL.md file sets golden rules, such as taking a snapshot before interacting, using fill for inputs, saving auth state after login, and mocking only third-party APIs. It also includes a command reference and a guide index covering multi-session management, device emulation and running custom Playwright code. It suits testers and developers who want browser automation driven step by step from the command line.
Written from the project's SKILL.md and checked against it.
What it can do
- snapshotShows page elements with refs so the assistant can target them.
- click, fill, selectClicks elements and fills or selects form inputs by ref.
- screenshot, pdf, video-startCaptures screenshots, saves pages as PDF and records video.
- routeIntercepts matching network requests for mocking.
- state-save, state-loadSaves and restores cookies and localStorage, such as after login.
- tracing-start, tracing-stopRecords a trace to help debug a failing step.
- run-codeExecutes Playwright API code when CLI commands are not enough.
- Named sessions (-s=name)Isolates cookies, storage and tabs for parallel work.
- tab-new, tab-selectOpens, switches and closes browser tabs.
What you need
- playwright-cli installed
- Browser installed with playwright-cli install-browser
Try asking
- Open example.com, take a snapshot and fill in the contact form
- Take a screenshot of the checkout page as checkout-step3.png
- Trace the login flow and save the auth state to auth.json
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/playwright/playwright-cli/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
Allowed tools: Bash(playwright-cli:*)
-
SKILL.md9 KB -
advanced-workflows.md18 KB -
core-commands.md11 KB -
device-emulation.md13 KB -
request-mocking.md10 KB
Show all 11 files
-
running-custom-code.md15 KB -
screenshots-and-media.md10 KB -
session-management.md10 KB -
storage-and-auth.md11 KB -
test-generation.md11 KB -
tracing-and-debugging.md12 KB
Alternatives to playwright-cli
All alternatives →Antigravity Workflows guides an assistant through multi-skill workflows for shipping a SaaS MVP, auditing web app security, building AI agents, running browser QA, and designing a domain model. It is for users who want several skills combined with verified checkpoints.
Guides building end-to-end test suites with Playwright and Cypress. It is for developers who write E2E tests, debug flaky tests, or set testing standards.
Upgrades Chrome or Firefox versions in the Flutter Web Engine and Framework tests. It verifies the version, updates config files, syncs CI builder JSON and runs local tests before the CIPD upload.
Builds reliable browser checks for real web workflows using semantic locators, bounded waits, isolated test data and explicit outcome checks. It is for developers and testers writing or debugging browser tests.
Diagnoses memory leaks in the Qwen Code CLI using heap snapshots and the chrome-devtools CLI. Built for developers investigating high memory use, unbounded growth, or object retention.
Guides an assistant through using Claude in Chrome, a browser extension whose tools act in the person's real Chrome with their own sign-ins. It is for users who want the assistant to work in their browser safely.
Compare with antigravity-workflows, e2e-testing-patterns or upgrade-browser
playwright-cli: common questions
What does playwright-cli do?
It lets an AI assistant automate a browser through CLI commands for navigation, form filling, screenshots, network mocking and test code generation.
How does the assistant find elements on a page?
The assistant runs snapshot to list interactive elements with refs such as e1 or e2, then uses those refs in commands like click and fill.
Can it keep a logged-in session between runs?
Yes. The source says to run state-save after login and state-load later to skip login, and --persistent keeps cookies and storage across restarts.
How do I install playwright-cli?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is playwright-cli free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is playwright-cli safe to use?
It scores 88 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to playwright-cli?
Similar skills: antigravity-workflows, e2e-testing-patterns, upgrade-browser, browser-automation.
