playwright-cli
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.
- License 许可
- MIT
- 最近更新
- 2026-11-04
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- 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:*)
- disable-model-invocation
- true
02 资源文件 10
- 参考文档advanced-workflows.md18.3 KB
- 参考文档core-commands.md10.3 KB
- 参考文档device-emulation.md13.0 KB
- 参考文档request-mocking.md10.1 KB
- 参考文档running-custom-code.md14.8 KB
- 参考文档screenshots-and-media.md10.2 KB
- 参考文档session-management.md9.5 KB
- 参考文档storage-and-auth.md11.2 KB
- 参考文档test-generation.md10.9 KB
- 参考文档tracing-and-debugging.md11.5 KB
03 SKILL.md 正文
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
# 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
- Always
snapshotfirst — identify element refs before interacting; never guess ref numbers - Use
fillfor inputs,clickfor buttons —typesends keystrokes one-by-one,fillreplaces the entire value - Named sessions for parallel work —
-s=nameisolates cookies, storage, and tabs per session - Save auth state —
state-save auth.jsonafter login,state-load auth.jsonto skip login next time - Trace before debugging —
tracing-startbefore the failing step, not after run-codefor advanced scenarios — when CLI commands aren't enough, drop into full Playwright API- Clean up sessions —
closeorclose-allwhen done;kill-allfor zombie processes - Descriptive filenames —
screenshot --filename=checkout-step3.pngnotscreenshot - Mock external APIs only — use
routeto intercept third-party services, not your own app - Persistent profiles for stateful flows —
--persistentkeeps cookies and storage across restarts
Command Reference
Core Interaction
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
playwright-cli go-back # Browser back button
playwright-cli go-forward # Browser forward button
playwright-cli reload # Reload current page
Keyboard & Mouse
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
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
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
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
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
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
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
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 doing | Guide |
|---|---|
| Core browser interaction | core-commands.md |
| Generating test code | test-generation.md |
| Screenshots, video, PDF | screenshots-and-media.md |
Testing & Debugging
| What you're doing | Guide |
|---|---|
| Tracing and debugging | tracing-and-debugging.md |
| Network mocking & interception | request-mocking.md |
| Running custom Playwright code | running-custom-code.md |
State & Sessions
| What you're doing | Guide |
|---|---|
| Cookies, localStorage, auth state | storage-and-auth.md |
| Multi-session management | session-management.md |
Advanced
| What you're doing | Guide |
|---|---|
| Device & environment emulation | device-emulation.md |
| Complex multi-step workflows | advanced-workflows.md |
04 同仓库更多 Skills
vibesec
This skill helps Claude write secure web applications. Use this when working on any web application or when a user requests a scan or audit to ensure security best practices are followed.
ui-ux-guide
Modern, clean UI/UX guidance + review skill. Use when you need actionable UX/UI recommendations, design principles, or a design review checklist for new features or existing systems (web/app). Focus on CRAP (Contrast/Repetition/Alignment/Proximity) plus task-first UX, information architecture, feedback & system status, consistency, affordances, error prevention/recovery, and cognitive load. Enforce a modern minimal style (clean, spacious, typography-led), reduce unnecessary copy, forbid emoji as icons, and recommend intuitive refined icons from a consistent icon set.
tufin
暂无简介
tines
Tines is a no-code automation and orchestration platform commonly used as a SOAR replacement, IT automation engine, and workflow builder. Use this skill whenever the user mentions Tines, Tines stories, actions, the AI Agent action, Story copilot, Webhook actions, HTTP Request actions, Event Transform, Send to Story, Resources, Pages, Cases, Records, credentials, Connect Flows, formulas, pills (`<<slug.body.field>>` syntax), the Tines API, the Tines Terraform provider, tenants, change control, self-hosted Tines, Helm charts for Tines, Tines Tunnel, Command-over-HTTP, Tines on Azure or AWS, Tines credits and the AI credit pool, the Workbench, MCP server templates exposed by Tines, or any automation or workflow build inside Tines. Also trigger when the user asks about migrating from Cortex XSOAR / XSIAM or other SOAR platforms to Tines, designing playbook or story patterns, integrating security tools through Tines, building forms with Pages, running case management in Tines, or is debugging a Tines workflow, even if they don't name a specific Tines concept.
tines-3b
Tines 3B is a separate product from Tines (Stories), not an upgrade path. Workflows are git repositories, steps are containerized code directories that pipe stdin to stdout, and an AI agent builds them from prompts. Use this skill whenever the user mentions Tines 3B, 3B spaces, 3B workflows, steps, config.toml, route_auth, route_type, webpage routes, volumes and /storage, Tines units (TUs), connectors and the credential proxy, 3B skills, watchtower, autofix, autotune, solo runs, 3B branches or push-live, the 3B REST API or MCP endpoint, GitSync, tunnels and networks, or docs.3b.tines.com. Also trigger when comparing 3B against Tines Stories, deciding which of the two a use case belongs in, or migrating between them. For classic Tines (stories, actions, pills, formulas, Cases, Records, Pages), use the `tines` skill instead.
threatconnect
ThreatConnect TIP and Polarity overlay expert. Use for any task involving ThreatConnect or Polarity: REST API calls (v2/v3), authentication (Token/HMAC), TQL queries, Indicators, Groups, Cases, Workflow, Tags, Security Labels, Associations, ThreatAssess scoring, CAL configuration, indicator deprecation, exclusion lists, TAXII feeds (inbound/outbound), feed metrics, dashboards, Query Cards, Threat Graph, ATT&CK Visualizer, Risk Quantifier, Polarity integrations (Core, IOC Submission, Intel Search, CAL, XSOAR), Polarity custom development (Node.js), Polarity server administration, Playbooks, Components, Workflow Playbooks, App Builder, TcEx, indicator distribution to SIEM/SOAR (XSIAM, Sentinel, Splunk, Elastic, Tines, Torq, BlinkOps), HTTP errors, HMAC signature failures, indicator formatting (ASN, CIDR, Host, URL, Registry Key), or troubleshooting. Trigger even without explicit ThreatConnect/Polarity mention if the task involves threat intelligence platform operations.