Registry / devops / jinja2-cli

jinja2-cli

JSON →
library1.0.1pypypi✓ verified 22d ago

jinja2-cli is a command-line interface for rendering Jinja2 templates. It allows users to combine data from various sources (JSON, YAML, INI, TOML, environment variables) with Jinja2 templates directly from the shell. The current version is 1.0.1, actively maintained, with a focus on stability and new input formats, while ensuring backwards compatibility since v1.0.0, except for Python 2 support.

pip install jinja2-cli
INSTALL
IMPORT
SIG · JINJA2-CLI
J
jinja2-cli
devopspythonv1.0.1
Install
1.8s avg
Import
109ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.0.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.114s · 19MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.8s · import 0.104s · 19MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

cli
from jinja2cli import cli
from jinja2_cli import cli
main
from jinja2cli import main
version
from jinja2cli import version

Create a simple JSON data file and a Jinja2 template, then render the template using the `jinja2` command. The output will be 'Hello, World!'.

echo '{"name": "World"}' > data.json echo 'Hello, {{ name }}!' > template.j2 jinja2 template.j2 data.json rm data.json template.j2
jinja2 --version
Debug
Known issues
breakingPython 2 support was dropped in v1.0.0. Projects upgrading from older versions (pre-1.0.0) on Python 2 will break.
fix
Upgrade to Python 3.8 or newer before upgrading jinja2-cli to v1.0.0 or later.
affects: <1.0.0
gotchaSpecific input data formats (e.g., YAML, TOML, XML) require additional Python packages to be installed alongside `jinja2-cli`.
fix
Install the necessary optional dependencies, e.g., `pip install jinja2-cli[yaml]` for YAML support, `pip install jinja2-cli[xml]` for XML, or `pip install 'jinja2-cli[all]'` for all supported formats.
affects: >=1.0.0
gotchaEnvironment variables are not automatically passed as data to the template. You must explicitly request them.
fix
Use the `--env-vars` flag to expose all environment variables to the template, or `--env-file <path>` to load variables from a .env file.
affects: >=1.0.0
gotchaThe Jinja2 default behavior allows accessing undefined variables without raising an error. This can mask typos or missing data.
fix
Use the `--strict` flag to make Jinja2 raise an error when an undefined variable is accessed, improving template robustness: `jinja2 --strict template.j2 data.json`.
affects: >=1.0.0
Upgrade
Version history
1.0.1latest on PyPI · released Apr 5, 2026
Audit
Dependencies
Jinja2requiredCore templating engine
PyYAMLoptionalRequired for YAML input format (--format=yaml)
xmltodictoptionalRequired for XML input format (--format=xml)
python-dotenvoptionalRequired for .env file input (--env-file)
pytomloptionalRequired for TOML input format (--format=toml)
Agent activity
10 hits · last 30 days
node
8
Resources
jinja2-cli — pip install jinja2-cli · libregistry