JSONNET(1)

πŸ’– JSONNET(1) πŸ’–

okay bestie, we're doing the Jsonnet manual page and honestly? it's giving data-templating royalty πŸ‘‘


✨ NAME ✨

Jsonnet β€” the Jsonnet data templating language interpreter, and yes she's that girl 🌸


πŸ¦‹ DESCRIPTION πŸ¦‹

So. This is the Jsonnet commandline interpreter v0.22.0 ✨ and here's how you summon her:

jsonnet {<option>} <filename>

That's it. That's the whole vibe check. Now let's get into the options because there are a LOT and we are going to list every single one, periodt πŸ’…

🌈 Available options:

  • -h / --help β€” literally just shows you this message, the "hey bestie here's what I can do" of it all πŸ’β€β™€οΈ
  • -e / --exec β€” treats <filename> as code instead of a file. no cap.
  • -J / --jpath <dir> β€” adds an extra library search dir. the right-most wins, so keep that in mind iykyk πŸ‘‘
  • -o / --output-file <file> β€” writes to the output file instead of stdout. taking the scenic route instead of the terminal route, obsessed πŸ’–
  • -m / --multi <dir> β€” writes multiple files into the directory, and lists the files on stdout. multitasking queen πŸŽ€
  • -y / --yaml-stream β€” writes output as a YAML stream of JSON documents. so fancy ✨
  • -S / --string β€” expects a string and manifests it as plain text. keep it simple, keep it cute πŸ“
  • --no-trailing-newline β€” do not add a trailing newline to the output. if you know you know πŸ™ˆ
  • -s / --max-stack <n> β€” number of allowed stack frames. stack overflow protection era πŸ’€
  • -t / --max-trace <n> β€” max length of stack trace before it gets cropped. aesthetic cropping only πŸ’…
  • --gc-min-objects <n> β€” do not run the garbage collector until this many. she waits patiently 🧚
  • --gc-growth-trigger <n> β€” run the garbage collector after this amount of object growth. now she's got main character energy πŸ”₯
  • --version β€” prints the version. flexing time πŸ’œ

🫢 Available options for specifying values of 'external' variables:

Provide the value as a string:

  • -V / --ext-str <var>[=<val>] β€” if <val> is omitted, get it from the environment var <var> 🌸
  • --ext-str-file <var>=<file> β€” read the string from the file. file-based, lowkey elegant πŸŽ€

🧚 Provide a value as Jsonnet code:

  • --ext-code <var>[=<code>] β€” if <code> is omitted, get it from the environment var <var> ✨
  • --ext-code-file <var>=<file> β€” read the code from the file. code, but make it a file πŸ’–

πŸŽ€ Available options for specifying values of 'top-level arguments':

Provide the value as a string:

  • -A / --tla-str <var>[=<val>] β€” if <val> is omitted, get it from the environment var <var> ⭐
  • --tla-str-file <var>=<file> β€” read the string from the file πŸ¦‹

🌸 Provide a value as Jsonnet code:

  • --tla-code <var>[=<code>] β€” if <code> is omitted, get it from the environment var <var> πŸ’œ
  • --tla-code-file <var>=<file> β€” read the code from the file 🌈

πŸ’… Environment variables

JSONNET_PATH is a colon-separated list of directories (semicolon on Windows, ok cross-platform queen) added in reverse order before the paths specified by --jpath, which means left-most wins.

For example:

JSONNET_PATH=a:b jsonnet -J c -J d

is equivalent to:

JSONNET_PATH=d:c:a:b jsonnet jsonnet -J b -J a -J c -J d

like… look at her reordering her whole life and still serving πŸ’…


πŸ”₯ In all cases:

  • <filename> can be -, which means stdin. iconic behaviour.
  • Multichar options get expanded, e.g. -abc becomes -a -b -c. she unpacks it πŸŽ€
  • The -- option suppresses option processing for the subsequent arguments.
⚠️ heads up bestie: since filenames and jsonnet programs can begin with -, it is advised to use -- if the argument is unknown, like so: jsonnet -- "$FILENAME". this is the "no babe it's not a flag it's a file" protection spell 🫢

and that's the page, fr fr πŸ’– this was Jsonnet commandline interpret…, September 2026, tagged JSONNET(1) β€” go template something gorgeous, bestie, you got this πŸ‘‘βœ¨

πŸ“¦ where this page comes from