jdx/mise · error

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

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 of a dependency provider, which requires knowing which provider to explain. Passing `--explain` without a provider positional (and without `--provider`) is ambiguous, so `run` bails with a usage example.

Solutions

  1. Pass the provider as a positional: `mise deps install npm --explain`.
  2. Run `mise deps install --list` to see available provider ids first.
  3. Use `--provider <id>` explicitly if your argument layout puts it after other flags.

Example fix

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

Strategy: validation

Validate before calling

# shellcheck
[[ $# -ge 1 ]] || { echo "usage: mise deps install <provider> --explain"; exit 2; }

Prevention

When it happens

Trigger: Run `mise deps install --explain` (or `mise deps install --explain --only <x>` without provider) where `self.explain` is true and `self.provider.is_none()`.

Common situations: Users exploring `mise deps install --help` and combining `--explain` with only `--only` or `--list`-style flows; forgetting the provider positional `mise deps install npm --explain`.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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

Appendix: 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 533346cc37)