playwright-cli
by
microsoft

Description: CLI for common Playwright actions. Record and generate Playwright code, inspect selectors and take screenshots.

View on GitHub ↗

Summary Information

Updated 2 hours ago
Added to GitGenius on February 6th, 2026
Created on June 19th, 2020
Open Issues & Pull Requests: 1 (+0)
Number of forks: 622
Total Stargazers: 11,913 (+1)
Total Subscribers: 45 (+0)

Issue Activity (beta)

Open issues: 7
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 23 days
Stale 30+ days: 4
Stale 90+ days: 0

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • P3-collecting-feedback (1)

Most active issues this week

No issue events were indexed in the last 7 days.

Repository Insights (GitGenius)

Median issue/PR response: 16.0 hours
Mean response time: 3.0 days
90th percentile: 5.8 days
Tracked items: 135

Most active contributors

Detailed Description

The Playwright CLI is a command-line interface tool developed by Microsoft that provides token-efficient browser automation capabilities optimized for coding agents and AI-powered development workflows. Written in JavaScript and requiring Node.js 18 or newer, it serves as a modern alternative to the Playwright MCP (Model Context Protocol) by prioritizing efficiency in agent-based interactions through concise CLI commands rather than verbose tool schemas.

The core purpose of Playwright CLI is to expose browser automation as reusable skills that coding agents like Claude Code and GitHub Copilot can invoke directly. The design philosophy emphasizes token efficiency by avoiding the injection of large page data structures into language model contexts, making it particularly suited for high-throughput coding agents that must balance browser automation with large codebases and reasoning within limited context windows. The tool operates headless by default but supports headed mode for visual inspection when needed.

Session management is a central feature of the CLI. By default, the tool maintains browser profiles in memory, preserving cookies and storage state between CLI calls within a session but losing them when the browser closes. Users can enable persistent mode to save profiles to disk for cross-session retention. The CLI supports multiple concurrent browser instances through named sessions, allowing different projects to maintain separate browser contexts. A visual dashboard accessible via the show command provides real-time monitoring of all active sessions, displaying live screencasts, session metadata, and enabling remote control capabilities for observing or intervening in background automation.

The command set covers comprehensive browser interaction patterns including navigation, keyboard input, mouse operations, tab management, storage manipulation, network configuration, and DevTools access. After each command execution, the CLI provides snapshots of the current browser state. Element targeting supports multiple approaches: references from snapshots, CSS selectors, or Playwright locators. The tool includes specialized commands for saving interactions as code, taking screenshots, recording traces, and capturing video sessions.

Configuration flexibility is provided through JSON configuration files, environment variables, and command-line parameters. The CLI can be installed globally or invoked locally via npx. Configuration options control browser selection across Chrome, Firefox, WebKit, and Edge, device emulation, viewport sizing, proxy settings, timeout values, user agent strings, and various security and capability settings including vision and PDF support.

According to GitGenius activity tracking, the repository shows median issue and pull request response latency of 16 hours with a mean of 70.8 hours across 135 tracked items. The most active contributors are pavelfeldman with 116 events, yury-s with 80 events, and Skn0tt with 32 events. The repository maintains overlapping contributor relationships with microsoft/vscode, microsoft/playwright, and denoland/deno, indicating integration within a broader ecosystem of development tools.

The CLI includes task-specific guidance for common workflows such as running and debugging Playwright tests, request mocking, executing arbitrary Playwright scripts, managing browser sessions, spec-driven testing with plan and generate capabilities, storage state persistence, test generation from interactions, execution tracing, video recording, and element attribute inspection. This comprehensive feature set positions Playwright CLI as a practical tool for both manual browser automation and agent-driven testing workflows.

playwright-cli
by
microsoftmicrosoft/playwright-cli

Repository Details

Fetching additional details & charts...