playwright-cli for Openclaw

A comprehensive command-line interface for Playwright that enables seamless browser interaction, state management, and automated web testing.

lushi516
v0.1.9
Apr 30, 2026
0
861
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install microsoft-playwright-cli

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install microsoft-playwright-cli using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is playwright-cli?

The playwright-cli is a robust browser automation tool designed for developers who need to interact with web pages directly from their terminal or within automated workflows. As part of the Openclaw Skills collection, it provides a high-level abstraction over the Playwright library, allowing for quick execution of complex browser tasks like clicking, typing, and form submission without writing full scripts.

This skill is particularly valuable for its ability to handle modern web technologies, providing features like snapshot generation, network request mocking, and multi-tab management. It bridges the gap between manual browsing and full-scale automated testing, making it a staple for anyone utilizing Openclaw Skills for web research or frontend development.

playwright-cli Use Cases

  • Automating repetitive form submissions and data entry tasks.
  • Generating and inspecting UI snapshots to verify page layouts.
  • Debugging network requests and console logs in a headless or headed browser.
  • Capturing high-quality screenshots and PDFs of web content programmatically.
  • Managing complex authentication states by saving and loading browser cookies and localStorage.

How playwright-cli Works

  1. Launch a browser instance using the open or attach command to start a session.
  2. Execute interaction commands such as goto, click, or fill using simplified element references from snapshots.
  3. Analyze the page state through automatic or manual snapshots that provide YAML-based representations of the DOM.
  4. Manage the environment using specialized commands for tabs, storage state, and network routing.
  5. Terminate the session or save the persistent state for future automation tasks.

playwright-cli Setup

To get started with this skill, check if the command is available via npx or install it globally using npm:

# Check for local version
npx --no-install playwright-cli --version

# Global installation
npm install -g @playwright/cli@latest

playwright-cli Data Schema & Taxonomy

The skill manages browser data and snapshots through a structured directory and specific file types:

Data Type Format Description
Snapshots .yml YAML files containing page structure and element references (e.g., e1, e2).
Auth State .json Storage for cookies and localStorage to persist sessions.
Media .png / .pdf Visual outputs from the screenshot and pdf commands.
Tracing .zip Playwright trace files for deep debugging of interactions.

playwright-cli Advanced Features

  • Named Sessions: Run multiple isolated browser instances simultaneously using the -s flag.
  • Request Mocking: Intercept and modify network traffic with custom status codes and bodies.
  • JavaScript Execution: Evaluate custom scripts directly in the page context using the eval and run-code commands.
  • Visual Debugging: Utilize the show --annotate feature to interactively highlight and label UI elements for better context.
  • CDP Integration: Attach to existing Chrome or Edge instances via the Chrome DevTools Protocol.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*