# Playwright CLI for browser automation and test generation
Run, debug, record, and inspect browser tests from terminal workflows.
Agent Readiness Score: 79/100
Playwright CLI is useful for agents when usage is constrained to predictable commands and documented output.
## Install

- Recommended: `npm init playwright@latest`

## Structured output

Supported output formats: json, html, junit.
Prefer structured output flags such as `--json`, `--format json`, or equivalent when available.

## Safe commands

- Show help: `playwright@latest --help` — Inspect command surface before automation.
- Check version: `playwright@latest --version` — Verify the installed CLI.

## Agent instructions

- Claude Code / Codex CLI / Gemini CLI: Use Playwright CLI only with non-interactive commands. Prefer structured output: json, html, junit. Ask before destructive operations.

## Safety notes

- Prefer non-interactive usage and explicit output flags when an agent runs this command.
- Treat commands that deploy, delete, charge money, or mutate production data as approval-required.
- Record the exact command, output format, and scope before adding it to an agent workflow.

## Metadata

Official URL: https://playwright.dev/
GitHub: https://github.com/microsoft/playwright
Docs: https://playwright.dev/
