/yamlfmt

Format YAML

Primary LanguageGoApache License 2.0Apache-2.0

yamlfmt

Build Status

I tried various beautifier of YAML files, but none of them satisfies me.

So, I decided to write this one based on https://github.com/miekg/yamlfmt/blob/master/fmt.go.

Usage

  • To beautify one or more files and write to stdout:

    yamlfmt a.yaml b.yaml c.yaml
  • To beautify one or more files in the replace mode:

    yamlfmt -w a.yaml b.yaml c.yaml
  • To beautify stdin and write to stdout:

    cat a.yaml | yamlfmt
  • To beautify stdin and write to a file:

    cat a.yaml | yamlfmt > b.yaml