jdx/mise · error

Platform spec must be in format 'platform:url' or just 'url'

Error message

Platform spec must be in format 'platform:url' or just 'url' (for auto-detection). Got: {}

What it means

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.

Source

Thrown at src/cli/generate/tool_stub.rs:523

        if spec.starts_with("http://") || spec.starts_with("https://") {
            // Format: url (auto-detect platform)
            let url = spec.to_string();

            if let Some(detected_platform) = detect_platform_from_url(&url) {
                let platform = detected_platform.to_platform_string();
                debug!("Auto-detected platform '{}' from URL: {}", platform, url);
                Ok((platform, url))
            } else {
                bail!(
                    "Could not auto-detect platform from URL: {}. Please specify explicitly using 'platform:url' format.",
                    url
                );
            }
        } else {
            // Format: platform:url
            let parts: Vec<&str> = spec.splitn(2, ':').collect();
            if parts.len() != 2 {
                bail!(
                    "Platform spec must be in format 'platform:url' or just 'url' (for auto-detection). Got: {}",
                    spec
                );
            }

            let platform = parts[0].to_string();
            let url = parts[1].to_string();
            Ok((platform, url))
        }
    }

    fn parse_platform_bin_spec(&self, spec: &str) -> Result<(String, String)> {
        let parts: Vec<&str> = spec.splitn(2, ':').collect();
        if parts.len() != 2 {
            bail!(
                "Platform bin spec must be in format 'platform:path', got: {}",
                spec
            );

View on GitHub (pinned to 9dcfcaa0dc)

Solutions

  1. Use the full form: `--platform-url linux-x64:https://example.com/tool.tar.gz`
  2. Or use the bare-URL form so the platform is auto-detected: `--platform-url https://.../tool-linux-x64.tar.gz`
  3. Check shell quoting and that no variable in the spec expands to an empty string

Example fix

# before
mise generate tool-stub ./ctl --platform-url linux-x64
# after
mise generate tool-stub ./ctl --platform-url linux-x64:https://github.com/o/r/releases/download/v1.0.0/ctl-linux-x64.tar.gz
Defensive patterns

Strategy: validation

Validate before calling

#!/usr/bin/env bash
for spec in "${platform_urls[@]}"; do
  [[ "$spec" == *:* ]] || { echo "bad platform spec: $spec" >&2; exit 2; }
done
mise generate tool-stub ./out --platform-url "${platform_urls[@]}"

Try / catch

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; }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of jdx/mise@9dcfcaa0dc (2026-08-17). Data as JSON: /api/errors/b3aec9c5309d6cd5. Report an issue: GitHub.