jdx/mise · error

Could not determine which executable to use for

Error message

Could not determine which executable to use for '{}'. Available executables:
  {}

Use --bin to specify the correct binary path.

What it means

This error is thrown by `find_best_binary_match` when the archive contains executable files but none can be confidently matched to the tool name (no exact filename match, with or without common extensions). The error lists all candidate executables and instructs the user to disambiguate with --bin.

Solutions

  1. Pass --bin <path-inside-archive> to explicitly select the correct executable
  2. Compare the listed 'Available executables' in the error against the archive and pick the real binary
  3. If the tool was renamed upstream, set the stub's name/bin so they match

Example fix

// before
mise generate tool-stub mytool --url https://example.com/mytool.tar.gz
// after
mise generate tool-stub mytool --url https://example.com/mytool.tar.gz --bin mytoold
Defensive patterns

Strategy: fallback

Validate before calling

# Pre-check candidate binaries in the archive against the tool name
curl -fsSL "$URL" | tar -tz | grep -E "(^|/)${TOOL_NAME}(\.(exe))?$"

Try / catch

if ! mise generate tool-stub "$TOOL" --url "$URL" 2>/dev/null; then
  # Read the 'Available executables:' list from the error and retry with --bin
  mise generate tool-stub "$TOOL" --url "$URL" --bin "$BIN_PATH"
fi

Prevention

When it happens

Trigger: An archive contains multiple or ambiguously named executables (e.g. tool-server, tool-cli, example) and none exactly matches the stub's tool name, so automatic selection is refused.

Common situations: Multi-binary release archives where the tool name differs from the binary name (e.g. crate named 'thing' ships binary 'thingd'); archives containing demo/example binaries alongside the real one; renamed binaries upstream between versions.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/1505a26f66a66ed8. Report an issue: GitHub.

Appendix: source

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

                    .unwrap_or(false)
            })
            .collect();

        // If there's exactly one match containing the tool name, use it
        if name_matches.len() == 1 {
            return Ok(name_matches[0].clone());
        }

        // Strategy 3: If there's only one executable total, use it
        if executables.len() == 1 {
            return Ok(executables[0].clone());
        }

        // No good match found, provide helpful error message
        let mut exe_list = executables.to_vec();
        exe_list.sort();

        bail!(
            "Could not determine which executable to use for '{}'. Available executables:\n  {}\n\nUse --bin to specify the correct binary path.",
            tool_name,
            exe_list.join("\n  ")
        );
    }

    async fn lock_stub(&self) -> Result<String> {
        if !self.output.exists() {
            bail!(
                "Tool stub file does not exist: {}",
                display_path(&self.output)
            );
        }

        let mut stub = ToolStubFile::from_file(&self.output)?;
        let config = Config::get().await?;

        // Allow --version to override the version in the stub for bumping

View on GitHub (pinned to 533346cc37)