jdx/mise · error

unknown command: Did you mean: mise

Error message

unknown command: {}

Did you mean:
  mise {cmd_name}

What it means

err_no_task was asked for a task that does not exist, and suggest_similar_commands found a mise CLI subcommand that closely matches the name (e.g. typing `mise isntall`). The error reframes the failure as a mistyped subcommand and suggests the actual command.

Solutions

  1. Run the suggested `mise <cmd>` instead of treating it as a task
  2. Check spelling against `mise help` for subcommands
  3. Define a task with that name if you actually wanted one
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at src/task/task_list.rs:288 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at src/task/task_list.rs:288

async fn err_no_task(
    config: &Arc<Config>,
    name: &str,
    task_context: Option<&TaskLoadContext>,
) -> Result<Option<Task>> {
    // Check early if the name looks like a mistyped CLI subcommand
    let similar_cmds = suggest_similar_commands(name);
    let (tasks_for_error, showing_all_tasks) = tasks_for_missing_task_error(config, name).await?;

    if tasks_for_error.is_empty() {
        // If the name matches a CLI subcommand closely, suggest that instead of
        // the confusing "no tasks defined" message
        if !similar_cmds.is_empty() {
            let mut err_msg = format!("unknown command: {}", style::ered(name));
            err_msg.push_str("\n\nDid you mean:");
            for cmd_name in &similar_cmds {
                err_msg.push_str(&format!("\n  mise {cmd_name}"));
            }
            bail!(err_msg);
        }

        // Check if there are any untrusted config files in the current directory
        // that might contain tasks.
        if let Some(cwd) = &*dirs::CWD {
            use crate::config::config_file::{config_trust_root, is_trusted};
            use crate::config::{config_files_in_dir, is_tool_versions_file};

            // In safe mode, config is inert and trust is not required, so there
            // are no untrusted configs to warn about.
            let safe_mode = config::Settings::safe_mode();
            let config_files = config_files_in_dir(cwd);
            let untrusted_configs: Vec<_> = config_files
                .iter()
                .filter(|p| {
                    !safe_mode
                        && !is_tool_versions_file(p)
                        && !is_trusted(&config_trust_root(p))

View on GitHub (pinned to 533346cc37)