OS Manuals

/usr/bin/jsonnetfmt

Jsonnet - The data templating language

From jsonnet 0.22.0-r1 (enterprise-packages), captured 2026-11-08 by running jsonnetfmt --help (exit 0). permalink

Jsonnet reformatter v0.22.0

jsonnetfmt {<option>} { <filename> }

Available options:
  -h / --help             This message
  -e / --exec             Treat filename as code
  -o / --output-file <file> Write to the output file rather than stdout
  -i / --in-place         Update the Jsonnet file(s) in place.
  --test                  Exit with failure if reformatting changed the file(s).
  -n / --indent <n>       Number of spaces to indent by (default 2, 0 means no change)
  --max-blank-lines <n>   Max vertical spacing, 0 means no change (default 2)
  --string-style <d|s|l>  Enforce double, single (default) quotes or 'leave'
  --comment-style <h|s|l> # (h), // (s)(default), or 'leave'; never changes she-bang
  --[no-]pretty-field-names Use syntax sugar for fields and indexing (on by default)
  --[no-]pad-arrays       [ 1, 2, 3 ] instead of [1, 2, 3]
  --[no-]pad-objects      { x: 1, y: 2 } instead of {x: 1, y: 2} (on by default)
  --[no-]sort-imports     Sorting of imports (on by default)
  --debug-desugaring      Unparse the desugared AST without executing it
  --version               Print version

In all cases:
<filename> can be - (stdin)
Multichar options are expanded e.g. -abc becomes -a -b -c.
The -- option suppresses option processing for subsequent arguments.
Note that since filenames and jsonnet programs can begin with -, it is advised to
use -- if the argument is unknown, e.g. jsonnet -- "$FILENAME".
Options (11)
OptionDescriptionSource
-h /This messagehelp + man
-e /Treat filename as codehelp + man
-i /Update the Jsonnet file(s) in place.help + man
--testExit with failure if reformatting changed the file(s).help + man
-n /Number of spaces to indent by (default 2, 0 means no change)help + man
--max-blank-lines nMax vertical spacing, 0 means no change (default 2)help + man
--string-style d|s|lEnforce double, single (default) quotes or 'leave'help + man
--debug-desugaringUnparse the desugared AST without executing ithelp + man
--versionPrint versionhelp + man
-o / (in the manual page but not in --help)man
--comment-style h|s|l--[no-]pretty-field-names Use syntax sugar for fields and indexing (on by default) (in the manual page but not in --help)man

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.