{"record":{"id":"94373b66b46ed314","repo":"jdx/mise","slug":"monorepo-task-paths-like-path-task-or-task","errorCode":null,"errorMessage":"Monorepo task paths (like `//path:task` or `:task`) require a monorepo root configuration.\n\nTo set up monorepo support, add this to your root mise.toml:\n{}\n\nThen create task files in subdirectories that will be automatically discovered.\nSee {} for more information.","messagePattern":"Monorepo task paths \\(like `//path:task` or `:task`\\) require a monorepo root configuration\\.\n\nTo set up monorepo support, add this to your root mise\\.toml:\n(.+?)\n\nThen create task files in subdirectories that will be automatically discovered\\.\nSee (.+?) for more information\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/task/task_list.rs","lineNumber":58,"sourceCode":"                .map(|e| e.path().to_path_buf())\n        })\n        .collect()\n}\n\n/// Split a task spec into name and args\n/// e.g., \"task arg1 arg2\" -> (\"task\", vec![\"arg1\", \"arg2\"])\npub fn split_task_spec(spec: &str) -> (&str, Vec<String>) {\n    let mut parts = spec.split_whitespace();\n    let name = parts.next().unwrap_or(\"\");\n    let args = parts.map(|s| s.to_string()).collect_vec();\n    (name, args)\n}\n\n/// Validate that monorepo features are properly configured\nfn validate_monorepo_setup(config: &Arc<Config>) -> Result<()> {\n    // Check if a monorepo root is configured\n    if !config.is_monorepo() {\n        bail!(\n            \"Monorepo task paths (like `//path:task` or `:task`) require a monorepo root configuration.\\n\\\n            \\n\\\n            To set up monorepo support, add this to your root mise.toml:\\n\\\n            {}\\n\\\n            \\n\\\n            Then create task files in subdirectories that will be automatically discovered.\\n\\\n            See {} for more information.\",\n            style::eyellow(\"  monorepo_root = true\"),\n            style::eunderline(\n                \"https://mise.jdx.dev/tasks/task-configuration.html#monorepo-support\"\n            )\n        );\n    }\n\n    Ok(())\n}\n\n/// Check if a name is similar to any known CLI subcommands using fuzzy matching","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/task/task_list.rs#L40-L76","documentation":"Task specs like //path:task or :task address tasks relative to a monorepo root. validate_monorepo_setup bails when the root mise.toml does not set monorepo_root = true, because subdirectory task discovery is only enabled in monorepo mode.","triggerScenarios":"Running something like mise run //services/api:build or mise run :test in a repository whose root mise.toml lacks monorepo_root = true (config.is_monorepo() returns false).","commonSituations":"Adopting monorepo syntax before enabling the feature; running from a directory where the nearest mise.toml is not the intended monorepo root; config copied from another repo without the monorepo_root key.","solutions":["Add monorepo_root = true to the root mise.toml","Ensure the repo actually has task files in subdirectories for automatic discovery","If you did not mean monorepo syntax, drop the // or : prefix and use the plain task name"],"exampleFix":"# before: root mise.toml has no monorepo config\n# after\nmonorepo_root = true","handlingStrategy":"validation","validationCode":"// check before invoking monorepo task specs:\nif spec.starts_with(\"//\") || spec.starts_with(':') {\n    ensure_root_config_has(&repo_root_mise_toml, \"monorepo_root = true\")?;\n}\n\n// or programmatically, the same predicate mise uses:\nif !config.is_monorepo() {\n    return Err(eyre::bail!(\"monorepo task syntax requires monorepo_root = true\"));\n}","typeGuard":"fn monorepo_syntax_usable(config: &Config) -> bool {\n    config.is_monorepo()\n}","tryCatchPattern":"// config error, not transient: catch only to surface the fix,\nmatch run_tasks(&specs).await {\n    Err(err) if err.to_string().contains(\"monorepo root configuration\") => {\n        eprintln!(\"add `monorepo_root = true` to the root mise.toml or use plain task names\");\n        Err(err)\n    }\n    other => other,\n}","preventionTips":["Enable monorepo_root = true in the root mise.toml before adopting //path:task syntax","Keep monorepo config at the actual repository root, not a nested directory","Include the monorepo_root key when copying mise.toml between repos","If monorepo mode is unwanted, drop the // or : prefix and reference tasks by plain name"],"tags":["mise","config","monorepo","tasks"],"backgroundTag":"missing-configuration","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}