Skip to main content

query tasks

Use the moon query tasks sub-command to query task information for all projects in the project graph. The tasks list can be filtered by passing a query statement as an argument, or by using options arguments.

# Find all tasks grouped by project
$ moon query tasks

# Find all tasks from projects with an id that matches "react"
$ moon query tasks --id react
$ moon query tasks "task~react"

By default, this will output a list of projects, and tasks within the project being indented (with a tab) on their own line.

web
:lint | eslint
:test | jest
app
:format | prettier

The tasks can also be output in JSON (which contains all data) by passing the --json flag. The output has the following structure:

{
tasks: Record<string, Record<string, Task>>,
options: QueryOptions,
}

Arguments

Options

  • --affected - Filter projects that have been affected by touched files. This will only filter based on files, and does not include upstream or downstream dependencies.
  • --json - Display the projects in JSON format.

Filters

All option values are case-insensitive regex patterns.

  • --alias <regex> - Filter projects that match this alias.
  • --id <regex> - Filter projects that match this ID/name.
  • --language <regex> - Filter projects of this programming language.
  • --source <regex> - Filter projects that match this source path.
  • --tasks <regex> - Filter projects that have the following tasks.
  • --type <regex> - Filter project of this type.