tl;dr

Command Meaning
pnpm install -r runs installation for every package in every subfolder
pnpm run build --filter foo-* builds all packages with names that start with foo-
pnpm update -- login-page... updates dependencies in login-page and any dependencies of login-page that are also in the repository

Options

--filter <package_selector>

Read more about filtering.

workspace-concurrency

Added in: v2.13.0

Set the maximum number of concurrency. For unlimited concurrency use Infinity.

bail

Added in: v2.13.0

If true, stops when a task throws an error.

This config does not affect the exit code. Even if --no-bail is used, all tasks will finish but if any of the tasks fail, the command will exit with a non-zero code.

Usage example. Run tests in every package. Continue if tests fail in one of the packages:

pnpm -r --no-bail test

sort

Added in: v2.14.0

When true, packages are sorted topologically (dependencies before dependents). Pass --no-sort to disable.

Usage examples:

pnpm -r --no-sort test

reverse

Added in: v5.17.1

When true, the order of packages is reversed.

pnpm -r --reverse run clean

pnpm -r exec

Added in: v2.9.0

pnpm -r exec -- <command> [args...]

This command runs a command in each package of the monorepo.

The name of the current package is available through the environment variable PNPM_PACKAGE_NAME (supported from pnpm v2.22.0).

Usage examples:

pnpm -r exec -- rm -rf node_modules
pnpm -r exec -- pnpm view $PNPM_PACKAGE_NAME