jdx/mise · error

has no value

Error message

{} has no value

What it means

When setting env vars in a file whose [env] section is age-encrypted (env_age directive), each variable must carry a plaintext value to encrypt; a KEY-only argument has nothing to write. mise bails naming the key that has no value.

Solutions

  1. Provide a value: `mise set KEY=value`
  2. Pipe it: `echo secret | mise set --stdin KEY`
  3. Remove the KEY-only argument if the entry was not intended

Example fix

// before
mise set API_KEY   # API_KEY has no value (encrypted env)
// after
mise set API_KEY=abc123
Defensive patterns

Strategy: validation

Validate before calling

[[ "$arg" == *=* ]] || { echo "mise set requires KEY=VALUE for encrypted env"; exit 1; }

Prevention

When it happens

Trigger: `mise set KEY` (no =value and no --stdin) targeting a config file using env_age encryption, where update_env_age requires a value argument.

Common situations: Trying to create a placeholder entry in an encrypted env section; forgetting the value in scripts that write encrypted variables.

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/a7654867bcc430b2. Report an issue: GitHub.

Appendix: source

Thrown at src/cli/set.rs:227

                Settings::get().ensure_experimental("age encryption")?;
                // Collect recipients once before the loop to avoid repeated I/O
                let recipients = self.collect_age_recipients().await?;
                for ev in env_vars {
                    match ev.value {
                        Some(value) => {
                            let age_directive =
                                agecrypt::create_age_directive(ev.key.clone(), &value, &recipients)
                                    .await?;
                            if let crate::config::env_directive::EnvDirective::Age {
                                value: encrypted_value,
                                format,
                                ..
                            } = age_directive
                            {
                                mise_toml.update_env_age(&ev.key, &encrypted_value, format)?;
                            }
                        }
                        None => bail!("{} has no value", ev.key),
                    }
                }
            } else {
                for ev in env_vars {
                    match ev.value {
                        Some(value) => mise_toml.update_env(&ev.key, value)?,
                        None => bail!("{} has no value", ev.key),
                    }
                }
            }
        }
        mise_toml.save()
    }

    async fn complete(&self) -> Result<()> {
        let config = Config::get().await?;
        for ev in self.cur_env(&config).await? {
            println!("{}", ev.key);

View on GitHub (pinned to 533346cc37)