JSONNET(1)
πΈ JSONNET(1) πΈ
okay bestie, pull up a chair, we're talking about jsonnet β specifically the auto-formatter side of it, from the User Commands section of the manual. iykyk. β¨
π NAME π
Jsonnet β it's the Jsonnet data templating language's auto-formatter, and it is literally here to make your files cute and consistent. π
π¦ DESCRIPTION π¦
hiii so this is Jsonnet reformatter v0.22.0, and it's giving "i will fix your spacing and you will thank me." π
the whole vibe is:
jsonnetfmt {<option>} { <filename> }
that's it. that's the whole ritual. π«Ά
β¨ Available options: β¨
-h/--helpβ prints this message, aka the "what do i even do here" button. iconic.-e/--execβ treats filename as code instead of a file. not me feeding it a string straight to its face π-o/--output-file<file>β writes the glow-up to file instead of to stdout. yes, we're saving it, bestie.-i/--in-placeβ updates the Jsonnet file(s) right in place. no copy, no backup, just β¨directβ¨. slay but be aware.--testβ exits with failure if the reformatting changed the file(s). it's literally a vibe check for your formatting. if it changes anything, it says no. π-n/--indent<n>β how many spaces to indent by. default is2, and0means no change at all. pick your fighter.--max-blank-lines<n>β max vertical spacing.0means no change, and the default is2. stop leaving 47 blank lines in your file, i'm begging π--string-style<d|s|l>β enforcesdfor double quotes,sfor single quotes (this is the default), orlfor 'leave'. let it be known.--comment-style<h|s|l>βhgives you#,sgives you//(and that's the default), orlfor 'leave'. heads up though, it never changes she-bang. that one's sacred. π--[no-]pretty-field-namesβ uses syntax sugar for fields and indexing. it's on by default.--[no-]pad-arraysβ gives you[ 1, 2, 3 ]instead of[1, 2, 3]π--[no-]pad-objectsβ gives you{ x: 1, y: 2 }instead of{x: 1, y: 2}, and yes it's on by default β¨--[no-]sort-importsβ sorts your imports. on by default. your imports are getting organized whether they like it or not. π§--debug-desugaringβ unparses the desugared AST without executing it. it's literally just looking, not touching. no cap.--versionβ prints the version. simple, powerful, main character energy. β
π In all cases: π
<filename>can be-which means stdin. feeding it through a pipe? valid. we love a flexible queen. π- Multichar options get expanded, so e.g.
-abcbecomes-a -b -c. it's not one mysterious flag, it's three little ones holding hands. - The
--option suppresses option processing for all subsequent arguments. basically "everything after this is my child now, don't touch it." - > β οΈ real talk, bestie: since filenames and jsonnet programs can begin with
-, it is advised to use--if the argument is unknown, e.g.jsonnet -- "$FILENAME". this is the single most important thing on this page and i will not be chill about it. π₯
thanks for coming to my ted talk π this was Jsonnet reformatter v0.22.0, brought to you from September 2026, filed under JSONNET(1). go format something gorgeous, bestie. mwah. π πβ¨
π¦ where this page comes from
- ubuntu stonking: jsonnet 0.22.0+ds-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms