---
name: "j2"
section: "1"
platform: "linux"
package: "j2cli"
version: "0.3.12b-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/j2"
---

# j2(1)

Command line tool for templating in shell-scripts

## NAME

j2cli - Command line tool for templating in shell-scripts

## DESCRIPTION

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

- **--filters** python-file \[python-file ...\]

  Load custom Jinja2 filters from a Python file: all top-level functions are imported.

- **--tests** python-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

## 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.
