Skip to content

Running Commands ​

polyrepo exec — run an arbitrary command in each selected package.

bash
polyrepo exec [options] -- <cmd...>

Shows a checkbox of every discovered package (all checked by default — "run everywhere" is the common case), then runs the given command in each selected one, one at a time, with a real terminal (its output, colors, and any prompts show up normally). A repo that's itself a pnpm workspace contributes one checkbox entry per member, not one for the whole repo, so a command runs inside each package's own folder. A package that exits non-zero is reported and, by default, the run continues with the rest — --bail stops immediately instead. A summary of any failed packages is printed at the end, and the process exits non-zero if any package failed.

The command itself must come after a literal --, same as npm run <script> -- — anything before it is parsed as polyrepo's own options.

Options ​

--packages <a,b,c> ​

Package list instead of the interactive checkbox.

--yes ​

Skip the "proceed?" confirmation.

--bail ​

Stop at the first package that exits non-zero, instead of continuing through the rest.

Example:

bash
# run tests everywhere
polyrepo exec -- npm test

# specific packages, no prompts
polyrepo exec --packages vue-toast-kit,os-detect --yes -- npm outdated

# stop at the first failure
polyrepo exec --bail -- npm run lint