JSONNET(1) User Commands JSONNET(1)

# [NAME](#NAME)

Jsonnet - manual page for Jsonnet reformatter v0.22.0

# [DESCRIPTION](#DESCRIPTION)

Jsonnet reformatter v0.22.0

jsonnetfmt {&lt;option&gt;} { &lt;filename&gt; }

## [Available options:](#Available_options:)

[**-h** / **--help**](#h)

This message

[**-e** / **--exec**](#e)

Treat filename as code

**-o** / **--output-file** &lt;file&gt; Write to the output file rather than stdout

[**-i** / **--in-place**](#i)

Update the Jsonnet file(s) in place.

[**--test**](#test)

Exit with failure if reformatting changed the file(s).

[**-n** / **--indent** &lt;n&gt;](#n)

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

[**--max-blank-lines** &lt;n&gt;](#max)

Max vertical spacing, 0 means no change (default 2)

[**--string-style** &lt;d|s|l&gt;](#string)

Enforce double, single (default) quotes or 'leave'

**--comment-style** &lt;h|s|l&gt; # (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**](#debug)

Unparse the desugared AST without executing it

[**--version**](#version)

Print version

In all cases: &lt;filename&gt; 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".

September 2026 Jsonnet reformatter v0.22.0

---

Document: jsonnetfmt(1) from jsonnet 0.22.0-r0 (Chainguard OS)
