j21
Command line tool for templating in shell-scripts
Overview
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.
positional arguments:
template
|
Template file to process |
|---|---|
data
|
Input data file path; "-" to use stdin |
optional arguments:
-
-h, --help -
show this help message and exit
-
-v, --version -
show program's version number and exit
-
-f {?,ini,json,yaml,env}, --format {?,ini,json,yaml,env} -
Input data format
-
-e VAR, --import-env VAR -
Import environment variables as `var` variable. Use empty string to import into the top level
--filterspython-file [python-file ...]-
Load custom Jinja2 filters from a Python file: all top-level functions are imported.
--testspython-file [python-file ...]-
Load custom Jinja2 tests from a Python file.
-
--customize python-file.py -
A Python file that implements hooks to fine-tune the j2cli behavior
-
--undefined -
Allow undefined variables to be used in templates (no error will be raised)
-
-o outfile -
Output to a file instead of stdout
Releases
Unchanged in 2 releases since Debian 12 (Bookworm).