jdx/mise · error

config file not found

Error message

config file not found: {}

What it means

`mise config get` resolves which config file to read: an explicitly selected file, the system config, or the top-level TOML config. When the resolved file path does not exist on disk, mise bails with this error instead of reading it. This guards against reporting settings from a stale or missing path.

Solutions

  1. Check the reported path and create the file if you intend it to exist (`mise config set -g key val` creates the global one)
  2. Run without `--system` or without the missing-file selector to read an existing config instead
  3. Initialize a mise.toml in the project (`mise use node@20` writes one)
  4. Verify you are in the directory containing the config you expect

Example fix

// before
$ mise config get --system  # fails: no system config exists
// after
$ mise config get           # reads the nearest existing config
# or create it: mise config set --system tools.node "20"
Defensive patterns

Strategy: fallback

Validate before calling

[ -f "${MISE_CONFIG:-mise.toml}" ] || [ -f "$HOME/.config/mise/config.toml" ] || echo "no config exists yet"

Type guard

has_config() { [ -f mise.toml ] || [ -f .mise.toml ] || [ -f "$HOME/.config/mise/config.toml" ]; }

Try / catch

mise config get "$key" 2>/dev/null || echo "(no config / unset)"

Prevention

When it happens

Trigger: `mise config get` (optionally with `--system` or a file selection) when the resolved config path doesn't exist: `--system` used but no system config was ever created, an explicitly chosen file was deleted, or `top_toml_config()` returned a path that was removed after being referenced.

Common situations: New machines or CI containers where no mise.toml exists yet; users running `mise config get --system` expecting defaults to exist; deleted global config after cleanup scripts.

Understand the failure class

Background: "Config file not found": what it means and how to fix it in docker-sync, Maven, Vagrant, Turborepo and other tools — this error's family across 60 libraries.

Related errors


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

Appendix: source

Thrown at src/cli/config/get.rs:62

        // Only an explicitly named target goes through the shared resolver — the default is a
        // different rule (the top TOML config of the loaded set, not the nearest writable one).
        let file = match self.file {
            Some(path) => Some(resolve_target_config_path(ConfigPathOptions {
                path: Some(path),
                prefer_toml: true,
                ..Default::default()
            })?),
            None if self.global => Some(resolve_target_config_path(ConfigPathOptions {
                global: true,
                prefer_toml: true,
                ..Default::default()
            })?),
            None if self.system => Some(system_config_path()),
            None => top_toml_config(),
        };
        if let Some(file) = file {
            if !file.exists() {
                bail!("config file not found: {}", display_path(&file));
            }
            let content = std::fs::read_to_string(&file)?;
            let config: toml::Value = toml::de::from_str(&content)?;
            let mut value = &config;
            if let Some(key) = &self.key {
                for k in key.split('.') {
                    value = value.get(k).ok_or_else(|| {
                        eyre::eyre!("Key not found: {} in {}", key, display_path(&file))
                    })?;
                }
            }

            match value {
                toml::Value::String(s) => miseprintln!("{}", s),
                toml::Value::Integer(i) => miseprintln!("{}", i),
                toml::Value::Boolean(b) => miseprintln!("{}", b),
                toml::Value::Float(f) => miseprintln!("{}", f),
                toml::Value::Datetime(d) => miseprintln!("{}", d),

View on GitHub (pinned to 533346cc37)