jdx/mise · error
Platform bin spec must be in format 'platform:path', got
Error message
Platform bin spec must be in format 'platform:path', got: {} What it means
This error is thrown by `parse_platform_bin_spec` when a `--platform-bin` argument does not contain a ':'-separated 'platform:path' pair. The spec is split once on ':' and must yield exactly two parts: the platform name and the path to the binary inside the archive. It validates user-provided binary location overrides before archive analysis.
Solutions
- Change the value to include the platform prefix: --platform-bin linux:bin/tool
- Check that you are using --platform-bin (requires platform:path) and not --bin (path only)
- Quote the argument so platform and path remain one shell word: --platform-bin "macos-x64:bin/tool"
Example fix
// before --platform-bin bin/tool // after --platform-bin linux:bin/tool
Defensive patterns
Strategy: validation
Validate before calling
validate_platform_bin() {
local spec="$1"
case "$spec" in
*:*) return 0 ;;
*) echo "--platform-bin must be 'platform:path'" >&2; return 1 ;;
esac
}
validate_platform_bin "$SPEC" || exit 1 Prevention
- Remember --platform-bin needs the platform prefix; use --bin for a path-only override
- Quote arguments containing colons
- Verify archive-relative binary paths with tar -tf before generating the stub
When it happens
Trigger: Running `mise generate tool-stub` with `--platform-bin` set to a value without a colon, e.g. --platform-bin bin/tool (missing the platform prefix) or --platform-bin linux (path omitted).
Common situations: Users copying the --bin flag syntax (which takes only a path) instead of --platform-bin; Windows-style absolute paths like C:\bin\tool confusing the author about separator placement; forgetting the platform prefix when specifying per-platform binaries.
Understand the failure class
Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.
Related errors
- Platform spec must be in format 'platform:url' or just…
- task list options cannot be used with subcommands
- a branch name is required
- a glob is required
- a repository preview directory requires a dry run
AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17).
Data as JSON: /api/errors/0e597a0394563024.
Report an issue: GitHub.
Appendix: source
Thrown at src/cli/generate/tool_stub.rs:553
// 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
);
}
let platform = parts[0].to_string();
let bin_path = parts[1].to_string();
Ok((platform, bin_path))
}
async fn analyze_url(
&self,
url: &str,
mpr: &std::sync::Arc<crate::ui::multi_progress_report::MultiProgressReport>,
) -> Result<(String, u64, Option<String>)> {
// Create a temporary directory for download and extraction
let temp_dir = tempfile::tempdir()?;View on GitHub (pinned to 533346cc37)