Agent skill

Playwright CLI

by zebbern in zebbern/claude-code-guide

Automates browser interactions for web testing, form filling, screenshots, and data extraction using playwright-cli.

MITAuto-check passedTesting & QA

Install Playwright CLI

skills CLI
$ npx skills add zebbern/claude-code-guide --skill playwright-cli -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install zebbern/claude-code-guide playwright-cli --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/zebbern/claude-code-guide.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/playwright/playwright-cli .claude/skills/playwright-cli && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
playwright-cli
GitHub stars
4.6k
Token cost
~2.4k tokens
SKILL.md length
244 words
Files
11
Skills in repo
46
Repo updated
First seen
Licence
MIT

At a glance

Automates browser interactions for web testing, form filling, screenshots, and data extraction using playwright-cli.

  • Works in 10 steps: Always snapshot first — identify element… → Use fill for inputs, click for buttons —… → Named sessions for parallel work —… → …
  • The user needs to navigate websites
  • SKILL.md covers Quick Start, Golden Rules, Command Reference and Guide Index
  • Reaches playwright.dev

What it does

Playwright CLI is an agent skill from zebbern/claude-code-guide. Automates browser interactions for web testing, form filling, screenshots, and data extraction using playwright-cli. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, extract information from web pages, mock network requests, manage browser sessions, or generate test code.

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 10 other files (for example `advanced-workflows.md`, `core-commands.md` and `device-emulation.md`).

It sits in Testing & QA, covering Browser testing, Forms and invoices and Test generation. It works with Playwright. The repository describes itself as: Claude Code Guide - Setup, Commands, workflows, agents, skills & tips-n-tricks from beginner to power user! The licence is MIT.

When your agent uses it

  • The user needs to navigate websites
  • Interact with web pages
  • Take screenshots
  • Test web applications

Example prompts

  • “Use the playwright-cli skill to automate browser interactions for web testing, form filling, screenshots, and data extraction using playwright-cli”
  • “/playwright-cli”

Requirements

  • Pre-approved tools (allowed-tools): Bash(playwright-cli:*)

Workflow steps

10 steps, taken from the first numbered list in SKILL.md.

  1. Always snapshot first — identify element refs before interacting; never guess ref numbers
  2. Use fill for inputs, click for buttons — type sends keystrokes one-by-one, fill replaces the entire value
  3. Named sessions for parallel work — -s=name isolates cookies, storage, and tabs per session
  4. Save auth state — state-save auth.json after login, state-load auth.json to skip login next time
  5. Trace before debugging — tracing-start before the failing step, not after
  6. run-code for advanced scenarios — when CLI commands aren't enough, drop into full Playwright API
  7. Clean up sessions — close or close-all when done; kill-all for zombie processes
  8. Descriptive filenames — screenshot --filename=checkout-step3.png not screenshot
  9. Mock external APIs only — use route to intercept third-party services, not your own app
  10. Persistent profiles for stateful flows — --persistent keeps cookies and storage across restarts

What it can do on your machine

Read from SKILL.md and the folder at commit 4698e3b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash(playwright-cli:*)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are bash).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • playwright.dev

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Playwright CLI loads about 2.4k tokens when it runs. Until then it costs about 91 tokens; SKILL.md has 244 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~91
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from zebbern/claude-code-guide at commit 4698e3b, republished under its MIT licence (© zebbern). 244 words, ~2,375 tokens.

Download SKILL.mdSave it as .claude/skills/playwright-cli/SKILL.md (or your agent's skills folder). This skill also uses 10 other files; get the full folder from GitHub.
name
playwright-cli
description
Automates browser interactions for web testing, form filling, screenshots, and data extraction using playwright-cli. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, extract information from web pages, mock network requests, manage browser sessions, or generate test code.
allowed-tools
Bash(playwright-cli:*)

Browser Automation with playwright-cli

Comprehensive CLI-driven browser automation — navigate, interact, mock, debug, record, and generate tests without writing a single script file.

Quick Start

bash
# Install and set up
playwright-cli install --skills
playwright-cli install-browser

# Open a browser and navigate
playwright-cli open https://playwright.dev

# Take a snapshot to see interactive elements (refs like e1, e2, e3...)
playwright-cli snapshot

# Interact using element refs from the snapshot
playwright-cli click e15
playwright-cli fill e5 "search query"
playwright-cli press Enter

# Take a screenshot
playwright-cli screenshot

# Close the browser
playwright-cli close

Golden Rules

  1. Always snapshot first — identify element refs before interacting; never guess ref numbers
  2. Use fill for inputs, click for buttons — type sends keystrokes one-by-one, fill replaces the entire value
  3. Named sessions for parallel work — -s=name isolates cookies, storage, and tabs per session
  4. Save auth state — state-save auth.json after login, state-load auth.json to skip login next time
  5. Trace before debugging — tracing-start before the failing step, not after
  6. run-code for advanced scenarios — when CLI commands aren't enough, drop into full Playwright API
  7. Clean up sessions — close or close-all when done; kill-all for zombie processes
  8. Descriptive filenames — screenshot --filename=checkout-step3.png not screenshot
  9. Mock external APIs only — use route to intercept third-party services, not your own app
  10. Persistent profiles for stateful flows — --persistent keeps cookies and storage across restarts

Command Reference

Core Interaction
bash
playwright-cli open [url]                    # Launch browser, optionally navigate
playwright-cli goto <url>                    # Navigate to URL
playwright-cli snapshot                      # Show page elements with refs
playwright-cli snapshot --filename=snap.yaml # Save snapshot to file
playwright-cli click <ref>                   # Click an element
playwright-cli dblclick <ref>                # Double-click
playwright-cli fill <ref> "value"            # Clear and fill input
playwright-cli type "text"                   # Type keystroke by keystroke
playwright-cli select <ref> "option-value"   # Select dropdown option
playwright-cli check <ref>                   # Check a checkbox
playwright-cli uncheck <ref>                 # Uncheck a checkbox
playwright-cli hover <ref>                   # Hover over element
playwright-cli drag <src-ref> <dst-ref>      # Drag and drop
playwright-cli upload <ref> ./file.pdf       # Upload a file
playwright-cli eval "document.title"         # Evaluate JS expression
playwright-cli eval "el => el.textContent" <ref>  # Evaluate on element
playwright-cli close                         # Close the browser
Navigation
bash
playwright-cli go-back                       # Browser back button
playwright-cli go-forward                    # Browser forward button
playwright-cli reload                        # Reload current page
Keyboard & Mouse
bash
playwright-cli press Enter                   # Press a key
playwright-cli press ArrowDown               # Arrow keys
playwright-cli keydown Shift                 # Hold key down
playwright-cli keyup Shift                   # Release key
playwright-cli mousemove 150 300             # Move mouse to coordinates
playwright-cli mousedown [right]             # Mouse button down
playwright-cli mouseup [right]               # Mouse button up
playwright-cli mousewheel 0 100              # Scroll (deltaX, deltaY)
Dialogs
bash
playwright-cli dialog-accept                 # Accept alert/confirm/prompt
playwright-cli dialog-accept "text"          # Accept prompt with input
playwright-cli dialog-dismiss                # Dismiss/cancel dialog
Tabs
bash
playwright-cli tab-list                      # List all open tabs
playwright-cli tab-new [url]                 # Open new tab
playwright-cli tab-select <index>            # Switch to tab by index
playwright-cli tab-close [index]             # Close tab (current or by index)
Screenshots & Media
bash
playwright-cli screenshot                    # Screenshot current page
playwright-cli screenshot <ref>              # Screenshot specific element
playwright-cli screenshot --filename=pg.png  # Save with custom filename
playwright-cli pdf --filename=page.pdf       # Save page as PDF
playwright-cli video-start                   # Start video recording
playwright-cli video-stop output.webm        # Stop and save video
playwright-cli resize 1920 1080              # Resize viewport
Storage & Auth
bash
playwright-cli state-save [file.json]        # Save cookies + localStorage
playwright-cli state-load <file.json>        # Restore saved state
playwright-cli cookie-list [--domain=...]    # List cookies
playwright-cli cookie-get <name>             # Get specific cookie
playwright-cli cookie-set <name> <value> [opts]  # Set a cookie
playwright-cli cookie-delete <name>          # Delete a cookie
playwright-cli cookie-clear                  # Clear all cookies
playwright-cli localstorage-list             # List localStorage items
playwright-cli localstorage-get <key>        # Get localStorage value
playwright-cli localstorage-set <key> <val>  # Set localStorage value
playwright-cli localstorage-delete <key>     # Delete localStorage item
playwright-cli localstorage-clear            # Clear all localStorage
playwright-cli sessionstorage-list           # List sessionStorage
playwright-cli sessionstorage-get <key>      # Get sessionStorage value
playwright-cli sessionstorage-set <key> <val>    # Set sessionStorage value
playwright-cli sessionstorage-delete <key>   # Delete sessionStorage item
playwright-cli sessionstorage-clear          # Clear all sessionStorage
Network Mocking
bash
playwright-cli route "<pattern>" [opts]      # Intercept matching requests
playwright-cli route-list                    # List active route overrides
playwright-cli unroute "<pattern>"           # Remove specific route
playwright-cli unroute                       # Remove all routes
DevTools & Debugging
bash
playwright-cli console [level]              # Show console messages
playwright-cli network                      # Show network requests
playwright-cli tracing-start                # Start trace recording
playwright-cli tracing-stop                 # Stop and save trace
playwright-cli run-code "async page => {}"  # Execute Playwright API code
Sessions & Configuration
bash
playwright-cli -s=<name> <command>          # Run command in named session
playwright-cli list                         # List all active sessions
playwright-cli close-all                    # Close all browsers
playwright-cli kill-all                     # Force kill all processes
playwright-cli delete-data                  # Delete session user data
playwright-cli open --browser=firefox       # Use specific browser
playwright-cli open --persistent            # Persist profile to disk
playwright-cli open --profile=/path         # Custom profile directory
playwright-cli open --config=config.json    # Use config file
playwright-cli open --extension             # Connect via extension

Guide Index

Getting Started
What you're doingGuide
Core browser interactioncore-commands.md
Generating test codetest-generation.md
Screenshots, video, PDFscreenshots-and-media.md
Testing & Debugging
What you're doingGuide
Tracing and debuggingtracing-and-debugging.md
Network mocking & interceptionrequest-mocking.md
Running custom Playwright coderunning-custom-code.md
State & Sessions
What you're doingGuide
Cookies, localStorage, auth statestorage-and-auth.md
Multi-session managementsession-management.md
Advanced
What you're doingGuide
Device & environment emulationdevice-emulation.md
Complex multi-step workflowsadvanced-workflows.md

© zebbern, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 10 other files in skills/playwright/playwright-cli of zebbern/claude-code-guide.

  • SKILL.md
  • advanced-workflows.md
  • core-commands.md
  • device-emulation.md
  • request-mocking.md
  • running-custom-code.md
  • screenshots-and-media.md
  • session-management.md
  • storage-and-auth.md
  • test-generation.md
  • tracing-and-debugging.md

Open the folder on GitHubat commit 4698e3b

Compare with similar skills

Playwright CLI next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Playwright CLI compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Playwright CLI this skillzebbern/claude-code-guide4.6k—~2.4kAutomated safety check: PassMIT
Playwright CLIsanity-io/sanity6.4k18 repos~1.9kAutomated safety check: PassMIT
Write and Verify Playwright Testsappsmithorg/appsmith41k—~2.9kAutomated safety check: NotesApache-2.0
PlaywrightJetBrains/skills36311 repos~986Automated safety check: PassApache-2.0
Playwright CLItestdino-hq/playwright-skill3851 repos~2.5kAutomated safety check: PassMIT
Playwright Stealth Verifyliarjsdev/liarjs-skills5181 repos~1.3kAutomated safety check: NotesMIT

Similar skills

  • Playwright CLI

    sanity-io/sanity

    Official

    Automates browser interactions for web testing, form filling, screenshots, and data extraction.

    6.4k GitHub starsUsed in 18 repos~1.9k tokens
    Testing & QAAuto-check passed
  • Writes a Playwright end-to-end test from a prompt, runs it against a live Appsmith deployment and retries with fixes up to three times until it passes.

    41k GitHub stars~2.9k tokensUpdated today
    Testing & QAAuto-check: notes
  • Playwright

    JetBrains/skills

    Official

    A skill your agent uses when the task requires automating a real browser from the terminal (navigation, form filling, snapshots, screenshots, data extraction, UI-flow debugging) via playwright-cli…

    363 GitHub starsUsed in 11 repos~986 tokens
    Testing & QAAuto-check passed
  • Playwright CLI

    testdino-hq/playwright-skill

    Automates browser interactions for testing and validating your own web applications using playwright-cli.

    385 GitHub starsUsed in 1 repo~2.5k tokens
    Testing & QAAuto-check passed
  • Playwright Stealth Verify

    liarjsdev/liarjs-skills

    Check whether a Playwright, Puppeteer, Selenium or CDP-driven browser presents a coherent fingerprint, using liarjs as a library against a Page you already have - navigator.webdriver, HeadlessChrome…

    518 GitHub starsUsed in 1 repo~1.3k tokens
    Testing & QAAuto-check: notes
  • Playwright

    6BNBN/FlowPilot

    A skill your agent uses when the task requires automating a real browser from the terminal in Cursor, including navigation, form filling, snapshots, screenshots, data extraction, and UI-flow…

    134 GitHub stars~1k tokensUpdated 6 mo ago
    Testing & QAAuto-check passed

More from zebbern/claude-code-guide

All 46 skills in this repo
  • Localization Toolkit

    zebbern/claude-code-guide

    This skill should be used when setting up, auditing, or enforcing internationalization/localization in UI codebases (React/TS, i18next or similar, JSON locales), including installing/configuring the…

    4.6k GitHub starsUsed in 1 repo~1.3k tokens
    Auto-check passed
  • Audit Flow

    zebbern/claude-code-guide

    Interactive system flow tracing across CODE, API, AUTH, DATA, NETWORK layers with SQLite persistence and Mermaid export.

    4.6k GitHub stars~4.2k tokensUpdated today
    Auto-check passed
  • Chart Image

    zebbern/claude-code-guide

    Generate publication-quality PNG chart images from data, supporting line, bar, area, candlestick, pie, and heatmap charts.

    4.6k GitHub stars~2.7k tokensUpdated today
    Auto-check passed
  • Code To Diagram

    zebbern/claude-code-guide

    Analyze codebases and automatically generate architecture diagrams, flowcharts, and org charts.

    4.6k GitHub stars~972 tokensUpdated today
    Auto-check passed
  • Code Vuln Audit

    zebbern/claude-code-guide

    Scan code for security issues: dependency vulnerabilities (npm/pip audit), secret leaks (regex and entropy analysis), and OWASP anti-patterns like SQL injection, XSS, or command injection.

    4.6k GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • Data Viz Renderer

    zebbern/claude-code-guide

    Generate self-contained HTML/SVG infographics from JSON data, including stat cards, bar charts, flow diagrams, and mixed dashboards.

    4.6k GitHub stars~1.3k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Playwright CLI

What does Playwright CLI do?

Automates browser interactions for web testing, form filling, screenshots, and data extraction using playwright-cli. Playwright CLI is an agent skill from zebbern/claude-code-guide. Automates browser interactions for web testing, form filling, screenshots, and data extraction using playwright-cli.

When should I use Playwright CLI?

Playwright CLI fits situations like: the user needs to navigate websites; interact with web pages; take screenshots; test web applications.

How do I install Playwright CLI in Claude Code?

Run `npx skills add zebbern/claude-code-guide --skill playwright-cli -a claude-code`. Or copy the skill folder (skills/playwright/playwright-cli in zebbern/claude-code-guide) into .claude/skills/playwright-cli in your project. Claude Code loads it when a task matches its description.

How do I install Playwright CLI in Codex?

Run `npx skills add zebbern/claude-code-guide --skill playwright-cli -a codex`. Or copy the skill folder (skills/playwright/playwright-cli in zebbern/claude-code-guide) into .agents/skills/playwright-cli in your project. Codex loads it when a task matches its description.

Can I use Playwright CLI in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add zebbern/claude-code-guide --skill playwright-cli -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/playwright-cli, .gemini/skills/playwright-cli, .github/skills/playwright-cli and .opencode/skills/playwright-cli in your project.

What does Playwright CLI need to run?

SKILL.md names no scripts, command-line tools or credentials: Playwright CLI is instructions for the agent only. Its frontmatter pre-approves these tools: Bash(playwright-cli:*).

Does Playwright CLI access the network?

SKILL.md names 1 domain. In commands or code: playwright.dev; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Playwright CLI safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Playwright CLI use?

Playwright CLI is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Playwright CLI use?

About 2.4k tokens (SKILL.md is roughly 9.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Playwright CLI?

Skills that share tags, products or a category with Playwright CLI: Playwright CLI (sanity-io/sanity, 6.4k stars), Write and Verify Playwright Tests (appsmithorg/appsmith, 41k stars), Playwright (JetBrains/skills, 363 stars) and Playwright CLI (testdino-hq/playwright-skill, 385 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Playwright CLI?

zebbern (a GitHub user) maintains it in zebbern/claude-code-guide, which has 4,648 GitHub stars. The repository holds 46 skills in this directory. The repository was last updated on October 7, 2026.

Source: zebbern/claude-code-guide on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.