id = "yamlfmt" name = "yamlfmt" homepage = "https://github.com/google/yamlfmt" description = "An extensible command line tool or library to format YAML files." executables = ["yamlfmt"] [dotfiles] # The official yamlfmt config guide documents the system/global config under # XDG_CONFIG_HOME/yamlfmt (or ~/.config/yamlfmt and %LOCALAPPDATA%/yamlfmt). # Project-local .yamlfmt files are deliberately omitted. # https://github.com/google/yamlfmt/blob/main/docs/config-file.md paths = [ "[configHome]/yamlfmt/.yamlfmt", "%LOCALAPPDATA%/yamlfmt/.yamlfmt", ] secret = [] [commands] format = 1 label = "Format YAML" description = "Format YAML files or directories, or preview/lint formatting. Flags must come before paths. Per-formatter options and stdin mode are left out." quality = "ai-draft" parser = { end_of_options = "--", interleave = "permute", long_equals = false, short_attached = false, short_bundles = false } [[commands.source]] id = "docs" kind = "manual" url = "https://github.com/google/yamlfmt/blob/main/docs/command-usage.md" revision = "main 2026-10-27" evidence = """ | Dry Run | `-dry` | `yamlfmt -dry .` | Use Dry Run mode | | Lint | `-lint` | `yamlfmt -lint .` | Use Lint mode | | Quiet Mode | `-quiet`, `-q` | `yamlfmt -dry -q .` | Use quiet mode. Only has effect in Dry Run or Lint modes. | | Verbose Mode | `-verbose`, `-v` | `yamlfmt -v .` | Use verbose mode. Only has effect in Format mode. | | Config File Path | `-conf` | string | `yamlfmt -conf ./config/.yamlfmt` | | Doublestar | `-dstar` | bool | `yamlfmt -dstar "**/*.yaml"` | | Exclude | `-exclude` | []string | `yamlfmt -exclude ./not/,these_paths.yaml` | | Gitignore Excludes | `-gitignore_excludes` | bool | `yamlfmt -gitignore_excludes` | | Extensions | `-extensions` | []string | `yamlfmt -extensions yaml,yml` | """ [[commands.field]] id = "dry" label = "Dry run (print diffs only)" type = "boolean" option = ["-dry"] sources = ["docs"] [[commands.field]] id = "lint" label = "Lint (exit 1 on differences)" type = "boolean" option = ["-lint"] sources = ["docs"] [[commands.field]] id = "quiet" label = "Quiet (dry run / lint)" type = "boolean" option = ["-quiet", "-q"] sources = ["docs"] [[commands.field]] id = "verbose" label = "Verbose (format mode)" type = "boolean" option = ["-verbose", "-v"] sources = ["docs"] [[commands.field]] id = "conf" label = "Config file" type = "path" path = { kind = "file", role = "input" } option = ["-conf"] sources = ["docs"] [[commands.field]] id = "dstar" label = "Doublestar path patterns" type = "boolean" option = ["-dstar"] sources = ["docs"] [[commands.field]] id = "exclude" label = "Exclude patterns (comma separated)" type = "string" option = ["-exclude"] sources = ["docs"] [[commands.field]] id = "gitignore_excludes" label = "Exclude gitignored paths" type = "boolean" option = ["-gitignore_excludes"] sources = ["docs"] [[commands.field]] id = "extensions" label = "Extra extensions (comma separated)" type = "string" option = ["-extensions"] sources = ["docs"] [[commands.field]] id = "paths" label = "Paths" type = "path" path = { kind = "any", role = "input" } position = 0 multiple = true sources = ["docs"] [[commands.task]] id = "format" label = "Format in place" description = "Rewrites files." fields = ["paths"] required = ["paths"] [[commands.task]] id = "dry" label = "Preview changes" fields = ["dry", "paths"] required = ["paths"] set = { dry = [true] } [[commands.task]] id = "lint" label = "Lint formatting" fields = ["lint", "paths"] required = ["paths"] set = { lint = [true] } [[commands.group]] id = "basic" label = "Basic" fields = ["dry", "lint", "quiet", "verbose", "paths"] [[commands.group]] id = "advanced" label = "Advanced" fields = ["conf", "dstar", "exclude", "gitignore_excludes", "extensions"]