{"record":{"id":"d92fca6146ad1675","repo":"jdx/mise","slug":"no-tasks-defined-in-are-you-in-a-project-direc","errorCode":null,"errorMessage":"no tasks defined in {}. Are you in a project directory?","messagePattern":"no tasks defined in (.+?)\\. Are you in a project directory\\?","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/task/task_list.rs","lineNumber":337,"sourceCode":"                    .collect();\n                bail!(\n                    \"no tasks defined in {}, but found {} non-executable file(s) in {}.\\n\\\n                        Files must be executable to be detected as tasks.\\n\\\n                        Run `chmod +x` on the task files to fix this, e.g.:\\n  chmod +x {}\",\n                    display_path(dirs::CWD.clone().unwrap_or_default()),\n                    non_exec_files.len(),\n                    dirs_with_files.join(\", \"),\n                    non_exec_files\n                        .iter()\n                        .take(5)\n                        .map(display_path)\n                        .collect::<Vec<_>>()\n                        .join(\" \"),\n                );\n            }\n        }\n\n        bail!(\n            \"no tasks defined in {}. Are you in a project directory?\",\n            display_path(dirs::CWD.clone().unwrap_or_default())\n        );\n    }\n    if let Some(task) = make_task_executable(config, name, task_context).await? {\n        return Ok(Some(task));\n    }\n\n    // Suggest similar tasks using fuzzy matching for monorepo tasks\n    let mut err_msg = format!(\"no task {} found\", style::ered(name));\n\n    let similar = similar_tasks(name, &tasks_for_error);\n    if !similar.is_empty() {\n        err_msg.push_str(\"\\n\\nDid you mean one of these?\");\n        for task_name in similar {\n            err_msg.push_str(&format!(\"\\n  - {}\", task_name));\n        }\n    }","sourceCodeStart":319,"sourceCodeEnd":355,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/task/task_list.rs#L319-L355","documentation":"This is mise's final fallback when a task name cannot be resolved, no similar CLI subcommand matched, no untrusted configs were found, and no non-executable task files exist: there are simply no tasks defined anywhere in the current config scope, so mise asks whether you are actually inside a project directory. It displays the current working directory that was searched.","triggerScenarios":"Running `mise <task>` from a directory with no mise.toml, no .tool-versions, no global tasks, and no task include directories — e.g. $HOME or /tmp — or from a subdirectory outside any project root.","commonSituations":"Wrong terminal/tab cwd; running mise before cd-ing into the project; project relies on a config file mise does not auto-discover; global config defines no tasks.","solutions":["cd into the project directory that contains mise.toml/.mise.toml and retry.","If tasks should exist, create them: add a [tasks] section to mise.toml or files under .mise/tasks/.","Check `mise config` to see which config files are currently in scope.","Define reusable global tasks in ~/.config/mise/mise.toml if you want them available everywhere."],"exampleFix":"# before\n$ cd ~ && mise build\nerror: no tasks defined in ~. Are you in a project directory?\n\n# after\n$ cd ~/myrepo && mise build","handlingStrategy":"validation","validationCode":"# only run tasks from a project root\n[ -f mise.toml ] || [ -f .mise.toml ] || { echo 'not in a mise project' >&2; exit 1; }\nmise <task>","typeGuard":null,"tryCatchPattern":null,"preventionTips":["cd to the project root (or rely on your shell's dir hooks) before invoking mise.","Define frequently-used generic tasks in the global config if they must run anywhere.","Keep a mise.toml at repo root even if minimal."],"tags":["tasks","working-directory","config-discovery","mise"],"backgroundTag":"task-not-found","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}