Skip to main content

Installation

Prerequisites

  • Node.js 20 or newer
  • A coding agent: Claude Code, GitHub Copilot, or similar

Global installation

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

Local installation (npx)

npx playwright-cli --help

Installing browsers

The CLI downloads a browser automatically on first use. To install explicitly:

playwright-cli install-browser               # install default (chromium)
playwright-cli install-browser firefox # install specific browser
playwright-cli install-browser --with-deps # install with system dependencies

Install options

FlagDescription
--with-depsInstall system dependencies (Linux)
--dry-runPreview what would be installed
--listList available browsers from all installations
--forceForce reinstall even if already present
--only-shellOnly install Chromium headless shell
--no-shellSkip Chromium headless shell

Installing skills

Coding agents like Claude Code and GitHub Copilot can use locally installed skills for richer context about available commands:

playwright-cli install --skills

Skills-less operation

You can also point your agent at the CLI directly and let it discover commands on its own:

Test the "add todo" flow on https://demo.playwright.dev/todomvc using playwright-cli.
Check playwright-cli --help for available commands.

Environment setup

Configure your coding agent to use a specific session:

PLAYWRIGHT_CLI_SESSION=todo-app claude .

Next steps