Playwright CLI Automation
CLI-first browser automation using Playwright CLI for navigation, form filling, snapshots, screenshots, data extraction, and UI-flow debugging from the terminal.
Best use case
Playwright CLI Automation is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
CLI-first browser automation using Playwright CLI for navigation, form filling, snapshots, screenshots, data extraction, and UI-flow debugging from the terminal.
Teams using Playwright CLI Automation should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/playwright-cli-automation/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How Playwright CLI Automation Compares
| Feature / Agent | Playwright CLI Automation | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
CLI-first browser automation using Playwright CLI for navigation, form filling, snapshots, screenshots, data extraction, and UI-flow debugging from the terminal.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Playwright CLI Automation Drive a real browser from the terminal using `playwright-cli`. Prefer the bundled wrapper script so the CLI works even when it is not globally installed. Treat this skill as CLI-first automation. Do not pivot to `@playwright/test` unless the user explicitly asks for test files. ## Prerequisite check (required) Before proposing commands, check whether `npx` is available (the wrapper depends on it): ```bash command -v npx >/dev/null 2>&1 ``` If it is not available, pause and ask the user to install Node.js/npm (which provides `npx`). Provide these steps verbatim: ```bash # Verify Node/npm are installed node --version npm --version # If missing, install Node.js/npm, then: npm install -g @playwright/cli@latest playwright-cli --help ``` Once `npx` is present, proceed with the wrapper script. A global install of `playwright-cli` is optional. ## Core workflow 1. Open the page. 2. Snapshot to get stable element refs. 3. Interact using refs from the latest snapshot. 4. Re-snapshot after navigation or significant DOM changes. 5. Capture artifacts (screenshot, pdf, traces) when useful. Minimal loop: ```bash playwright-cli open https://example.com playwright-cli snapshot playwright-cli click e3 playwright-cli snapshot ``` ## When to snapshot again Snapshot again after: - navigation - clicking elements that change the UI substantially - opening/closing modals or menus - tab switches Refs can go stale. When a command fails due to a missing ref, snapshot again. ## Recommended patterns ### Form fill and submit ```bash playwright-cli open https://example.com/form playwright-cli snapshot playwright-cli fill e1 "user@example.com" playwright-cli fill e2 "password123" playwright-cli click e3 playwright-cli snapshot ``` ### Debug a UI flow with traces ```bash playwright-cli open https://example.com --headed playwright-cli tracing-start # ...interactions... playwright-cli tracing-stop ``` ### Multi-tab work ```bash playwright-cli tab-new https://example.com playwright-cli tab-list playwright-cli tab-select 0 playwright-cli snapshot ``` ## Guardrails - Always snapshot before referencing element ids like `e12`. - Re-snapshot when refs seem stale. - Prefer explicit commands over `eval` and `run-code` unless needed. - Use `--headed` when a visual check will help. - Default to CLI commands and workflows, not Playwright test specs.
Related Skills
Vibe Check - Browser Automation
Browser automation for AI agents. Navigate pages, fill forms, click elements, take screenshots, and manage tabs — all through simple CLI commands. 2.6k+ GitHub stars.
REST Assured API Automation Framework
Production-grade REST API automation framework with REST Assured, POJO serialization using GSON, PayloadManager pattern, E2E integration workflows with TestNG ITestContext, and Allure reporting.
Responsive Design Testing Automation
Automated responsive design testing across breakpoints, viewports, and devices with visual comparison and layout verification.
Postman & Newman Automation
Automated API testing using Postman collections with Newman CLI for CI/CD integration, environment management, and test reporting.
Playwright Enhanced
Advanced Playwright automation with auto-detection, custom fixtures, trace debugging, visual testing, mobile emulation, and production-grade test architecture.
Playwright Network Testing
Network-level testing with Playwright including request interception, response mocking, network throttling, and HAR recording/replay.
Playwright Mobile Web Testing
Mobile web testing skill using Playwright device emulation covering responsive testing, touch interactions, viewport management, network throttling, geolocation testing, and mobile-specific UI patterns.
Playwright E2E Testing
Comprehensive end-to-end testing skill using Playwright for web applications, covering page objects, selectors, assertions, waits, fixtures, and test organization.
Playwright CLI Browser Automation
Command-line browser automation with Playwright CLI for navigation, snapshots, uploads, downloads, tracing, and QA workflows.
Playwright API Testing
API testing skill using Playwright's built-in APIRequestContext for RESTful service validation, authentication flows, and API contract verification.
Playwright Agents
Testing patterns for Playwright AI-powered agents including the Planner, Generator, and Healer architecture for self-healing test automation, intelligent test generation, and adaptive test execution strategies.
Advanced Playwright E2E Framework
Enterprise-grade Playwright test automation framework using 8-layer architecture with Page Object Model, Module Pattern, custom fixtures, API testing layer, structured logging, data generators, multi-browser support, Docker, CI/CD pipelines, and custom HTML reporting.