Playwright CLI Skill

OpenAI’s official workflow for real-browser automation through the Playwright CLI.

The Playwright CLI Skill is an official workflow guide from OpenAI’s curated openai/skills repository. Its direct primary source is https://github.com/openai/skills/tree/main/skills/.curated/playwright. It is intended for coding agents and other compatible harnesses that need to drive a real browser from a terminal. That includes navigation, filling forms, checking page state, capturing screenshots, and investigating user-interface flows. The guide is not a separate web service or a complete test suite. It is a narrowly scoped operating workflow for the Playwright CLI.

Purpose and classification

According to the provider, the skill should be used in a CLI-first way. The agent first opens a target page, takes a current DOM snapshot, and receives stable references for interactive elements. It then performs a concrete action and takes another snapshot after navigation or a substantial interface change. This sequence makes interactions easier to understand because an agent does not blindly rely on stale element numbers or improvised selectors. The workflow therefore fits reproducible journeys through a sign-in mockup or checkout flow, visual review of an application, and investigation of a user-interface defect.

Practical workflow

The official guide recommends the bundled wrapper script so the CLI can run through npx without requiring a global installation. The prerequisite is checking that npx is available. The agent then opens the page, creates a snapshot, uses references from that snapshot for clicks, text entry, or keyboard actions, and captures another snapshot after meaningful changes. A headed browser can help with visual checks. For traceable debugging, the workflow also supports starting and stopping tracing sessions. Multiple tabs are managed with dedicated tab actions, followed by a fresh snapshot after switching tabs.

Boundaries and safety

A reference from an old snapshot can become invalid after navigation. The guide therefore says to avoid bypassing the snapshot workflow with arbitrary code when references are stale and instead capture the page again. Explicit CLI commands are preferred over eval or run-code unless a special need exists. Browser automation can submit forms, open external sites, and expose data on screen. Before an action with side effects, an agent should confirm the target, scope, and authorization. Credentials, tokens, personal data, and confidential screenshots should not be stored in skill files or test artifacts. A browser running locally also does not mean that content remains local to the user; that depends on the selected agent, model, and transport path.

Installation and compatibility

The primary source describes Codex-oriented workflows, so this catalog entry is assigned to the existing Codex compatibility. The skill can also serve as procedural guidance in another harness when that harness can execute the Playwright CLI from a terminal. According to the provider, the openai/skills repository is public and licensed under Apache-2.0. Review the license, CLI version, and available commands at the official source before production use. Skill Road does not sell this skill and does not assert a specific cost; any expense associated with a model, runtime, browser, or external service should be evaluated separately.

Suitable tasks

The skill is most useful when an agent must inspect a real web interface rather than only call HTTP endpoints. Suitable work includes visual regressions, reproducible UI steps, checking form states, and collecting evidence for a defect report. It does not replace domain approvals or security review, and it does not guarantee complete coverage across browsers, devices, or network conditions. Teams should continue to use their established project test workflow for ordinary source-code tests. This description was checked on September 9, 2026 against the official SKILL.md and official OpenAI resources about Codex.

Installation instructions

Playwright MCP and the Playwright CLI at a glance

Playwright is an open-source browser automation and end-to-end testing framework developed by Microsoft. Around this core tool, two distinct paths have emerged for connecting AI-powered coding agents to real browsers: the Playwright MCP server and the newer Playwright CLI. The MCP server relies on the Model Context Protocol, an open standard for exchanging structured data between applications and AI models, and gives the connected language model tools to open pages, fill out forms, take screenshots, or inspect network traffic. The Playwright CLI, according to the provider, takes a different approach: instead of sending tool calls over a protocol, the agent runs ordinary shell commands and pulls in compact, on-demand instruction sets called skills only when it actually needs them. Both approaches build on the same underlying automation engine but differ substantially in cost, intended use, and operating mode.

When each approach makes sense

Per the official documentation, the MCP server suits specialized, exploratory automation scenarios where an AI model interacts with a web page step by step, working from accessibility-based state snapshots rather than interpreting pixels or screenshots. This mode opens a visible browser by default, which makes it easier to follow along but also consumes more compute and more context space in the language model, since tool schemas and page snapshots ride along with every request. The CLI variant, by contrast, targets coding agents such as Claude Code or GitHub Copilot that work across large codebases: it runs headless by default, returns terse text output, and loads specialized knowledge only when actually required. That keeps the language model's context usage lower, which matters noticeably during large-scale development tasks.

Step 1: Setup and safe usage

Installing the MCP server means adding an entry to the target MCP client's configuration file that launches the server via npx; the CLI variant, in contrast, is installed globally as its own npm package and then invoked through a dedicated command-line tool. Both require Node.js, and the first run downloads the associated browser binaries. For safe use: automated browser sessions should only run against trusted, clearly scoped target sites, since an agent can, in a worst case, submit forms, trigger purchases, or expose credentials. According to the documentation, saved login state and cookies persist between sessions by default, which adds convenience but also means sensitive session data sits locally and needs to be protected accordingly. Advanced capabilities such as network mocking, storage access, or running unvetted code snippets should only be enabled deliberately, for tasks that genuinely need those permissions.

Practical value and limits

In practice, the MCP server works well for interactive assistance scenarios, for example when a user wants to try out, test, or analyze a web page directly inside a chat, while the CLI variant plays to its strengths in automated development and testing workflows within larger projects, where many small automation steps run without each one consuming expensive model context. Both approaches, however, hit limits once target sites deploy aggressive bot detection, complex multi-step logins, or dynamic interfaces that are hard to pin down; in those cases human oversight or additional error handling remains necessary. Teams that want to use both tools in the same project should first decide which tool serves which purpose, to avoid duplicate browser sessions and conflicting automation steps.

Free
Provider
OpenAI
License
Apache-2.0
Last reviewed
09.09.2026

Repository and documentation

Categories

Compatible with

Codex