{"record":{"id":"39b0057074b1445c","repo":"jdx/mise","slug":"setting-is-not-set","errorCode":null,"errorMessage":"Setting [{}] is not set","messagePattern":"Setting \\[(.+?)\\] is not set","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/settings/get.rs","lineNumber":47,"sourceCode":"        let settings = if self.local {\n            let partial = Settings::parse_settings_file(&config::local_toml_config_path())\n                .unwrap_or_default();\n            Settings::partial_as_dict(&partial)?\n        } else {\n            Settings::get().as_dict()?\n        };\n        let mut value = toml::Value::Table(settings);\n        let mut key = Some(self.setting.as_str());\n        while let Some(k) = key {\n            let k = k\n                .split_once('.')\n                .map(|(a, b)| (a, Some(b)))\n                .unwrap_or((k, None));\n            if let Some(v) = value.as_table().and_then(|t| t.get(k.0)) {\n                key = k.1;\n                value = v.clone()\n            } else if is_known_setting(&self.setting) {\n                bail!(\"Setting [{}] is not set\", self.setting);\n            } else {\n                bail!(\"Unknown setting: {}\", self.setting);\n            }\n        }\n        match value {\n            toml::Value::String(s) => miseprintln!(\"{s}\"),\n            value => miseprintln!(\"{value}\"),\n        }\n\n        Ok(())\n    }\n}\n\nfn is_known_setting(key: &str) -> bool {\n    if SETTINGS_META.contains_key(key) {\n        return true;\n    }\n    let prefix = format!(\"{key}.\");","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/settings/get.rs#L29-L65","documentation":"`mise settings get <key>` walks dotted path segments through the settings TOML. When a segment resolves but the final key has no stored value in any settings file, mise checks whether the key is a known setting; if it is, it reports that the setting exists but is simply not set, rather than treating it as unknown. This distinguishes 'valid but unset' (user should set it or rely on the default) from an invalid key.","triggerScenarios":"Running `mise settings get <known-setting>` where no settings file (global, local, or system) has written a value for that key — only the built-in default applies.","commonSituations":"Querying a setting you assumed was configured in ~/.config/mise/settings.toml but never saved; settings removed by `mise settings unset`; reading settings in CI where only defaults exist.","solutions":["Set the value: `mise settings set <key> <value>`.","If the default is acceptable, handle the unset case in your script instead of failing (check exit code or use a default).","Check which config files exist with `mise settings ls` / inspect ~/.config/mise/settings.toml and project mise.toml [settings] blocks."],"exampleFix":"// before\nmise settings get experimental\n// Setting [experimental] is not set\n\n// after\nmise settings set experimental true\nmise settings get experimental","handlingStrategy":"fallback","validationCode":"mise settings ls | grep -qx \"${key}\" || echo \"${key} may be unset or unknown\"","typeGuard":null,"tryCatchPattern":"value=$(mise settings get \"$key\" 2>/dev/null) || value=\"$default_value\"","preventionTips":["Treat exit failure as 'unset' and apply your own default","Set important settings explicitly in ~/.config/mise/settings.toml","Check `mise settings ls` output when scripts depend on a setting"],"tags":["cli","settings","configuration"],"backgroundTag":"missing-config-key","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}