
The @nx/playwright plugin provides various generators to help you create and configure playwright projects within your Nx workspace.
Below is a complete reference for all available generators and their options.

For an overview of the plugin and setup instructions, see the [@nx/playwright introduction](/docs/technologies/test-tools/playwright/introduction).

## `configuration`
Add a Playwright configuration.

**Usage:**
```bash
nx generate @nx/playwright:configuration [options]
```

#### Options

| Option | Type | Description | Default |
|--------|------|-------------|---------|
| `--project` | string [**required**] | The project to add a Playwright configuration to. |  |
| `--ciWebServerAddress` | string | The address of the web server when the `CI` environment variable is set. Defaults to `webServerAddress`. |  |
| `--ciWebServerCommand` | string | The command to start the web server when the `CI` environment variable is set. Defaults to `webServerCommand`. |  |
| `--directory` | string | A directory where the project is placed relative from the project root. | `"e2e"` |
| `--enableTypedLinting` | boolean | Whether to enable typed linting. For flat configs, this configures the recommended `parserOptions.projectService` and `tsconfigRootDir`. For legacy `.eslintrc` configs, this configures `parserOptions.project`. We do not enable this by default for lint performance reasons. | `false` |
| `--js` | boolean | Generate JavaScript files rather than TypeScript files. | `false` |
| `--linter` | string | The tool to use for running lint checks. Defaults to the linter the workspace already uses. |  |
| `--rootProject` | boolean | Create a application at the root of the workspace | `false` |
| `--skipFormat` | boolean | Skip formatting files. | `false` |
| `--skipInstall` | boolean | Skip running `playwright install`. This is to ensure that playwright browsers are installed. | `false` |
| `--skipPackageJson` | boolean | Do not add dependencies to `package.json`. | `false` |
| `--webServerAddress` | string | The address of the web server. |  |
| `--webServerCommand` | string | The command to start the web server. |  |

## `convert-to-inferred`
Convert existing Playwright project(s) using `@nx/playwright:playwright` executor to use `@nx/playwright/plugin`. Defaults to migrating all projects. Pass '--project' to migrate only one target.

**Usage:**
```bash
nx generate @nx/playwright:convert-to-inferred [options]
```

#### Options

| Option | Type | Description | Default |
|--------|------|-------------|---------|
| `--project` | string | The project to convert from using the `@nx/playwright:playwright` executor to use `@nx/playwright/plugin`. |  |
| `--skipFormat` | boolean | Whether to format files at the end of the migration. | `false` |

## Getting Help

You can get help for any generator by adding the `--help` flag:

```bash
nx generate @nx/playwright:<generator> --help
```
