yarn tasks run — Yarn CLI reference
Run a task
yarn tasks run
Run a task
This command runs a task (and its dependencies, in the right order) from the taskfile of the current workspace, or across many workspaces at once when a workspace selection option is set.
Workspace selection uses the same options as yarn workspaces foreach:
-
-A,--allruns the task in every workspace declaring it. -
--from <glob>runs it in the workspaces matching the glob (ident glob like@scope/*or path glob like./packages/*); can be repeated. -
--since [ref]runs it in the workspaces changed since the ref, or since the configured base refs (changesetBaseRefs) when no ref is provided. The working tree is compared to the base unless--head <ref>is set. Unset bounds are read fromYARN_CHANGESET_BASE/YARN_CHANGESET_HEAD(orTURBO_SCM_BASE/TURBO_SCM_HEAD). -
--follow-dependenciesadds the transitive workspace dependencies of the selection, and--follow-dependentsadds its dependents. When both are set, dependencies are followed from the dependents too (pnpm’s--filter '...{pkg}...').--recursivefollows dependents when combined with--since(so--since --recursiveselects all the affected workspaces), and dependencies otherwise.--followed-dependenciesrestricts the traversal toprodordevdependencies. Without-A/--from/--since, they apply to the current workspace. -
--include/--exclude <glob>and--no-privatefilter the final selection.
All selected tasks are resolved into a single deduplicated graph. Use --only to skip cross-workspace dependencies (e.g. *:build) pointing outside of the selection. When running across workspaces the first failure cancels the run unless --continue is set.
The daemon limits the number of processes running at once across all runs, according to the taskConcurrency setting (CPU count by default).
Several tasks can be run at once by separating them with commas (yarn tasks run build,typecheck -A).
Output modes: interlaced (default), --buffered, --silent-dependencies, --errors-only (only print the logs of failed tasks), and --json.
By default the tasks run through the background daemon; on CI (when the CI environment variable is set) they run in an in-process daemon instead (--standalone), which can be toggled with --standalone/--no-standalone. Runs started from within a task always reuse the daemon running it.
Run the task in every workspace declaring it
Run the task in the workspaces matching these patterns
Run the task in the workspaces changed since a ref, or since the configured base refs when no ref is provided
Compare against this ref rather than the working tree when used with --since
Follow dependencies, or dependents when combined with --since
Also run the task in the dependencies of the selected workspaces
Also run the task in the dependents of the selected workspaces
Dependency kinds followed by --follow-dependencies and --follow-dependents
Only keep workspaces matching these patterns
Skip workspaces matching these patterns
Include private workspaces
Skip cross-workspace task dependencies outside of the selection
Keep running independent tasks after a failure
Print the output of each task once it completes
Only print the output of the target tasks
Only print the output of the tasks that failed
Prefix each output line with a timestamp
Output JSON objects (one per line) for each task event
Increase the verbosity level (can be repeated)
Run the tasks in an in-process daemon rather than the background one