> For the complete documentation index, see [llms.txt](https://docs.currents.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.currents.dev/resources/reporters/currents-playwright/pwc-p.md).

# pwc-p (orchestration)

Currents orchestration pwc-p command-line executable documentation

`pwc-p` is a command-line executable that implements Currents Orchestration for Playwright. See [Orchestration Setup](https://docs.currents.dev/guides/ci-optimization/playwright-orchestration.md) and [Playwright Parallelization](https://docs.currents.dev/guides/ci-optimization/playwright-parallelization.md) for detailed guides.

`pwc-p run` orchestrates the tests across CI machines. With Playwright 1.62 or later and `@currents/playwright` 2.9.0 or later, `pwc-p run` also takes Playwright test filters such as `--grep` and `--project`. To re-run only failed tests, or to filter tests on an older Playwright, run `pwc-p discover` first to write the test list to a file.

## Subcommands

* [**`pwc-p run`**](https://docs.currents.dev/resources/reporters/currents-playwright/pwc-p/pwc-p-run.md) — Starts orchestration and executes tests with load balancing. Accepts [Configuration](https://docs.currents.dev/resources/reporters/currents-playwright/configuration.md) options, supported Playwright runtime flags (`-j`, `--timeout`, and similar) and, on Playwright 1.62+, Playwright test filters (`--grep`, `--project`, spec paths, and similar).
* [**`pwc-p discover`**](https://docs.currents.dev/resources/reporters/currents-playwright/pwc-p/pwc-p-discover.md) — Runs Playwright test discovery and writes the test list to a file for `pwc-p run`. Accepts Playwright filter flags (`--grep`, `--last-failed`, `--project`, spec paths, and similar).

Both commands accept Currents configuration via CLI flags or `currents.config.ts`. See [Configuration](https://docs.currents.dev/resources/reporters/currents-playwright/configuration.md#configuration-sources) for recommended setup.

## Basic Workflow

**Full suite (no filters):**

```bash
npx pwc-p run --key <record-key> --project-id <project-id> --ci-build-id <ci-build-id>
```

**Filtered tests (Playwright 1.62+ and `@currents/playwright` 2.9.0+):**

```bash
npx pwc-p run --key <record-key> --project-id <project-id> --ci-build-id <ci-build-id> --grep @smoke
```

**Failed tests only, or filtered tests on Playwright older than 1.62 (with discovery):**

```bash
# Step 1: Discover tests with optional filters
npx pwc-p discover --pwc-discovery-file tests.txt --grep @smoke

# Step 2: Run orchestrated execution using the discovery file
npx pwc-p run \
  --key <record-key> \
  --project-id <project-id> \
  --ci-build-id <ci-build-id> \
  --pwc-discovery-file tests.txt
```

Or use environment variables to avoid repeating the discovery file path:

```bash
export CURRENTS_DISCOVERY_FILE=tests.txt
npx pwc-p discover --grep @smoke
npx pwc-p run --key <record-key> --project-id <project-id> --ci-build-id <ci-build-id>
```

**Reference:**

* [pwc-p discover](https://docs.currents.dev/resources/reporters/currents-playwright/pwc-p/pwc-p-discover.md) — test discovery and filtering options
* [pwc-p run](https://docs.currents.dev/resources/reporters/currents-playwright/pwc-p/pwc-p-run.md) — orchestration execution and runtime options


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.currents.dev/resources/reporters/currents-playwright/pwc-p.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
