Skip to content
playwright-cli logo

Playwright CLI

playwright-cli

Browser automation via Playwright CLI. Open pages, interact with elements, take screenshots, and more. Ideal for coding agents and automated testing workflows.

mmcmedia/openclaw-agents0installs2stars

SKILL.md

Full skill instructions

Playwright CLI

Browser automation via Playwright. Token-efficient CLI for coding agents.

Installation

npm install -g @playwright/​mcp@latest
playwright-cli --help

Core Commands

CommandDescription
playwright-cli open <url>Open URL in browser
playwright-cli closeClose the page
playwright-cli type <text>Type text into editable element
playwright-cli click <ref> [button]Click on element
playwright-cli dblclick <ref> [button]Double click
playwright-cli fill <ref> <text>Fill text into field
playwright-cli drag <startRef> <endRef>Drag and drop
playwright-cli hover <ref>Hover over element
playwright-cli check <ref>Check checkbox/​radio
playwright-cli uncheck <ref>Uncheck checkbox
playwright-cli select <ref> <val>Select dropdown option
playwright-cli snapshotCapture page snapshot for refs

Navigation

playwright-cli go-back           # Go back
playwright-cli go-forward        # Go forward
playwright-cli reload            # Reload page

Keyboard & Mouse

playwright-cli press <key>       # Press key (a, arrowleft, enter...)
playwright-cli keydown <key>     # Key down
playwright-cli keyup <key>       # Key up
playwright-cli mousemove <x> <y> # Move mouse
playwright-cli mousedown [button] # Mouse down
playwright-cli mouseup [button]   # Mouse up
playwright-cli mousewheel <dx> <dy> # Scroll

Save & Export

playwright-cli screenshot [ref]  # Screenshot page or element
playwright-cli pdf               # Save as PDF

Tabs

playwright-cli tab-list          # List all tabs
playwright-cli tab-new [url]     # Open new tab
playwright-cli tab-close [index] # Close tab
playwright-cli tab-select <index> # Switch tab

DevTools

playwright-cli console [min-level]  # View console messages
playwright-cli network              # View network requests
playwright-cli run-code <code>      # Run JS snippet
playwright-cli tracing-start        # Start trace
playwright-cli tracing-stop         # Stop trace

Sessions

playwright-cli session-list         # List sessions
playwright-cli session-stop [name]  # Stop session
playwright-cli session-stop-all     # Stop all
playwright-cli session-delete [name] # Delete session data

Headed Mode

playwright-cli open https://example.com --headed

Examples

# Open and interact
playwright-cli open https://example.com
playwright-cli type "search query"
playwright-cli press Enter
playwright-cli screenshot

# Use sessions
playwright-cli open https://site1.com
playwright-cli --session=project-a open https://site2.com

Environment Variables

VariableDescription
PLAYWRIGHT_MCP_BROWSERBrowser: chrome, firefox, webkit, msedge
PLAYWRIGHT_MCP_HEADLESSRun headless (default: headed)
PLAYWRIGHT_MCP_ALLOWED_HOSTSComma-separated allowed hosts
PLAYWRIGHT_MCP_CONFIGPath to config file

Configuration

Create playwright-cli.json for persistent settings:

{
  "browser": {
    "browserName": "chromium",
    "headless": false
  },
  "outputDir": "./​playwright-output",
  "console": {
    "level": "info"
  }
}

Notes

  • Cross-platform — requires Node.js 18+ (Linux, macOS, Windows)
  • Sessions persist cookies/​storage by default
  • Use --session flag for isolated browser instances
  • Snapshots return element refs for subsequent commands

Source

https://github.com/microsoft/playwright-cli

More skills from mmcmedia

user-testing logo
mmcmedia/openclaw-agents

user-testing

Perform comprehensive QA testing of web applications through browser automation. Navigate user flows, document bugs, check responsive design, capture screenshots, and report console errors. Use when testing websites, web apps (like PsalMix), or validating UI/UX before launch or after updates.

2 0
View
Tempest Mockups Skill logo
mmcmedia/openclaw-agents

Tempest Mockups Skill

Generate Etsy product mockups automatically using the Tempest Photoshop script.

2 0
View
Analytics & Insights Expert logo
mmcmedia/openclaw-agents

Analytics & Insights Expert

Comprehensive data analysis specialist covering basic metrics through advanced predictive analytics and marketing ROI. Your go-to expert for all data-driven decision making.

2 0
View
Competitive Intelligence logo
mmcmedia/openclaw-agents

Competitive Intelligence

Competitor research and market analysis specialist who tracks what your competitors are doing and identifies opportunities they're missing.

2 0
View
Test-Driven Skill Creation logo
mmcmedia/openclaw-agents

Test-Driven Skill Creation

Create and validate skills by measuring the gap between model output WITH and WITHOUT the skill.

2 0
View
react-best-practices logo
mmcmedia/openclaw-agents

react-best-practices

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimizati...

2 0
View
ux-audit logo
mmcmedia/openclaw-agents

ux-audit

AI skill for automated design audits. Evaluate interfaces against proven UX principles for visual hierarchy, accessibility, cognitive load, navigation, and more. Based on Making UX Decisions by Tommy Geoco.

2 0
View
Etsy Image Prompts Skill logo
mmcmedia/openclaw-agents

Etsy Image Prompts Skill

Generate high-quality, print-ready digital art for Etsy listings using AI image generators. This skill provides prompt formulas, templates, and best practices for creating sellable wall art, printables, and digital products.

2 0
View
frontend-design logo
mmcmedia/openclaw-agents

frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

2 0
View
ui-audit logo
mmcmedia/openclaw-agents

ui-audit

AI skill for automated UI audits. Evaluate interfaces against proven UX principles for visual hierarchy, accessibility, cognitive load, navigation, and more. Based on Making UX Decisions by Tommy Geoco.

2 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View