jdx/mise · error

brew-cask: command_wrapper has unsupported option {}

Error message

brew-cask: command_wrapper has unsupported option {}

What it means

The options object of a command_wrapper artifact accepts exactly four keys: content, executable, args, env. mise collects any other keys, sorts them, and bails listing them, so schema drift or typos fail loudly instead of being silently ignored. The whitelist check runs before any option is read.

Source

Thrown at src/system/packages/brew/cask.rs:5138

        .ok_or_else(|| eyre!("brew-cask: command_wrapper requires a command name"))?;
    let name_path = Path::new(name);
    if name_path.file_name().and_then(|name| name.to_str()) != Some(name)
        || matches!(name, "." | "..")
    {
        bail!("brew-cask: command_wrapper requires a command name without path components");
    }
    let options = values
        .get(1)
        .and_then(Value::as_object)
        .ok_or_else(|| eyre!("brew-cask: command_wrapper requires options"))?;
    let mut unsupported = options
        .keys()
        .filter(|key| !matches!(key.as_str(), "content" | "executable" | "args" | "env"))
        .cloned()
        .collect::<Vec<_>>();
    unsupported.sort();
    if !unsupported.is_empty() {
        bail!(
            "brew-cask: command_wrapper has unsupported option {}",
            unsupported.join(", ")
        );
    }
    let content = options
        .get("content")
        .and_then(Value::as_str)
        .map(str::to_string);
    let executable = options
        .get("executable")
        .and_then(Value::as_str)
        .map(str::to_string);
    match (content.is_some(), executable.is_some()) {
        (false, false) => {
            bail!("brew-cask: command_wrapper requires content or executable")
        }
        (true, true) => {
            bail!("brew-cask: command_wrapper requires content or executable, not both")

View on GitHub (pinned to 6f52dcdf99)

Solutions

  1. Remove or rename the listed unsupported keys to the four accepted ones (content, executable, args, env).
  2. Update mise in case a newer release understands the option.
  3. If generating metadata programmatically, validate keys against the whitelist before emitting.

Example fix

# before
command_wrapper: [["tool", {"executable": "bin/tool", "arguments": ["--fast"]}]]

# after
command_wrapper: [["tool", {"executable": "bin/tool", "args": ["--fast"]}]]
Defensive patterns

Strategy: type-guard

Validate before calling

const KNOWN = new Set(["content","executable","args","env"]);
function validWrapperOptions(o) { return Object.keys(o).every(k => KNOWN.has(k)); }

Type guard

const KNOWN_KEYS = new Set(["content", "executable", "args", "env"]);
function hasOnlyKnownWrapperKeys(options) {
  return Object.keys(options ?? {}).every(k => KNOWN_KEYS.has(k));
}

Prevention

When it happens

Trigger: A wrapper options object containing keys like 'dir', 'link', 'description', 'working_dir', or a key from a newer metadata schema — anything outside {content, executable, args, env} at src/system/packages/brew/cask.rs:5138.

Common situations: Typos ('envs' for 'env', 'arguments' for 'args'); metadata written for a different tool's wrapper schema; newer metadata revisions adding options this mise version does not know.

Related errors


AI-assisted analysis of jdx/mise@6f52dcdf99 (2026-08-22). Data as JSON: /api/errors/402fdfa93990ac33. Report an issue: GitHub.