{"record":{"id":"a29bc57cff2b8d3c","repo":"jdx/mise","slug":"no-mise-toml-file-found-a29bc5","errorCode":null,"errorMessage":"No mise.toml file found","messagePattern":"No mise\\.toml file found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/config/set.rs","lineNumber":74,"sourceCode":"                    eyre::eyre!(\n                        \"Usage: mise config set <KEY>=<VALUE> or mise config set <KEY> <VALUE>\"\n                    )\n                })?;\n                (k.to_string(), v.to_string())\n            }\n        };\n        // Only an explicitly named target goes through the shared resolver — the default is a\n        // different rule (the top TOML config of the loaded set, not the nearest writable one).\n        let file = match self.file {\n            Some(path) => Some(resolve_target_config_path(ConfigPathOptions {\n                path: Some(path),\n                prefer_toml: true,\n                ..Default::default()\n            })?),\n            None => top_toml_config(),\n        };\n        let Some(file) = file else {\n            bail!(\"No mise.toml file found\");\n        };\n        if !file.exists() {\n            bail!(\"config file not found: {}\", display_path(&file));\n        }\n        let mut config: toml_edit::DocumentMut = std::fs::read_to_string(&file)?.parse()?;\n        let mut container = config.as_item_mut();\n        let parts = full_key.split('.').collect::<Vec<&str>>();\n        let last_key = parts.last().unwrap();\n        for (idx, part) in parts.iter().take(parts.len() - 1).enumerate() {\n            container = container\n                .as_table_like_mut()\n                .ok_or_else(|| {\n                    eyre::eyre!(\n                        \"cannot set '{full_key}': '{}' is already set to a non-table value\",\n                        parts[..idx].join(\".\")\n                    )\n                })?\n                .entry(part)","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/cli/config/set.rs#L56-L92","documentation":"mise config set without --file calls top_toml_config(); when no TOML config exists in the loaded set (project chain or global) there is nowhere to write, and the command bails 'No mise.toml file found' (src/cli/config/set.rs:74) rather than silently inventing a location.","triggerScenarios":"'mise config set <key> <value>' in a directory tree with no mise.toml; only .tool-versions present; global config never created.","commonSituations":"First-time use on asdf-era projects; bootstrap scripts that set config values before any config file exists; containers and fresh clones.","solutions":["Create mise.toml first: touch mise.toml (or run 'mise use <tool>' once)","Or write to a specific file: mise config set --file path/to/mise.toml <key> <value>","Or target the global config explicitly: --file ~/.config/mise/config.toml"],"exampleFix":"# before\nmise config set env.FOO bar\n# Error: No mise.toml file found\n\n# after\ntouch mise.toml\nmise config set env.FOO bar","handlingStrategy":"validation","validationCode":"# bash: ensure a writable target exists before setting\n[ -f mise.toml ] || touch mise.toml\nmise config set \"$KEY\" \"$VALUE\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Bootstrap repos with a mise.toml scaffold","For global settings, target the file explicitly: --file ~/.config/mise/config.toml"],"tags":["mise","config","missing-file","first-run"],"backgroundTag":"missing-config-file","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}