jdx/mise · error · eyre::Report

title requires exactly 1 argument

Error message

title requires exactly 1 argument

What it means

A command_wrapper must be defined by inline script 'content' or by wrapping an 'executable'; leaving both out gives mise nothing to install as the command. This parse-time bail fires when the options object contains neither key.

Source

Thrown at crates/aqua-registry/src/template.rs:351

        if args.len() != 1 {
            bail!("semver requires exactly 1 argument");
        }
        let input = args[0].as_string();
        let clean_version = input.strip_prefix('v').unwrap_or(&input);
        let version = Versioning::new(clean_version)
            .wrap_err_with(|| format!("invalid semver version: {input}"))?;

        Ok(Box::new(SemVerValue {
            major: version.nth(0).unwrap_or(0),
            minor: version.nth(1).unwrap_or(0),
            patch: version.nth(2).unwrap_or(0),
            original: clean_version.to_string(),
        }) as Box<dyn Value>)
    });

    registry.insert("title", |args| {
        if args.len() != 1 {
            bail!("title requires exactly 1 argument");
        }
        Ok(Box::new(StringValue(args[0].as_string().to_title_case())) as Box<dyn Value>)
    });

    registry.insert("trimV", |args| {
        if args.len() != 1 {
            bail!("trimV requires exactly 1 argument");
        }
        Ok(Box::new(StringValue(
            args[0].as_string().trim_start_matches('v').to_string(),
        )) as Box<dyn Value>)
    });

    registry.insert("trimPrefix", |args| {
        if args.len() != 2 {
            bail!("trimPrefix requires exactly 2 arguments");
        }
        let prefix = args[0].as_string();

View on GitHub (pinned to 9dcfcaa0dc)

Solutions

  1. Add 'executable' pointing at the staged binary to wrap (most common), or add inline 'content'
  2. Delete the command_wrapper artifact entirely if no wrapper is needed

Example fix

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

Strategy: validation

Validate before calling

match (opts.get("content"), opts.get("executable")) {
    (None, None) => /* reject: nothing defines the wrapper */,
    _ => {},
}

Prevention

When it happens

Trigger: command_wrapper options like {} or {"args": [...]}/ {"env": {...}} only — args/env alone do not define a wrapper.

Common situations: Metadata where the author assumed args imply an executable; partially deleted entries; templating that renders empty option objects.

Understand the failure class

Background: "Missing required field" and "field is required" errors: why libraries reject payloads that omit mandatory fields — this error's family across 20 libraries.

Related errors


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