jdx/mise · error

Either --url or --platform-url must be specified

Error message

Either --url or --platform-url must be specified

What it means

Thrown by `mise generate tool-stub` when neither --url nor any --platform-url is supplied. The generator builds a stub around at least one HTTP artifact URL; with no URL it has nothing to analyze (checksums, size, binary path) and refuses to run rather than emit an empty stub. Note --lock and --fetch are the only modes that legitimately skip URLs, and clap already conflicts them with url/platform_url.

Source

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

            ),
            Err(err) if matches!(err.kind(), ErrorKind::NotFound | ErrorKind::NotADirectory) => {}
            Err(err) => return Err(err.into()),
        }
        Ok(())
    }

    fn get_tool_name(&self) -> String {
        self.output
            .file_name()
            .and_then(|name| name.to_str())
            .unwrap_or("tool")
            .to_string()
    }

    async fn generate_stub(&self) -> Result<String> {
        // Validate that either URL or platform URLs are provided
        if self.url.is_none() && self.platform_url.is_empty() {
            bail!("Either --url or --platform-url must be specified");
        }

        // Read existing file if it exists
        let (existing_content, mut doc) = if self.output.exists() {
            let content = file::read_to_string(&self.output)?;
            let toml_content = extract_toml_from_stub(&content);

            let document = toml_content.parse::<DocumentMut>()?;
            (Some(content), document)
        } else {
            (None, DocumentMut::new())
        };

        // If file exists but we're trying to set a different version, bail
        if existing_content.is_some() && doc.get("version").is_some() {
            let existing_version = doc.get("version").and_then(|v| v.as_str()).unwrap_or("");
            if existing_version != self.version {
                bail!(

View on GitHub (pinned to 9dcfcaa0dc)

Solutions

  1. Pass the artifact URL: `mise generate tool-stub ./tool --url https://example.com/tool-1.0.0-linux-x64.tar.gz`
  2. Or pass platform-scoped URLs: `mise generate tool-stub ./tool --platform-url linux-x64:https://... --platform-url osx-arm64:https://...`
  3. If you meant to operate on an existing stub, use `--fetch` (fill in checksums) or `--lock` (embed resolved lockfile data) instead of a URL

Example fix

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

Strategy: validation

Validate before calling

#!/usr/bin/env bash
url="${TOOL_URL:-}"
if [[ -z "$url" ]]; then
  echo "TOOL_URL is empty; refusing to run mise generate tool-stub" >&2
  exit 2
fi
mise generate tool-stub "$1" --url "$url"

Try / catch

if ! mise generate tool-stub ./ctl --url "$url" 2>err.log; then grep -q -- '--url or --platform-url' err.log && echo "stub generation missing URL" >&2; exit 1; fi

Prevention

When it happens

Trigger: Running `mise generate tool-stub ./mystub` with only non-URL flags such as --bin, --version, or --bootstrap; passing --lock/--fetch together with a URL (clap conflict surfaces first); or a wrapper script that forgets to forward the URL argument.

Common situations: Automated stub-generation scripts where the URL variable is empty/unset; first-time use where the user assumes the command will prompt or default to something.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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