{"record":{"id":"b3aec9c5309d6cd5","repo":"jdx/mise","slug":"platform-spec-must-be-in-format-platform-url-or","errorCode":null,"errorMessage":"Platform spec must be in format 'platform:url' or just 'url' (for auto-detection). Got: {}","messagePattern":"Platform spec must be in format 'platform:url' or just 'url' \\(for auto-detection\\)\\. Got: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/generate/tool_stub.rs","lineNumber":538,"sourceCode":"        if spec.starts_with(\"http://\") || spec.starts_with(\"https://\") {\n            // Format: url (auto-detect platform)\n            let url = spec.to_string();\n\n            if let Some(detected_platform) = detect_platform_from_url(&url) {\n                let platform = detected_platform.to_platform_string();\n                debug!(\"Auto-detected platform '{}' from URL: {}\", platform, url);\n                Ok((platform, url))\n            } else {\n                bail!(\n                    \"Could not auto-detect platform from URL: {}. Please specify explicitly using 'platform:url' format.\",\n                    url\n                );\n            }\n        } else {\n            // Format: platform:url\n            let parts: Vec<&str> = spec.splitn(2, ':').collect();\n            if parts.len() != 2 {\n                bail!(\n                    \"Platform spec must be in format 'platform:url' or just 'url' (for auto-detection). Got: {}\",\n                    spec\n                );\n            }\n\n            let platform = parts[0].to_string();\n            let url = parts[1].to_string();\n            Ok((platform, url))\n        }\n    }\n\n    fn parse_platform_bin_spec(&self, spec: &str) -> Result<(String, String)> {\n        let parts: Vec<&str> = spec.splitn(2, ':').collect();\n        if parts.len() != 2 {\n            bail!(\n                \"Platform bin spec must be in format 'platform:path', got: {}\",\n                spec\n            );","sourceCodeStart":520,"sourceCodeEnd":556,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/generate/tool_stub.rs#L520-L556","documentation":"This error is thrown by `parse_platform_spec` in the mise tool stub generator when a `--platform` argument is neither a bare URL (for auto-detection) nor a `platform:url` pair. The spec string is split once on ':' and if no colon-separated pair exists, parsing fails with this message including the offending spec. It exists to catch malformed platform overrides early before any download is attempted.","triggerScenarios":"Running `mise generate tool-stub` with a `--platform` value that contains no ':' separator and is not a recognizable URL, e.g. `--platform macos` or `--platform linux-x64` (missing the download URL after the platform name).","commonSituations":"Hand-written platform mappings in shell scripts where the URL was accidentally dropped; copying an entry from another tool's config that used a different separator (space or '='); quoting mistakes that split the platform and URL into separate arguments.","solutions":["Change the --platform value to 'platform:url' form, e.g. --platform macos-x64:https://example.com/tool.tar.gz","If you want platform auto-detection, pass only the URL with no platform prefix: --platform https://example.com/tool.tar.gz","Quote the argument so the platform and URL stay in one shell word: --platform \"linux:https://...\""],"exampleFix":"// before\n--platform linux\n// after\n--platform linux:https://github.com/org/tool/releases/download/v1.0/tool-linux-amd64.tar.gz","handlingStrategy":"validation","validationCode":"validate_platform_spec() {\n  local spec=\"$1\"\n  if [[ \"$spec\" != *:* ]]; then\n    echo \"--platform must be 'platform:url' or a bare url\" >&2\n    return 1\n  fi\n}\nvalidate_platform_spec \"$PLATFORM_SPEC\" || exit 1","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include the platform prefix and a colon when overriding per-platform URLs","Quote --platform arguments so shells don't split on the colon","Test the generated stub with a dry run before scripting it into CI"],"tags":["cli","argument-parsing","platform-spec"],"backgroundTag":"invalid-argument-format","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"}