J2CLI(1)
β¨ J2CLI β¨
okay so bestie, gather round π this is j2cli β the command line tool for templating in shell-scripts. yeah. templates. in your shell scripts. it's giving main character energy and honestly we're obsessed.
πΈ NAME πΈ
j2cli β command line tool for templating in shell-scripts π
π DESCRIPTION π
so here's the whole vibe, the usage line, exactly as it lives:
usage: j2 [-h] [-v] [-f {?,ini,json,yaml,env}] [-e VAR]
[--filters python-file [python-file ...]] [--tests python-file
[python-file ...]] [--customize python-file.py] [--undefined] [-o
outfile] template [data]
Command-line interface to Jinja2 for templating in shell scripts. that's it. that's the whole serve. Jinja2, but from your terminal, so your shell scripts can be cute AND dynamic π
π¦ positional arguments π¦
these are the ones you just... hand over. no flags, no ceremony, just vibes.
templateβ the template file to process. the blueprint. the moment. β¨dataβ input data file path;"-"to use stdin. yes bestie, a literal dash"-"means read from stdin, iconic behavior honestly π«Ά
π optional arguments π
the flags. the little guys. every single one, no skipping, i don't make the rules π
-h,--helpβ show this help message and exit. the classic. the moment you type it and immediately understand everything π-v,--versionβ show program's version number and exit. quick lil peek at who you're dealing with π-f {?,ini,json,yaml,env},--format {?,ini,json,yaml,env}β input data format. that's the menu:?,ini,json,yaml,env. pick your fighter π-e VAR,--import-env VARβ import environment variables asvarvariable. use empty string to import into the top level. so like, if you want them tucked neatly under one name, name it. if you want them just... everywhere at the top level, empty string it is. no cap π§--filters python-file [python-file ...]β load custom Jinja2 filters from a Python file: all top-level functions are imported. bring your own filters, bestie, the more the merrier π--tests python-file [python-file ...]β load custom Jinja2 tests from a Python file. same energy, but tests instead of filters β¨--customize python-file.pyβ a Python file that implements hooks to fine-tune the j2cli behavior. yes you can literally customize the behavior. main character customization screen fr fr π--undefinedβ allow undefined variables to be used in templates (no error will be raised). so like, normally undefined variables will yell at you, and this flag tells them to chill π«Ά-o outfileβ output to a file instead of stdout. instead of screaming into the terminal, it writes to a file. very demure, very mindful π
heads up bestie: --undefined means no error will be raised for undefined variables. that's the whole point of the flag, so don't come for me when it doesn't complain β that's the deal you made π
π SEE ALSO π
the full documentation for j2cli is maintained as a Texinfo manual. if the info and j2cli programs are properly installed at your site, the command
info j2cli
should give you access to the complete manual. go read it, it's giving scholarly πβ¨
and that's the whole page, bestie. this beauty is j2cli 0.3.12b0, running with Jinja2 2.11.3, dated September 2022 π template responsibly, slay always, periodt πππ¦
π¦ where this page comes from
- debian bookworm: j2cli 0.3.12b-4 Β· BSD-2-Clause
- debian trixie: j2cli 0.3.12b-5 Β· BSD-2-Clause
- ubuntu noble: j2cli 0.3.12b-5 Β· BSD-2-Clause
- ubuntu questing: j2cli 0.3.12b-5
- ubuntu resolute: j2cli 0.3.12b-6 Β· BSD-2-Clause
- ubuntu stonking: j2cli 0.3.12b-7 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms