jdx/mise · error · eyre::Report

task list options cannot be used with task info

Error message

task list options cannot be used with task info

What it means

`mise tasks <task-name>` is sugar for `mise tasks info <task-name>`. Only `--json` may ride along (it maps to tasks info --json); any other list option (--hidden, --extended, --sort, ...) combined with a positional task name trips the guard in src/cli/tasks/mod.rs:69.

Source

Thrown at src/cli/tasks/mod.rs:69

        }
    }
}

impl Tasks {
    pub async fn run(self) -> Result<()> {
        let Self { command, task, ls } = self;
        let cmd = match command {
            Some(Commands::Ls(cmd)) => Commands::Ls(ls.merge(cmd)?),
            Some(cmd) => {
                if ls.has_options() {
                    bail!("task list options cannot be used with subcommands");
                }
                cmd
            }
            None => match task {
                Some(task) => {
                    if ls.has_non_json_options() {
                        bail!("task list options cannot be used with task info");
                    }
                    Commands::Info(info::TasksInfo {
                        task,
                        json: ls.json,
                    })
                }
                None => Commands::Ls(ls),
            },
        };

        cmd.run().await
    }
}

View on GitHub (pinned to 9dcfcaa0dc)

Solutions

  1. Use the info form: `mise tasks info build` (hidden tasks included by name)
  2. Only add `--json` when machine-readable output is wanted: `mise tasks --json build`
  3. Remove listing-only options like --hidden/--extended/--sort from the invocation

Example fix

# before
$ mise tasks --hidden _private_task
# error: task list options cannot be used with task info

# after
$ mise tasks info _private_task
Defensive patterns

Strategy: validation

Validate before calling

# explicit form avoids the ambiguity entirely
mise tasks info build --json 2>/dev/null || mise tasks info build

Try / catch

mise tasks "$name" || { echo "use `mise tasks info $name`; only --json may accompany a task name" >&2; exit 1; }

Prevention

When it happens

Trigger: `mise tasks --hidden build`, `mise tasks --extended build`, etc. — a positional task name plus any non-json tasks-ls option.

Common situations: Assuming --hidden/--all are needed to see a hidden task's info (they are not for `tasks info`); flag left over from a `mise tasks ls --hidden` invocation edited into an info call.

Related errors


AI-assisted analysis of jdx/mise@9dcfcaa0dc (2026-08-17). Data as JSON: /api/errors/5256ea64df0526e1. Report an issue: GitHub.