{"record":{"id":"426ce1ab376b6f79","repo":"jdx/mise","slug":"no-tasks-defined-see-url","errorCode":null,"errorMessage":"no tasks defined. see {url}","messagePattern":"no tasks defined\\. see (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/task/task_list.rs","lineNumber":391,"sourceCode":"    }\n\n    if !similar_cmds.is_empty() {\n        err_msg.push_str(\"\\n\\nDid you mean the command:\");\n        for cmd_name in &similar_cmds {\n            err_msg.push_str(&format!(\"\\n  mise {cmd_name}\"));\n        }\n    }\n\n    append_available_tasks(&mut err_msg, &tasks_for_error, showing_all_tasks);\n\n    bail!(err_msg);\n}\n\n/// Prompt the user to select a task interactively\nasync fn prompt_for_task(config: &Arc<Config>, load_all: bool) -> Result<Task> {\n    let ctx = load_all.then(TaskLoadContext::all);\n    let tasks = config.tasks_with_context(ctx.as_ref()).await?;\n    ensure!(\n        !tasks.is_empty(),\n        \"no tasks defined. see {url}\",\n        url = style::eunderline(\"https://mise.jdx.dev/tasks/\")\n    );\n    let theme = crate::ui::theme::get_theme();\n    let mut s = Select::new(\"Tasks\")\n        .description(\"Select a task to run\")\n        .filtering(true)\n        .filterable(true)\n        .theme(&theme);\n    for t in tasks.values().filter(|t| !t.hide) {\n        // Truncate description to first line only, like tasks ls does\n        let desc = t.description.lines().next().unwrap_or_default();\n        s = s.option(\n            DemandOption::new(&t.name)\n                .label(&t.display_name)\n                .description(desc),\n        );","sourceCodeStart":373,"sourceCodeEnd":409,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/task/task_list.rs#L373-L409","documentation":"Raised when mise needs to prompt the user to interactively select a task (no task specified on the command line) but the loaded configuration defines zero tasks. The error points to the tasks documentation.","triggerScenarios":"Running `mise run` with no arguments in a project that has no tasks defined, triggering prompt_for_task, which ensures the task list is non-empty before showing a Select prompt.","commonSituations":"Running `mise run` bare in a fresh repo without mise.toml tasks or .mise/tasks directory; wrong working directory (project tasks not loaded); task files ignored/untrusted.","solutions":["Define a task: add [tasks.<name>] to mise.toml or create a script in .mise/tasks/","Run `mise tasks ls` from the correct project directory","cd to the project root so its config/tasks are loaded","Trust the config if it was ignored (`mise trust`)"],"exampleFix":"// mise.toml (before: no tasks)\n[tasks.build]\nrun = \"cargo build\"\n// after\nmise run build","handlingStrategy":"validation","validationCode":"[ -n \"$(mise tasks ls 2>/dev/null)\" ] && mise run || echo \"no tasks defined\"","typeGuard":null,"tryCatchPattern":"out=$(mise run 2>&1) || { echo \"$out\" | grep -q 'no tasks defined' && echo 'Define tasks in mise.toml'; }","preventionTips":["Always pass an explicit task name in scripts instead of relying on the interactive prompt","Define at least one task in mise.toml or .mise/tasks/","Check your cwd is inside the project before running mise run"],"tags":["tasks","cli","interactive","empty"],"backgroundTag":"empty-result-set","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}