Skip to content

Support --dry --json to output structured task execution preview #2822

@wucm667

Description

@wucm667

Description

Task supports --dry to preview the order of task execution without actually running them, and --list --json to output task metadata as JSON. However, combining --dry with --json is not supported.

Problem: When integrating Task into CI/CD pipelines or external tooling, it is sometimes useful to programmatically preview which tasks would run and in what order before actually executing them. The current --dry output is human-readable text, which requires parsing and is fragile to format changes.

Example use cases:

  • A CI system that wants to validate the task execution plan before triggering actual builds
  • An IDE plugin that shows a preview of what task deploy would do
  • Dry-run validation in automated deployment scripts

Proposed behavior:

$ task --dry --json
{
  "tasks": [
    {"task": "build", "dir": "/project"},
    {"task": "test", "dir": "/project"},
    {"task": "deploy", "dir": "/project"}
  ]
}

The output should include at minimum: task name, working directory, and the resolved command/dependencies for each task that would execute.

Alternative considered: Using --list --json gives task metadata but not the execution order or which tasks would actually run for a given command invocation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions