{"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":523,"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":505,"sourceCodeEnd":541,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/cli/generate/tool_stub.rs#L505-L541","documentation":"A --platform-url value that is not a URL must contain a colon separating the platform from the URL (`platform:url`). The parser splits on the first ':' via splitn(2); with no colon at all there is no platform part and the spec is rejected as malformed.","triggerScenarios":"Passing a bare word or path-like string such as `--platform-url linux` or `--platform-url ./tool.tar.gz`; a shell quoting mistake that drops the URL half; a variable expansion that evaluated empty after the colon was consumed elsewhere.","commonSituations":"Typos in scripted invocations; copy-pasting from docs and deleting the URL placeholder; forgetting that bare strings without http(s):// are treated as platform-prefixed specs, not auto-detected URLs.","solutions":["Use the full form: `--platform-url linux-x64:https://example.com/tool.tar.gz`","Or use the bare-URL form so the platform is auto-detected: `--platform-url https://.../tool-linux-x64.tar.gz`","Check shell quoting and that no variable in the spec expands to an empty string"],"exampleFix":"# before\nmise generate tool-stub ./ctl --platform-url linux-x64\n# after\nmise generate tool-stub ./ctl --platform-url linux-x64:https://github.com/o/r/releases/download/v1.0.0/ctl-linux-x64.tar.gz","handlingStrategy":"validation","validationCode":"#!/usr/bin/env bash\nfor spec in \"${platform_urls[@]}\"; do\n  [[ \"$spec\" == *:* ]] || { echo \"bad platform spec: $spec\" >&2; exit 2; }\ndone\nmise generate tool-stub ./out --platform-url \"${platform_urls[@]}\"","typeGuard":null,"tryCatchPattern":"mise generate tool-stub ./out --platform-url \"$spec\" 2>err.log || { grep -q \"format 'platform:url'\" err.log && echo \"fix spec: $spec\" >&2 && exit 2; }","preventionTips":["Validate each spec contains a colon before invoking mise","Remember bare strings are platform-prefixed specs; only http(s):// URLs trigger auto-detection"],"tags":["cli","tool-stub","argument-format","mise"],"backgroundTag":"invalid-argument-format","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}