> 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](/guides/ci-optimization/playwright-orchestration.md) and [Playwright Parallelization](/guides/ci-optimization/playwright-parallelization.md) for detailed guides.

{% hint style="info" %}
**Orchestration** is a two-step process: first run `pwc-p discover` to build a test list, then run `pwc-p run` to execute tests in parallel with load balancing.
{% endhint %}

## Subcommands

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

Both commands accept Currents configuration via CLI flags or `currents.config.ts`. See [Configuration](/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 (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](/resources/reporters/currents-playwright/pwc-p/pwc-p-discover.md) — test discovery and filtering options
* [pwc-p run](/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.
