website/docs/commands/run.mdx
import VersionLabel from '@site/src/components/Docs/VersionLabel';
The moon run (or moon r) command will run one or many targets and all of
its dependencies in topological order. Each run will incrementally cache each task, improving speed
and development times... over time. View the official Run a task and
Cheat sheet articles for more information!
# Run `lint` in project `app`
$ moon run app:lint
# Run `dev` in project `client` and `server`
$ moon run client:dev server:dev
# Run `test` in all projects
$ moon run :test
# Run `test` in the closest project, relative to the current working directory
$ moon run '~:test'
# Run `test` in all projects with tag `frontend`
$ moon run '#frontend:test'
# Run `format` in default project
$ moon run format
# Run `build` in projects matching the query
$ moon run :build --query "language=javascript && projectLayer=library"
:::info
The default behavior for moon run is to "fail fast", meaning that any failed task will immediately
abort execution of the entire action graph. Use moon exec --on-failure continue for alternative
behavior.
:::
...<target> - Targets or project relative tasks to run.[-- <args>] - Additional arguments to
pass to the underlying command.Inherits all options from moon exec and pre-fills with: --on-failure=bail,
--upstream=deep.
query - Filter tasks based on the result of a query.