yarn exec — Yarn CLI reference

Run a shell command in the package environment

Docs/Reference/CLI/exec

yarn exec

Run a shell command in the package environment

yarn exec <SCRIPT> <ARGS…>

This command executes a shell command from the current directory, with the environment prepared for the active workspace.

The spawned process receives the same project environment as scripts and binaries, including Plug’n’Play injection when the project uses PnP.