jdx/mise · error

command wrapper for {name:?} must have a non-blank command

Error message

command wrapper for {name:?} must have a non-blank command

What it means

mise validates every `[command_wrappers]` entry and rejects wrappers whose `command` string is blank or whitespace-only. During wrapper collection over all config files, `wrapper.command().trim().is_empty()` triggers this bail, because a wrapper without an actual command to prepend cannot generate a working shim.

Source

Thrown at src/config/mod.rs:3216

    trace!("load_shell_aliases: {}", shell_aliases.len());

    Ok(shell_aliases)
}

/// Load command wrappers from global through project scope.
pub(crate) fn load_command_wrappers<'a>(
    config_files: &ConfigMap,
    tools: impl IntoIterator<Item = &'a crate::toolset::ToolRequest>,
) -> Result<IndexMap<String, CommandWrapper>> {
    let mut wrappers = IndexMap::new();
    let safe_mode = Settings::safe_mode();
    for config_file in config_files.values().rev() {
        if safe_mode && !is_global_config(config_file.get_path()) {
            continue;
        }
        for (name, wrapper) in config_file.command_wrappers()? {
            if wrapper.command().trim().is_empty() {
                bail!("command wrapper for {name:?} must have a non-blank command");
            }
            wrappers.insert(name, wrapper);
        }
    }
    command_wrapper::add_rust_wrapper(&mut wrappers, tools)?;
    Ok(wrappers)
}

fn load_plugins(config_files: &ConfigMap) -> Result<HashMap<String, String>> {
    let mut plugins = HashMap::new();
    for config_file in config_files.values() {
        for (plugin, url) in config_file.plugins()? {
            plugins.insert(plugin.clone(), url.clone());
        }
    }
    trace!("load_plugins: {}", plugins.len());
    Ok(plugins)
}

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Set a non-blank `command` value for the wrapper in the config file that defines it.
  2. If the command comes from a template/env var, ensure it resolves to a non-empty string at load time.
  3. Remove the empty `[command_wrappers.<name>]` section entirely if the wrapper is no longer wanted.

Example fix

# before (mise.toml)
[command_wrappers.git]
command = ""

# after
[command_wrappers.git]
command = "hub"
Defensive patterns

Strategy: validation

Validate before calling

# Fail fast on blank wrapper commands in committed configs:
if grep -rE '^command[[:space:]]*=[[:space:]]*["'"']\s*["'"']' --include='*.toml' .; then
  echo "blank command value found"; exit 1
fi

Prevention

When it happens

Trigger: Declaring a `[command_wrappers.<name>]` entry in any config file with `command = ""`, `command = " "`, or omitting/blanking the command value while the wrapper section exists (e.g. `command_wrapper(name)` present but its command field empty).

Common situations: Copy-pasting a wrapper TOML block and forgetting to fill in the command; a template or environment-variable-substituted command (e.g. `command = "${WRAPPER}"`) that resolves to an empty string; commenting out a command body but leaving the wrapper key in place.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/3011e9554e4c5f36. Report an issue: GitHub.