BASE

Playwright CLI

Playwright CLI

CLI and skill for browser automation · Free

Microsoft's official CLI for controlling a browser from the command line and an AI agent: page snapshots, actions using element references, input, navigation, and screenshots. The skill gives the agent a compact way to work with a browser.

Also known as: microsoft/playwright-cli; @playwright/cli

Resource illustration: Playwright CLI

Open resource ↗

What you can use for free

The CLI and included skill are free under Apache 2.0; automation runs in your environment.

Paid features and costs

Separate AI model, CI, or cloud browser plans are not included.

Access and limitations

The CLI runs in your own environment; AI agent costs are not included in the tool's license.

Use cases

  • Reproduce an interface error through a sequence of actions
  • Test a user workflow in a browser
  • Capture screenshots and page states for diagnostics

Example workflow

A possible workflow; this is not a report of hands-on testing.

Repeat a user workflow and find the point of failure

Before you start

  • A test page and workflow steps
  • A compatible Node.js environment and browser

Steps

  1. Configure the CLI and skill according to the official README.
  2. Open the test page, obtain a snapshot, and perform actions on its elements in sequence.
  3. Save a snapshot or screenshot of the problematic state and verify the fix with the same workflow.

Check your result

  • Actions run on the intended test address.
  • Check the expected state, rather than only whether a click succeeded.

Choosing Playwright CLI

Reproduce an interface error through a sequence of actions

Choose this when

  • Reproduce an interface error through a sequence of actions
  • Test a user workflow in a browser
  • Capture screenshots and page states for diagnostics

Consider alternatives when

  • When choosing for this topic, compare Playwright CLI with Playwright MCP. A candidate to compare under the topic: Responsive design and browsers, Testing and diagnostics. This is an editorial connection by topic, not a confirmed alternative or a guarantee that the products work together.

Requirements

  • The README requires Node.js 18+. Named sessions use -s; --headed provides a visible browser.

Things to consider

  • Costs and limits of free use: Separate AI model, CI, or cloud browser plans are not included.
  • Terms of use: Apache 2.0. Installed browser and third-party service licenses apply separately.
  • This is a separate product from Playwright MCP, with a different repository and CLI interface.
  • An accessibility tree snapshot does not replace accessibility testing.
  • The CLI launches a headless browser by default; an individual session's state and a saved profile are different modes that must be selected explicitly.

Frequently asked questions

What can you use for free in Playwright CLI?

The CLI and included skill are free under Apache 2.0; automation runs in your environment.

What additional costs might arise with Playwright CLI?

Separate AI model, CI, or cloud browser plans are not included.

What terms of use matter for Playwright CLI?

Apache 2.0. Installed browser and third-party service licenses apply separately.

Which environment can you use Playwright CLI in?

Tech stack: Node.js, JavaScript, TypeScript.

How do you get started with Playwright CLI?

Configure the CLI and skill according to the official README. Open the test page, obtain a snapshot, and perform actions on its elements in sequence. Save a snapshot or screenshot of the problematic state and verify the fix with the same workflow.

What should you consider when choosing Playwright CLI?

The README requires Node.js 18 or newer; check versions and browser support before installation.

Does Playwright CLI retain browser state after closing?

By default, the profile stays in memory: cookies and storage are available during the session but are lost after closing. --persistent saves the profile to disk; state-save/state-load explicitly save and load state.

Related tasks and approaches

  • Playwright MCP

    A candidate to compare under the topic: Responsive design and browsers, Testing and diagnostics. This is an editorial connection by topic, not a confirmed alternative or a guarantee that the products work together.

Tech stack

  • Node.js
  • JavaScript
  • TypeScript

License

Apache 2.0. Installed browser and third-party service licenses apply separately.

Apache 2.0 — permissive license with patent terms

You can use and modify the code in commercial and closed-source projects. When distributing it, retain the license and relevant notices, identify modified files, and include NOTICE if provided. Authors grant a limited patent license for their contributions; it does not grant permission to use trademarks.

License terms

Usage details

This is a separate product from Playwright MCP, with a different repository and CLI interface. The README requires Node.js 18 or newer; check versions and browser support before installation. An accessibility tree snapshot does not replace accessibility testing.

Technologies and topics

  • Playwright
  • CLI
  • Browser
  • Testing
  • Codex

Sources

Other resources