Scroll to navigation

JSONNET(1) User Commands JSONNET(1)

NAME

Jsonnet - Jsonnet data templating language interpreter

DESCRIPTION

Jsonnet reformatter v0.20.0

jsonnetfmt {<option>} { <filename> }

Available options:

This 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).
Number of spaces to indent by (default 2, 0 means no change)
Max vertical spacing, 0 means no change (default 2)
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)
Unparse the desugared AST without executing it
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".

SEE ALSO

The full documentation for Jsonnet is maintained as a Texinfo manual. If the info and Jsonnet programs are properly installed at your site, the command

info Jsonnet

should give you access to the complete manual.

June 2025 Jsonnet reformatter v0.20.0