Skip to main content

run

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.

# 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 all projects with tag `frontend`
$ moon run '#frontend:test'

# Run `format` in closest project (`client`)
$ cd apps/client
$ moon run format

# Run `build` in projects matching the query
$ moon run :build --query "language=javascript && projectType=library"

View the official Run a task and Cheat sheet articles for more information!

Arguments

Options

  • -f, --force - Force run and ignore touched files and affected status. Will not query VCS.
  • --dependents - Run downstream dependent targets (of the same task name) as well.
  • -i, --interactive - Run the target in an interactive mode.
  • --profile <type> - Record and generate a profile for ran tasks.
    • Types: cpu, heap
  • --query - Filter projects to run targets against using a query statement. v1.3.0
  • -u, --updateCache - Bypass cache and force update any existing items.

Affected

  • --affected - Only run target if affected by changed files, otherwise will always run.
  • --remote - Determine affected against remote by comparing HEAD against a base revision (default branch), otherwise uses local changes.
  • --status <type> - Filter affected based on a change status. Can be passed multiple times.
    • Types: all (default), added, deleted, modified, staged, unstaged, untracked