mise fmt
- Usage:
mise fmt [FLAGS] - Effect: modifies state
- Source code:
src/cli/fmt.rs
Format mise TOML configuration
Formats the config files in the current directory in place; --all formats every config file mise loads. Use --check in CI to fail when a file is not formatted, or --stdin to format a document from stdin to stdout.
Formatting normalizes whitespace and writes TOML 1.1 syntax, including multiline inline tables. Top-level entries written as plain, dotted, or inline-table keys go in a standard order: min_version, env_file, env_path,_, env, vars, hooks, watch_files, tools, other keys, tasks, task_config, redactions, alias, plugins, settings. [table] sections and the keys inside any table keep the order they were written in.
Lists whose order has no effect are sorted: task sources and outputs, task_config.global_inputs and input_groups, and redactions. File pattern lists put @group: references first, then globs, then literal paths. A list with a ! exclusion or a comment is left as written.
Flags
-a --all— Format every config file mise loads, not only those in the current directory-c --check— Check whether the configs are formatted without rewriting them; exits 1 if any are not-s --stdin— Format TOML from stdin and print it to stdout, without touching any file-h --help— Print help
Examples
Format the config files in the current directory
mise fmtExit 1 if any config file needs formatting
mise fmt --checkPrint a formatted copy without changing the file
mise fmt --stdin < mise.toml