moon task [target] (or moon t) command displays comprehensive information about a task that has been configured and exists within a project. If a task does not exist, the program will return with a 1 exit code.
Synopsis
Arguments
[target]- Fully qualified project + task target (e.g.,project:task). If not provided, you’ll be prompted to select from available tasks.
Options
| Option | Type | Description |
|---|---|---|
--json | boolean | Print the task and its configuration as JSON |
Example output
The following output is an example of what this command prints for a build task:Sections explained
About
Provides core task identification and metadata:- Target - Full target identifier
- Project - Project ID this task belongs to
- Task - Task ID within the project
- Toolchain - Toolchain(s) used to execute the task
- Type - Task type (build, test, run, etc.)
- Preset - Preset configuration if applicable
- Mode - Special modes (internal, interactive, persistent)
- Depends on - Other tasks that must run before this one
Process
Describes how the task executes:- Command - The command line that will be executed
- Script - If a script is used instead of direct command
- Shell - Shell used for execution (if applicable)
- Environment variables - Env vars set during execution
- Working directory - Directory where the command runs
- Lookup paths - Paths searched for executables
- Runs dependencies - How deps are executed (Parallel/Serial)
- Runs in CI - Whether task runs in CI environments
Configuration
Shows task configuration sources and behavior:- Inherits from - Configuration files that define this task
- Inputs - Files/globs that affect task caching
- Outputs - Files/dirs produced by the task
JSON output
Use the--json flag to output the full task configuration as JSON:
Usage examples
Inspect a task
View task configuration as JSON
Export task details for documentation
Check if task runs in CI
List task dependencies
Task modes
Tasks can have special execution modes:- internal - System task, not meant for direct execution
- interactive - Requires user input (not cacheable)
- persistent - Long-running process (like dev servers)
Understanding inputs and outputs
Inputs
Inputs determine when a task needs to re-run. They include:- File globs - Patterns matching source files
- Environment variables - Env vars prefixed with
$ - Configuration files - Files affecting task behavior
Outputs
Outputs are artifacts produced by the task:- Files - Specific output files
- Directories - Output directories
Related commands
moon tasks- List all tasks in the workspacemoon task-graph- Visualize task dependenciesmoon run- Execute a taskmoon project- View project details including tasks