{"record":{"id":"89dcc7c5390a918b","repo":"jdx/mise","slug":"no-config-file-found-in-current-directory","errorCode":null,"errorMessage":"No config file found in current directory","messagePattern":"No config file found in current directory","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/fmt.rs","lineNumber":64,"sourceCode":"            let mut toml = String::new();\n            io::stdin().read_to_string(&mut toml)?;\n\n            let toml = sort(toml)?;\n            let toml = format(toml)?;\n            let mut stdout = io::stdout();\n            write!(stdout, \"{toml}\")?;\n\n            return Ok(());\n        }\n\n        let cwd = dirs::CWD.clone().unwrap_or_default();\n        let configs = if self.all {\n            ALL_TOML_CONFIG_FILES.clone()\n        } else {\n            config::config_files_in_dir(&cwd)\n        };\n        if configs.is_empty() {\n            bail!(\"No config file found in current directory\");\n        }\n        let mut errors = Vec::new();\n        for p in configs {\n            if !p\n                .file_name()\n                .is_some_and(|f| f.to_string_lossy().ends_with(\"toml\"))\n            {\n                continue;\n            }\n            let source = file::read_to_string(&p)?;\n            let toml = source.clone();\n            let toml = sort(toml)?;\n            let toml = format(toml)?;\n            if self.check {\n                if source != toml {\n                    errors.push(p.display().to_string());\n                }\n                continue;","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/fmt.rs#L46-L82","documentation":"`mise fmt` without --all looks for TOML config files in the current directory (mise.toml, settings, etc.); none were found, and stdin was not piped, so there is nothing to format and the command bails rather than being a no-op.","triggerScenarios":"Running `mise fmt` in a directory without a mise.toml/.mise.toml/mise.config.toml or similar config file, without the --all flag.","commonSituations":"Running fmt from a subdirectory of a project instead of the root; project genuinely has no mise config; typo'd cwd.","solutions":["cd to the directory containing your mise.toml and run `mise fmt` there","Create a mise.toml in the current directory if one is intended","Use `mise fmt --all` to format all known TOML config files regardless of cwd"],"exampleFix":"// before\ncd ~/project/src && mise fmt   # no config here\n// after\ncd ~/project && mise fmt\n// or:\nmise fmt --all","handlingStrategy":"validation","validationCode":"test -f mise.toml || test -f .mise.toml || echo 'no mise config here'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run fmt from the project root","Use --all when formatting config files across the repo"],"tags":["cli","fmt","config"],"backgroundTag":"config-file-not-found","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"}