{"_id":"@playwright/cli","_rev":"4115798","name":"@playwright/cli","description":"Playwright CLI","dist-tags":{"latest":"0.1.0"},"maintainers":[{"name":"dgozman-ms","email":""},{"name":"pavelfeldman","email":""},{"name":"playwright-bot","email":""},{"name":"yurys","email":""}],"time":{"modified":"2026-02-13T21:48:10.000Z","created":"2026-01-26T22:39:51.886Z","0.1.0":"2026-02-07T01:48:09.692Z","0.0.66":"2026-02-06T18:10:58.830Z","0.0.65":"2026-02-06T01:28:10.124Z","0.0.64":"2026-02-06T01:16:56.540Z","0.0.63":"2026-02-04T00:05:37.633Z","0.0.62":"2026-01-31T01:45:40.165Z","0.0.61":"2026-01-26T22:58:45.054Z","0.0.60":"2026-01-26T22:39:51.886Z"},"users":{},"author":{"name":"Microsoft Corporation"},"repository":{"type":"git","url":"git+https://github.com/microsoft/playwright-cli.git"},"versions":{"0.1.0":{"name":"@playwright/cli","version":"0.1.0","description":"Playwright CLI","repository":{"type":"git","url":"git+https://github.com/microsoft/playwright-cli.git"},"homepage":"https://playwright.dev","engines":{"node":">=18"},"author":{"name":"Microsoft Corporation"},"license":"Apache-2.0","scripts":{"test":"playwright test"},"devDependencies":{"@playwright/test":"1.59.0-alpha-1770426101000","@types/node":"^25.2.1"},"dependencies":{"minimist":"^1.2.5","playwright":"1.59.0-alpha-1770426101000"},"bin":{"playwright-cli":"playwright-cli.js"},"gitHead":"7ff4d6258fe9d1123a560c676bd0dad70a022aa9","_id":"@playwright/cli@0.1.0","bugs":{"url":"https://github.com/microsoft/playwright-cli/issues"},"_nodeVersion":"20.20.0","_npmVersion":"11.9.0","dist":{"shasum":"66136ef745281fa43ea8c97b32e2068879c2c38c","size":10521,"noattachment":false,"key":"/@playwright/cli/-/@playwright/cli-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@playwright/cli/download/@playwright/cli-0.1.0.tgz"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:7409368c-6d69-436a-a8b3-e4dc0f087a1c"}},"directories":{},"maintainers":[{"name":"dgozman-ms","email":""},{"name":"pavelfeldman","email":""},{"name":"playwright-bot","email":""},{"name":"yurys","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cli_0.1.0_1770428889543_0.8301809521013763"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-02-07T01:48:09.692Z","publish_time":1770428889692,"_source_registry_name":"default","_cnpm_publish_time":1770428889692},"0.0.66":{"name":"@playwright/cli","version":"0.0.66","description":"Playwright CLI","repository":{"type":"git","url":"git+https://github.com/microsoft/playwright-cli.git"},"homepage":"https://playwright.dev","engines":{"node":">=18"},"author":{"name":"Microsoft Corporation"},"license":"Apache-2.0","scripts":{"lint":"echo OK","build":"echo OK","test":"playwright test"},"dependencies":{"minimist":"^1.2.5","playwright":"1.59.0-alpha-1770400094000","playwright-core":"1.59.0-alpha-1770400094000"},"bin":{"playwright-cli":"playwright-cli.js"},"_id":"@playwright/cli@0.0.66","gitHead":"0e6e6d216e47e924d117e69a7640baaaffd40cc7","bugs":{"url":"https://github.com/microsoft/playwright-cli/issues"},"_nodeVersion":"22.21.1","_npmVersion":"10.9.4","dist":{"shasum":"ece0e67ce7f737f73347191cb5de35669321f424","size":10518,"noattachment":false,"key":"/@playwright/cli/-/@playwright/cli-0.0.66.tgz","tarball":"http://registry.cnpm.dingdandao.com/@playwright/cli/download/@playwright/cli-0.0.66.tgz"},"_npmUser":{"name":"pavelfeldman","email":"pavel.feldman@gmail.com"},"directories":{},"maintainers":[{"name":"dgozman-ms","email":""},{"name":"pavelfeldman","email":""},{"name":"playwright-bot","email":""},{"name":"yurys","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cli_0.0.66_1770401458682_0.7198188193628594"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-02-06T18:10:58.830Z","publish_time":1770401458830,"_source_registry_name":"default","_cnpm_publish_time":1770401458830},"0.0.65":{"name":"@playwright/cli","version":"0.0.65","description":"Playwright CLI","repository":{"type":"git","url":"git+https://github.com/microsoft/playwright-cli.git"},"homepage":"https://playwright.dev","engines":{"node":">=18"},"author":{"name":"Microsoft Corporation"},"license":"Apache-2.0","scripts":{"lint":"echo OK","build":"echo OK","test":"playwright test"},"dependencies":{"minimist":"^1.2.5","playwright":"1.59.0-alpha-1770338664000","playwright-core":"1.59.0-alpha-1770338664000"},"bin":{"playwright-cli":"playwright-cli.js"},"_id":"@playwright/cli@0.0.65","gitHead":"f639130aef5724cd6b03028a6d23244e7c9d568d","bugs":{"url":"https://github.com/microsoft/playwright-cli/issues"},"_nodeVersion":"22.21.1","_npmVersion":"10.9.4","dist":{"shasum":"1958ae8fa3be24c0e424256e43d36696abcc86e3","size":10422,"noattachment":false,"key":"/@playwright/cli/-/@playwright/cli-0.0.65.tgz","tarball":"http://registry.cnpm.dingdandao.com/@playwright/cli/download/@playwright/cli-0.0.65.tgz"},"_npmUser":{"name":"pavelfeldman","email":"pavel.feldman@gmail.com"},"directories":{},"maintainers":[{"name":"dgozman-ms","email":""},{"name":"pavelfeldman","email":""},{"name":"playwright-bot","email":""},{"name":"yurys","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cli_0.0.65_1770341289953_0.19768586112889142"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-02-06T01:28:10.124Z","publish_time":1770341290124,"_source_registry_name":"default","_cnpm_publish_time":1770341290124},"0.0.64":{"name":"@playwright/cli","version":"0.0.64","description":"Playwright CLI","repository":{"type":"git","url":"git+https://github.com/microsoft/playwright-cli.git"},"homepage":"https://playwright.dev","engines":{"node":">=18"},"author":{"name":"Microsoft Corporation"},"license":"Apache-2.0","scripts":{"lint":"echo OK","build":"echo OK","test":"playwright test"},"dependencies":{"minimist":"^1.2.5","playwright":"1.59.0-alpha-1770338664000","playwright-core":"1.59.0-alpha-1770338664000"},"bin":{"playwright-cli":"playwright-cli.js"},"_id":"@playwright/cli@0.0.64","gitHead":"5cb33aed0dc79a884e60d566a8ffb756b8b5fa1a","bugs":{"url":"https://github.com/microsoft/playwright-cli/issues"},"_nodeVersion":"22.21.1","_npmVersion":"10.9.4","dist":{"shasum":"19bf122bad771fb4674ea11c3e69c8596e5e71e5","size":10419,"noattachment":false,"key":"/@playwright/cli/-/@playwright/cli-0.0.64.tgz","tarball":"http://registry.cnpm.dingdandao.com/@playwright/cli/download/@playwright/cli-0.0.64.tgz"},"_npmUser":{"name":"pavelfeldman","email":"pavel.feldman@gmail.com"},"directories":{},"maintainers":[{"name":"dgozman-ms","email":""},{"name":"pavelfeldman","email":""},{"name":"playwright-bot","email":""},{"name":"yurys","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cli_0.0.64_1770340616401_0.4727540388375655"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-02-06T01:16:56.540Z","publish_time":1770340616540,"_source_registry_name":"default","_cnpm_publish_time":1770340616540},"0.0.63":{"name":"@playwright/cli","version":"0.0.63","description":"Playwright CLI","repository":{"type":"git","url":"git+https://github.com/microsoft/playwright-cli.git"},"homepage":"https://playwright.dev","engines":{"node":">=18"},"author":{"name":"Microsoft Corporation"},"license":"Apache-2.0","scripts":{"lint":"echo OK","build":"echo OK","test":"playwright test"},"dependencies":{"minimist":"^1.2.5","playwright":"1.59.0-alpha-1770157258000","playwright-core":"1.59.0-alpha-1770157258000"},"bin":{"playwright-cli":"playwright-cli.js"},"_id":"@playwright/cli@0.0.63","gitHead":"de6776f318da35bfd205d0f44e0a92b5bc840711","bugs":{"url":"https://github.com/microsoft/playwright-cli/issues"},"_nodeVersion":"22.21.1","_npmVersion":"10.9.4","dist":{"shasum":"44da8d49a256bd8ce8022b9242aec0df062621bf","size":10323,"noattachment":false,"key":"/@playwright/cli/-/@playwright/cli-0.0.63.tgz","tarball":"http://registry.cnpm.dingdandao.com/@playwright/cli/download/@playwright/cli-0.0.63.tgz"},"_npmUser":{"name":"pavelfeldman","email":"pavel.feldman@gmail.com"},"directories":{},"maintainers":[{"name":"dgozman-ms","email":""},{"name":"pavelfeldman","email":""},{"name":"playwright-bot","email":""},{"name":"yurys","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cli_0.0.63_1770163537479_0.19052246041142218"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-02-04T00:05:37.633Z","publish_time":1770163537633,"_source_registry_name":"default","_cnpm_publish_time":1770163537633},"0.0.62":{"name":"@playwright/cli","version":"0.0.62","description":"Playwright CLI","repository":{"type":"git","url":"git+https://github.com/microsoft/playwright-cli.git"},"homepage":"https://playwright.dev","engines":{"node":">=18"},"author":{"name":"Microsoft Corporation"},"license":"Apache-2.0","scripts":{"lint":"echo OK","build":"echo OK","test":"echo OK"},"dependencies":{"minimist":"^1.2.5","playwright":"1.59.0-alpha-1769819922000","playwright-core":"1.59.0-alpha-1769819922000"},"bin":{"playwright-cli":"playwright-cli.js"},"_id":"@playwright/cli@0.0.62","gitHead":"d246fff5d74dbc0f11b72cb96151ded7994075d9","bugs":{"url":"https://github.com/microsoft/playwright-cli/issues"},"_nodeVersion":"22.21.1","_npmVersion":"10.9.4","dist":{"shasum":"fd9ec63f94c919925f292c8d81185983baf542cb","size":9823,"noattachment":false,"key":"/@playwright/cli/-/@playwright/cli-0.0.62.tgz","tarball":"http://registry.cnpm.dingdandao.com/@playwright/cli/download/@playwright/cli-0.0.62.tgz"},"_npmUser":{"name":"pavelfeldman","email":"pavel.feldman@gmail.com"},"directories":{},"maintainers":[{"name":"dgozman-ms","email":""},{"name":"pavelfeldman","email":""},{"name":"playwright-bot","email":""},{"name":"yurys","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cli_0.0.62_1769823940004_0.5024808368891545"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-01-31T01:45:40.165Z","publish_time":1769823940165,"_source_registry_name":"default","_cnpm_publish_time":1769823940165},"0.0.61":{"name":"@playwright/cli","version":"0.0.61","description":"Playwright CLI","repository":{"type":"git","url":"git+https://github.com/microsoft/playwright-cli.git"},"homepage":"https://playwright.dev","engines":{"node":">=18"},"author":{"name":"Microsoft Corporation"},"license":"Apache-2.0","scripts":{"lint":"echo OK","build":"echo OK","test":"echo OK"},"dependencies":{"minimist":"^1.2.5","playwright":"1.59.0-alpha-1769452054000","playwright-core":"1.59.0-alpha-1769452054000"},"bin":{"playwright-cli":"playwright-cli.js"},"_id":"@playwright/cli@0.0.61","gitHead":"bb060f10acec25bd1aa0cc9a5ac92bade06acc1a","bugs":{"url":"https://github.com/microsoft/playwright-cli/issues"},"_nodeVersion":"22.21.1","_npmVersion":"10.9.4","dist":{"shasum":"1b708ecafe9b4f2d85bad4f08223c0bf87649a5e","size":9822,"noattachment":false,"key":"/@playwright/cli/-/@playwright/cli-0.0.61.tgz","tarball":"http://registry.cnpm.dingdandao.com/@playwright/cli/download/@playwright/cli-0.0.61.tgz"},"_npmUser":{"name":"pavelfeldman","email":"pavel.feldman@gmail.com"},"directories":{},"maintainers":[{"name":"dgozman-ms","email":""},{"name":"pavelfeldman","email":""},{"name":"playwright-bot","email":""},{"name":"yurys","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cli_0.0.61_1769468324879_0.6279532149390499"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-01-26T22:58:45.054Z","publish_time":1769468325054,"_source_registry_name":"default","_cnpm_publish_time":1769468325054},"0.0.60":{"name":"@playwright/cli","version":"0.0.60","author":{"name":"Microsoft Corporation"},"license":"Apache-2.0","_id":"@playwright/cli@0.0.60","maintainers":[{"name":"dgozman-ms","email":""},{"name":"pavelfeldman","email":""},{"name":"playwright-bot","email":""},{"name":"yurys","email":""}],"homepage":"https://playwright.dev","bugs":{"url":"https://github.com/microsoft/playwright-cli/issues"},"bin":{"playwright-cli":"playwright-cli.js"},"dist":{"shasum":"293d1704b54387e7a3da5f325aab0c793d10742c","size":9824,"noattachment":false,"key":"/@playwright/cli/-/@playwright/cli-0.0.60.tgz","tarball":"http://registry.cnpm.dingdandao.com/@playwright/cli/download/@playwright/cli-0.0.60.tgz"},"engines":{"node":">=18"},"gitHead":"b0c90fb8383bed1489a478c15d839d6388255d43","scripts":{"lint":"echo OK","test":"echo OK","build":"echo OK"},"_npmUser":{"name":"pavelfeldman","email":"pavel.feldman@gmail.com"},"repository":{"url":"git+https://github.com/microsoft/playwright-cli.git","type":"git"},"_npmVersion":"10.9.4","description":"Playwright CLI","directories":{},"_nodeVersion":"22.21.1","dependencies":{"minimist":"^1.2.5","playwright":"1.59.0-alpha-1769452054000","playwright-core":"1.59.0-alpha-1769452054000"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/cli_0.0.60_1769467191742_0.5812090949604201","host":"s3://npm-registry-packages-npm-production"},"_cnpmcore_publish_time":"2026-01-26T22:39:51.886Z","publish_time":1769467191886,"_source_registry_name":"default","_cnpm_publish_time":1769467191886}},"readme":"# playwright-cli\n\nPlaywright CLI with SKILLS\n\n### Playwright CLI vs Playwright MCP\n\nThis package provides CLI interface into Playwright. If you are using **coding agents**, that is the best fit.\n\n- **CLI**: Modern **coding agents** increasingly favor CLI–based workflows exposed as SKILLs over MCP because CLI invocations are more token-efficient: they avoid loading large tool schemas and verbose accessibility trees into the model context, allowing agents to act through concise, purpose-built commands. This makes CLI + SKILLs better suited for high-throughput coding agents that must balance browser automation with large codebases, tests, and reasoning within limited context windows.\n\n- **MCP**: MCP remains relevant for specialized agentic loops that benefit from persistent state, rich introspection, and iterative reasoning over page structure, such as exploratory automation, self-healing tests, or long-running autonomous workflows where maintaining continuous browser context outweighs token cost concerns. Learn more about [Playwright MCP](https://github.com/microsoft/playwright-mcp).\n\n### Key Features\n\n- **Token-efficient**. Does not force page data into LLM.\n\n### Requirements\n- Node.js 18 or newer\n- Claude Code, GitHub Copilot, or any other coding agent.\n\n## Getting Started\n\n## Installation\n\n```bash\nnpm install -g @playwright/cli@latest\nplaywright-cli --help\n```\n\n### Installing skills\n\nClaude Code, GitHub Copilot and others will use the locally installed skills.\n\n```bash\nplaywright-cli install --skills\n```\n\n### Skills-less operation\n\nPoint your agent at the CLI and let it cook. It'll read the skill off `playwright-cli --help` on its own:\n\n```\nTest the \"add todo\" flow on https://demo.playwright.dev/todomvc using playwright-cli.\nCheck playwright-cli --help for available commands.\n```\n\n## Demo\n\n```\n> Use playwright skills to test https://demo.playwright.dev/todomvc/.\n  Take screenshots for all successful and failing scenarios. \n```\n\nYour agent will be running commands, but it does not mean you can't play with it manually:\n\n```\nplaywright-cli open https://demo.playwright.dev/todomvc/ --headed\nplaywright-cli type \"Buy groceries\"\nplaywright-cli press Enter\nplaywright-cli type \"Water flowers\"\nplaywright-cli press Enter\nplaywright-cli check e21\nplaywright-cli check e35\nplaywright-cli screenshot\n```\n\n## Headed operation\n\nPlaywright CLI is headless by default. If you'd like to see the browser, pass `--headed` to `open`:\n\n```bash\nplaywright-cli open https://playwright.dev --headed\n```\n\n## Sessions\n\nPlaywright CLI will use a dedicated persistent profile by default. It means that\nyour cookies and other storage state will be preserved between the calls. You can use different\ninstances of the browser for different projects with sessions.\n\nFollowing will result in two browsers with separate profiles being available. Pass `-s=` to\nthe invocation to talk to a specific browser.\n\n```bash\nplaywright-cli open https://playwright.dev\nplaywright-cli -s=example open https://example.com\nplaywright-cli list\n```\n\nYou can run your coding agent with the `PLAYWRIGHT_CLI_SESSION` environment variable:\n\n```bash\nPLAYWRIGHT_CLI_SESSION=todo-app claude .\n```\n\nOr instruct it to prepend `-s=` to the calls.\n\nManage your sessions as follows:\n\n```bash\nplaywright-cli list                     # list all sessions\nplaywright-cli close-all                # close all browsers\nplaywright-cli kill-all                 # forcefully kill all browser processes\n```\n\n<!-- BEGIN GENERATED CLI HELP -->\n\n## Commands\n\n### Core\n\n```bash\nplaywright-cli open [url]               # open browser, optionally navigate to url\nplaywright-cli goto <url>               # navigate to a url\nplaywright-cli close                    # close the page\nplaywright-cli type <text>              # type text into editable element\nplaywright-cli click <ref> [button]     # perform click on a web page\nplaywright-cli dblclick <ref> [button]  # perform double click on a web page\nplaywright-cli fill <ref> <text>        # fill text into editable element\nplaywright-cli drag <startRef> <endRef> # perform drag and drop between two elements\nplaywright-cli hover <ref>              # hover over element on page\nplaywright-cli select <ref> <val>       # select an option in a dropdown\nplaywright-cli upload <file>            # upload one or multiple files\nplaywright-cli check <ref>              # check a checkbox or radio button\nplaywright-cli uncheck <ref>            # uncheck a checkbox or radio button\nplaywright-cli snapshot                 # capture page snapshot to obtain element ref\nplaywright-cli snapshot --filename=f    # save snapshot to specific file\nplaywright-cli eval <func> [ref]        # evaluate javascript expression on page or element\nplaywright-cli dialog-accept [prompt]   # accept a dialog\nplaywright-cli dialog-dismiss           # dismiss a dialog\nplaywright-cli resize <w> <h>           # resize the browser window\n```\n\n### Navigation\n\n```bash\nplaywright-cli go-back                  # go back to the previous page\nplaywright-cli go-forward               # go forward to the next page\nplaywright-cli reload                   # reload the current page\n```\n\n### Keyboard\n\n```bash\nplaywright-cli press <key>              # press a key on the keyboard, `a`, `arrowleft`\nplaywright-cli keydown <key>            # press a key down on the keyboard\nplaywright-cli keyup <key>              # press a key up on the keyboard\n```\n\n### Mouse\n\n```bash\nplaywright-cli mousemove <x> <y>        # move mouse to a given position\nplaywright-cli mousedown [button]       # press mouse down\nplaywright-cli mouseup [button]         # press mouse up\nplaywright-cli mousewheel <dx> <dy>     # scroll mouse wheel\n```\n\n### Save as\n\n```bash\nplaywright-cli screenshot [ref]         # screenshot of the current page or element\nplaywright-cli screenshot --filename=f  # save screenshot with specific filename\nplaywright-cli pdf                      # save page as pdf\nplaywright-cli pdf --filename=page.pdf  # save pdf with specific filename\n```\n\n### Tabs\n\n```bash\nplaywright-cli tab-list                 # list all tabs\nplaywright-cli tab-new [url]            # create a new tab\nplaywright-cli tab-close [index]        # close a browser tab\nplaywright-cli tab-select <index>       # select a browser tab\n```\n\n### Storage\n\n```bash\nplaywright-cli state-save [filename]    # save storage state\nplaywright-cli state-load <filename>    # load storage state\n\n# Cookies\nplaywright-cli cookie-list [--domain]   # list cookies\nplaywright-cli cookie-get <name>        # get a cookie\nplaywright-cli cookie-set <name> <val>  # set a cookie\nplaywright-cli cookie-delete <name>     # delete a cookie\nplaywright-cli cookie-clear             # clear all cookies\n\n# LocalStorage\nplaywright-cli localstorage-list        # list localStorage entries\nplaywright-cli localstorage-get <key>   # get localStorage value\nplaywright-cli localstorage-set <k> <v> # set localStorage value\nplaywright-cli localstorage-delete <k>  # delete localStorage entry\nplaywright-cli localstorage-clear       # clear all localStorage\n\n# SessionStorage\nplaywright-cli sessionstorage-list      # list sessionStorage entries\nplaywright-cli sessionstorage-get <k>   # get sessionStorage value\nplaywright-cli sessionstorage-set <k> <v> # set sessionStorage value\nplaywright-cli sessionstorage-delete <k>  # delete sessionStorage entry\nplaywright-cli sessionstorage-clear     # clear all sessionStorage\n```\n\n### Network\n\n```bash\nplaywright-cli route <pattern> [opts]   # mock network requests\nplaywright-cli route-list               # list active routes\nplaywright-cli unroute [pattern]        # remove route(s)\n```\n\n### DevTools\n\n```bash\nplaywright-cli console [min-level]      # list console messages\nplaywright-cli network                  # list all network requests since loading the page\nplaywright-cli run-code <code>          # run playwright code snippet\nplaywright-cli tracing-start            # start trace recording\nplaywright-cli tracing-stop             # stop trace recording\nplaywright-cli video-start              # start video recording\nplaywright-cli video-stop [filename]    # stop video recording\n```\n\n### Install\n\n```bash\nplaywright-cli install --skills         # install skills\nplaywright-cli install-browser          # install browser\n```\n\n### Configuration\n\n```bash\nplaywright-cli config [options]         # configure session settings\nplaywright-cli open --browser=chrome    # use specific browser\nplaywright-cli open --extension         # connect via browser extension\nplaywright-cli open --persistent        # use persistent profile\nplaywright-cli open --profile=<path>    # use custom profile directory\nplaywright-cli open --config=file.json  # use config file\nplaywright-cli close                    # close the browser\nplaywright-cli delete-data              # delete user data for default session\n```\n\n### Sessions\n\n```bash\nplaywright-cli -s=name <cmd>            # run command in named session\nplaywright-cli -s=name close            # stop a named browser\nplaywright-cli -s=name delete-data      # delete user data for named browser\nplaywright-cli list                     # list all sessions\nplaywright-cli close-all                # close all browsers\nplaywright-cli kill-all                 # forcefully kill all browser processes\n```\n<!-- END GENERATED CLI HELP -->\n\n## Configuration file\n\nThe Playwright CLI can be configured using a JSON configuration file. You can specify the configuration file using the `--config` command line option:\n\n```bash\nplaywright-cli --config path/to/config.json open example.com\n```\n\nPlaywright CLI will load config from `playwright-cli.json` by default so that you did not need to specify it every time.\n\n<details>\n<summary>Configuration file schema</summary>\n\n```typescript\n{\n  /**\n   * The browser to use.\n   */\n  browser?: {\n    /**\n     * The type of browser to use.\n     */\n    browserName?: 'chromium' | 'firefox' | 'webkit';\n\n    /**\n     * Keep the browser profile in memory, do not save it to disk.\n     */\n    isolated?: boolean;\n\n    /**\n     * Path to a user data directory for browser profile persistence.\n     * Temporary directory is created by default.\n     */\n    userDataDir?: string;\n\n    /**\n     * Launch options passed to\n     * @see https://playwright.dev/docs/api/class-browsertype#browser-type-launch-persistent-context\n     *\n     * This is useful for settings options like `channel`, `headless`, `executablePath`, etc.\n     */\n    launchOptions?: playwright.LaunchOptions;\n\n    /**\n     * Context options for the browser context.\n     *\n     * This is useful for settings options like `viewport`.\n     */\n    contextOptions?: playwright.BrowserContextOptions;\n\n    /**\n     * Chrome DevTools Protocol endpoint to connect to an existing browser instance in case of Chromium family browsers.\n     */\n    cdpEndpoint?: string;\n\n    /**\n     * CDP headers to send with the connect request.\n     */\n    cdpHeaders?: Record<string, string>;\n\n    /**\n     * Timeout in milliseconds for connecting to CDP endpoint. Defaults to 30000 (30 seconds). Pass 0 to disable timeout.\n     */\n    cdpTimeout?: number;\n\n    /**\n     * Remote endpoint to connect to an existing Playwright server.\n     */\n    remoteEndpoint?: string;\n\n    /**\n     * Paths to TypeScript files to add as initialization scripts for Playwright page.\n     */\n    initPage?: string[];\n\n    /**\n     * Paths to JavaScript files to add as initialization scripts.\n     * The scripts will be evaluated in every page before any of the page's scripts.\n     */\n    initScript?: string[];\n  },\n\n  /**\n   * If specified, saves the Playwright video of the session into the output directory.\n   */\n  saveVideo?: {\n    width: number;\n    height: number;\n  };\n\n  /**\n   * The directory to save output files.\n   */\n  outputDir?: string;\n\n  /**\n   * Whether to save snapshots, console messages, network logs and other session logs to a file or to the standard output. Defaults to \"stdout\".\n   */\n  outputMode?: 'file' | 'stdout';\n\n  console?: {\n    /**\n     * The level of console messages to return. Each level includes the messages of more severe levels. Defaults to \"info\".\n     */\n    level?: 'error' | 'warning' | 'info' | 'debug';\n  },\n\n  network?: {\n    /**\n     * List of origins to allow the browser to request. Default is to allow all. Origins matching both `allowedOrigins` and `blockedOrigins` will be blocked.\n     */\n    allowedOrigins?: string[];\n\n    /**\n     * List of origins to block the browser to request. Origins matching both `allowedOrigins` and `blockedOrigins` will be blocked.\n     */\n    blockedOrigins?: string[];\n  };\n\n  /**\n   * Specify the attribute to use for test ids, defaults to \"data-testid\".\n   */\n  testIdAttribute?: string;\n\n  timeouts?: {\n    /*\n     * Configures default action timeout: https://playwright.dev/docs/api/class-page#page-set-default-timeout. Defaults to 5000ms.\n     */\n    action?: number;\n\n    /*\n     * Configures default navigation timeout: https://playwright.dev/docs/api/class-page#page-set-default-navigation-timeout. Defaults to 60000ms.\n     */\n    navigation?: number;\n  };\n\n  /**\n   * Whether to allow file uploads from anywhere on the file system.\n   * By default (false), file uploads are restricted to paths within the MCP roots only.\n   */\n  allowUnrestrictedFileAccess?: boolean;\n\n  /**\n   * Specify the language to use for code generation.\n   */\n  codegen?: 'typescript' | 'none';\n}\n```\n\n</details>\n\n<details>\n<summary>Configuration via env</summary>\n\n| Environment |\n|-------------|\n| `PLAYWRIGHT_MCP_ALLOWED_HOSTS` comma-separated list of hosts this server is allowed to serve from. Defaults to the host the server is bound to. Pass '*' to disable the host check. |\n| `PLAYWRIGHT_MCP_ALLOWED_ORIGINS` semicolon-separated list of TRUSTED origins to allow the browser to request. Default is to allow all. Important: *does not* serve as a security boundary and *does not* affect redirects. |\n| `PLAYWRIGHT_MCP_ALLOW_UNRESTRICTED_FILE_ACCESS` allow access to files outside of the workspace roots. Also allows unrestricted access to file:// URLs. By default access to file system is restricted to workspace root directories (or cwd if no roots are configured) only, and navigation to file:// URLs is blocked. |\n| `PLAYWRIGHT_MCP_BLOCKED_ORIGINS` semicolon-separated list of origins to block the browser from requesting. Blocklist is evaluated before allowlist. If used without the allowlist, requests not matching the blocklist are still allowed. Important: *does not* serve as a security boundary and *does not* affect redirects. |\n| `PLAYWRIGHT_MCP_BLOCK_SERVICE_WORKERS` block service workers |\n| `PLAYWRIGHT_MCP_BROWSER` browser or chrome channel to use, possible values: chrome, firefox, webkit, msedge. |\n| `PLAYWRIGHT_MCP_CAPS` comma-separated list of additional capabilities to enable, possible values: vision, pdf. |\n| `PLAYWRIGHT_MCP_CDP_ENDPOINT` CDP endpoint to connect to. |\n| `PLAYWRIGHT_MCP_CDP_HEADER` CDP headers to send with the connect request, multiple can be specified. |\n| `PLAYWRIGHT_MCP_CODEGEN` specify the language to use for code generation, possible values: \"typescript\", \"none\". Default is \"typescript\". |\n| `PLAYWRIGHT_MCP_CONFIG` path to the configuration file. |\n| `PLAYWRIGHT_MCP_CONSOLE_LEVEL` level of console messages to return: \"error\", \"warning\", \"info\", \"debug\". Each level includes the messages of more severe levels. |\n| `PLAYWRIGHT_MCP_DEVICE` device to emulate, for example: \"iPhone 15\" |\n| `PLAYWRIGHT_MCP_EXECUTABLE_PATH` path to the browser executable. |\n| `PLAYWRIGHT_MCP_EXTENSION` Connect to a running browser instance (Edge/Chrome only). Requires the \"Playwright MCP Bridge\" browser extension to be installed. |\n| `PLAYWRIGHT_MCP_GRANT_PERMISSIONS` List of permissions to grant to the browser context, for example \"geolocation\", \"clipboard-read\", \"clipboard-write\". |\n| `PLAYWRIGHT_MCP_HEADLESS` run browser in headless mode, headed by default |\n| `PLAYWRIGHT_MCP_HOST` host to bind server to. Default is localhost. Use 0.0.0.0 to bind to all interfaces. |\n| `PLAYWRIGHT_MCP_IGNORE_HTTPS_ERRORS` ignore https errors |\n| `PLAYWRIGHT_MCP_INIT_PAGE` path to TypeScript file to evaluate on Playwright page object |\n| `PLAYWRIGHT_MCP_INIT_SCRIPT` path to JavaScript file to add as an initialization script. The script will be evaluated in every page before any of the page's scripts. Can be specified multiple times. |\n| `PLAYWRIGHT_MCP_ISOLATED` keep the browser profile in memory, do not save it to disk. |\n| `PLAYWRIGHT_MCP_IMAGE_RESPONSES` whether to send image responses to the client. Can be \"allow\" or \"omit\", Defaults to \"allow\". |\n| `PLAYWRIGHT_MCP_NO_SANDBOX` disable the sandbox for all process types that are normally sandboxed. |\n| `PLAYWRIGHT_MCP_OUTPUT_DIR` path to the directory for output files. |\n| `PLAYWRIGHT_MCP_OUTPUT_MODE` whether to save snapshots, console messages, network logs to a file or to the standard output. Can be \"file\" or \"stdout\". Default is \"stdout\". |\n| `PLAYWRIGHT_MCP_PORT` port to listen on for SSE transport. |\n| `PLAYWRIGHT_MCP_PROXY_BYPASS` comma-separated domains to bypass proxy, for example \".com,chromium.org,.domain.com\" |\n| `PLAYWRIGHT_MCP_PROXY_SERVER` specify proxy server, for example \"http://myproxy:3128\" or \"socks5://myproxy:8080\" |\n| `PLAYWRIGHT_MCP_SAVE_SESSION` Whether to save the Playwright MCP session into the output directory. |\n| `PLAYWRIGHT_MCP_SAVE_TRACE` Whether to save the Playwright Trace of the session into the output directory. |\n| `PLAYWRIGHT_MCP_SAVE_VIDEO` Whether to save the video of the session into the output directory. For example \"--save-video=800x600\" |\n| `PLAYWRIGHT_MCP_SECRETS` path to a file containing secrets in the dotenv format |\n| `PLAYWRIGHT_MCP_SHARED_BROWSER_CONTEXT` reuse the same browser context between all connected HTTP clients. |\n| `PLAYWRIGHT_MCP_SNAPSHOT_MODE` when taking snapshots for responses, specifies the mode to use. Can be \"incremental\", \"full\", or \"none\". Default is incremental. |\n| `PLAYWRIGHT_MCP_STORAGE_STATE` path to the storage state file for isolated sessions. |\n| `PLAYWRIGHT_MCP_TEST_ID_ATTRIBUTE` specify the attribute to use for test ids, defaults to \"data-testid\" |\n| `PLAYWRIGHT_MCP_TIMEOUT_ACTION` specify action timeout in milliseconds, defaults to 5000ms |\n| `PLAYWRIGHT_MCP_TIMEOUT_NAVIGATION` specify navigation timeout in milliseconds, defaults to 60000ms |\n| `PLAYWRIGHT_MCP_USER_AGENT` specify user agent string |\n| `PLAYWRIGHT_MCP_USER_DATA_DIR` path to the user data directory. If not specified, a temporary directory will be created. |\n| `PLAYWRIGHT_MCP_VIEWPORT_SIZE` specify browser viewport size in pixels, for example \"1280x720\" |\n</details>\n\n## Specific tasks\n\nThe installed skill includes detailed reference guides for common tasks:\n\n* **Request mocking** — intercept and mock network requests\n* **Running Playwright code** — execute arbitrary Playwright scripts\n* **Browser session management** — manage multiple browser sessions\n* **Storage state (cookies, localStorage)** — persist and restore browser state\n* **Test generation** — generate Playwright tests from interactions\n* **Tracing** — record and inspect execution traces\n* **Video recording** — capture browser session videos\n","_attachments":{},"homepage":"https://playwright.dev","bugs":{"url":"https://github.com/microsoft/playwright-cli/issues"},"license":"Apache-2.0"}