jdx/mise · error

--explain requires a provider argument, e.g.: mise deps inst

Error message

--explain requires a provider argument, e.g.: mise deps install npm --explain

What it means

`mise deps install --explain` prints a detailed explanation for one specific provider. Because the explanation is provider-specific, the flag requires a provider positional argument; when `--explain` is passed with no provider, run() bails with this usage error before doing any work.

Source

Thrown at src/cli/deps/install.rs:69

    pub(super) async fn run(self) -> Result<()> {
        let config = Config::get().await?;
        let monorepo_union = if self.monorepo {
            Some(config.monorepo_union().await?)
        } else {
            None
        };
        let engine = match &monorepo_union {
            Some(union) => DepsEngine::new_monorepo(&config, union.config_files.values().cloned())?,
            None => DepsEngine::new(&config)?,
        };

        if self.list {
            self.list_providers(&engine)?;
            return Ok(());
        }

        if self.explain && self.provider.is_none() {
            bail!("--explain requires a provider argument, e.g.: mise deps install npm --explain");
        }

        // If a provider is specified as a positional arg, treat it like --only.
        let only = match (&self.provider, &self.only) {
            (Some(p), None) => Some(vec![p.clone()]),
            (Some(p), Some(list)) => {
                let mut combined = list.clone();
                if !combined.contains(p) {
                    combined.push(p.clone());
                }
                Some(combined)
            }
            (None, only) => only.clone(),
        };
        let skip = self.skip.unwrap_or_default();

        // Report an explicitly selected inactive provider before resolving or
        // installing unrelated tools from the project toolset.

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Provide the provider name: `mise deps install <provider> --explain`
  2. Run `mise deps install --list` first to see available provider ids, then pass one to --explain
  3. Use --only with a provider list if you want to restrict installation instead of explaining

Example fix

// before
mise deps install --explain
// after
mise deps install npm --explain
Defensive patterns

Strategy: validation

Validate before calling

if [[ " $* " == *' --explain '* ]] && [[ $# -eq 1 ]]; then echo '--explain needs a provider arg'; fi

Prevention

When it happens

Trigger: Running `mise deps install --explain` (or `mise deps install --list --explain`-style invocations) without naming a provider, e.g. omitting `npm` from `mise deps install npm --explain`.

Common situations: Users who saw `--list` works standalone and assume `--explain` also lists/explains all providers, or shell aliases that drop the positional argument.

Understand the failure class

Background: "--flag is required" and "must specify" CLI errors: how missing-required-flag validation works and how to fix it — this error's family across 20 libraries.

Related errors


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