jsonnetfmt - Man Page

jsonnet reformatter


jsonnetfmt [option ...] [filename]


In all cases:

Available Options


Print a usage message


Treat filename as code

-o--output-file file

Write to the output file rather than stdout


Update the Jsonnet file(s) in place


Exit with failure if reformatting changed the file(s)

-n--indent n

Number of spaces to indent by (default 2, 0 means no change)

--string-style [d|s|l]

Enforce double, single (default) quotes or ‘leave’

--comment-style [h|s|l]

# (h), // (s) (default), or ‘leave’


Use syntax sugar for fields and indexing (on by default)


[ 1, 2, 3 ] instead of [1, 2, 3]


{ x: 1, y: 2 } instead of {x: 1, y: 2} (on by default)


Sorting of imports (on by default)


Unparse the desugared AST without executing it


Print version

See Also


Referenced By


June 2021