jdx/mise · error

no tasks defined. see

Error message

no tasks defined. see {url}

What it means

`prompt_for_task` loads all tasks to build an interactive selection list. When the loaded task set is empty there is nothing to select, so mise throws this error pointing to the tasks documentation instead of rendering an empty picker.

Solutions

  1. Define a task: add a `[tasks.<name>]` section to mise.toml or a script under `.mise/tasks/`.
  2. Run `mise run <name>` explicitly after defining the task instead of relying on interactive selection.
  3. Run the command from the project directory containing your mise.toml so tasks are discovered.

Example fix

// before: bare mise.toml with no tasks

// after (mise.toml)
[tasks.build]
run = "cargo build"
Defensive patterns

Strategy: validation

Validate before calling

if [ -z "$(mise tasks list)" ]; then echo "no tasks defined"; exit 1; fi
mise run

Prevention

When it happens

Trigger: Running `mise run` with no task name argument (interactive mode) when `config.tasks_with_context(ctx)` returns an empty map — no mise.toml `[tasks]`, no `.mise/tasks/` directory, or `load_all` context finds none.

Common situations: New project without task definitions; running `mise run` outside the project root so no config is discovered; tasks defined only in a non-loaded context.

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/426ce1ab376b6f79. Report an issue: GitHub.

Appendix: source

Thrown at src/task/task_list.rs:391

    }

    if !similar_cmds.is_empty() {
        err_msg.push_str("\n\nDid you mean the command:");
        for cmd_name in &similar_cmds {
            err_msg.push_str(&format!("\n  mise {cmd_name}"));
        }
    }

    append_available_tasks(&mut err_msg, &tasks_for_error, showing_all_tasks);

    bail!(err_msg);
}

/// Prompt the user to select a task interactively
async fn prompt_for_task(config: &Arc<Config>, load_all: bool) -> Result<Task> {
    let ctx = load_all.then(TaskLoadContext::all);
    let tasks = config.tasks_with_context(ctx.as_ref()).await?;
    ensure!(
        !tasks.is_empty(),
        "no tasks defined. see {url}",
        url = style::eunderline("https://mise.jdx.dev/tasks/")
    );
    let theme = crate::ui::theme::get_theme();
    let mut s = Select::new("Tasks")
        .description("Select a task to run")
        .filtering(true)
        .filterable(true)
        .theme(&theme);
    for t in tasks.values().filter(|t| !t.hide) {
        // Truncate description to first line only, like tasks ls does
        let desc = t.description.lines().next().unwrap_or_default();
        s = s.option(
            DemandOption::new(&t.name)
                .label(&t.display_name)
                .description(desc),
        );

View on GitHub (pinned to 533346cc37)