{"record":{"id":"f4fb0024055ac7f1","repo":"jdx/mise","slug":"task-not-found-task-spec-use-mise-tasks-ls","errorCode":null,"errorMessage":"Task not found: {task_spec}, use `mise tasks ls --all --hidden` to list all tasks","messagePattern":"Task not found: (.+?), use `mise tasks ls --all --hidden` to list all tasks","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/cache/task.rs","lineNumber":129,"sourceCode":"    let config = Config::get().await?;\n    let task_name = crate::task::expand_colon_task_syntax(task_spec, &config)?;\n    let tasks = if task_name.starts_with(\"//\") {\n        let ctx = crate::task::TaskLoadContext::from_pattern(&task_name);\n        config.tasks_with_context(Some(&ctx)).await?\n    } else if crate::task::is_workspace_project_task(&task_name) {\n        let ctx = crate::task::TaskLoadContext::all();\n        config.tasks_with_context(Some(&ctx)).await?\n    } else {\n        config.tasks().await?\n    };\n    let tasks_with_aliases = crate::task::build_task_ref_map(tasks.iter());\n    let mut tasks = tasks_with_aliases\n        .get_matching(&task_name)?\n        .into_iter()\n        .map(|task| (**task).clone())\n        .collect_vec();\n    if tasks.is_empty() {\n        bail!(\"Task not found: {task_spec}, use `mise tasks ls --all --hidden` to list all tasks\");\n    }\n    TaskFetcher::new(false)\n        .fetch_tasks(&config, &mut tasks)\n        .await?;\n    Ok((config, tasks))\n}\n\nfn format_timestamp(timestamp: u64) -> String {\n    i64::try_from(timestamp)\n        .ok()\n        .and_then(|timestamp| DateTime::<Utc>::from_timestamp(timestamp, 0))\n        .map(|timestamp| timestamp.to_rfc3339_opts(SecondsFormat::Secs, true))\n        .unwrap_or_else(|| \"unknown\".to_string())\n}\n","sourceCodeStart":111,"sourceCodeEnd":144,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/cache/task.rs#L111-L144","documentation":"When mise resolves a task specification (name, path, or alias) before running it, it looks up matching tasks in the tasks-with-aliases map. If no task matches the given spec — including hidden tasks and aliases — mise fails with this message and points to `mise tasks ls --all --hidden` so the user can discover what task names actually exist.","triggerScenarios":"`mise run <name>` or `mise tasks run <name>` where the name has no matching task: a typo, the task lives in a directory not scanned (missing from config includes), the task is defined only in a monorepo subdirectory whose config isn't loaded, or referencing a task by a removed/renamed alias.","commonSituations":"New contributors guessing task names from a README; tasks defined in a mise.toml in a subdirectory not included via `includes`; a task renamed upstream while scripts/CI still call the old name.","solutions":["Run `mise tasks ls --all --hidden` to list every task including hidden ones and confirm the exact name","Fix typos or use a task alias that exists","If the task is in a subdirectory config, add it via `[includes]` in the root mise.toml or run from the right directory","Check that the task file has an executable shebang or proper [tasks] table entry so it is discovered"],"exampleFix":"// before\n$ mise run buld  # Task not found\n// after\n$ mise tasks ls --all --hidden\n$ mise run build","handlingStrategy":"validation","validationCode":"mise tasks ls --all --hidden | grep -Fxq \"$task\" || { echo \"task not found: $task\"; exit 1; }","typeGuard":null,"tryCatchPattern":"out=$(mise run \"$task\" 2>&1) || { echo \"$out\"; mise tasks ls --all --hidden; exit 1; }","preventionTips":["Verify task names with `mise tasks ls --all --hidden` before scripting them","Define aliases for commonly used tasks","Include subdirectory configs via `[includes]` so their tasks resolve","Update docs/CI when renaming tasks"],"tags":["tasks","cli","task-not-found"],"backgroundTag":"entity-not-found","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}