moon tasks command lists all tasks available in the workspace as a table of information, including task target, command, type, preset, toolchains, and description.
Synopsis
Arguments
[project]- Optional project ID to filter tasks. When specified, only tasks from that project are listed.
Options
| Option | Type | Description |
|---|---|---|
--json | boolean | Print the tasks as JSON |
Example output
The following output shows an example table of tasks:- Task - The fully qualified task target (project:task)
- Command - The primary command being executed (or
(script)for script tasks) - Type - Task type (build, test, run, etc.)
- Preset - Preset identifier if the task uses a preset configuration
- Toolchains - Comma-separated list of toolchains used
- Description - Task description from configuration
moon query tasks for advanced querying and filtering of tasks.
:::
JSON output
Use the--json flag to output the complete task list as JSON:
Usage examples
List all tasks
Filter tasks by project
Export tasks as JSON
Count tasks by type
List all test tasks
Find tasks using a specific toolchain
Get all tasks for a project
Filtering by project
When you provide a project ID, only tasks from that project are shown:Empty workspace
If no tasks are configured in any project, you’ll see:- Global task files in
.moon/tasks/ - Project-specific task configuration
Task types
Tasks are categorized by type, which affects how they’re treated by commands likemoon check:
- build - Compilation and build tasks
- test - Testing and verification tasks
- run - General execution tasks
- setup - Setup and initialization tasks
- dev - Development server tasks
Understanding presets
Presets are predefined task configurations that provide common defaults. Examples:- server - Long-running development servers
- watch - File watching tasks
- script - Simple script execution
Related commands
moon task- Display detailed information about a specific taskmoon task-graph- Visualize task dependenciesmoon query tasks- Advanced task querying and filteringmoon run- Execute tasksmoon project- View project details including tasks