Registry / devops / jinja-cli

jinja-cli

JSON →
library1.2.2pypypiunverified

Jinja CLI (current version 1.2.2) provides a command-line interface for rendering Jinja2 templates. It allows users to pass data via JSON, YAML, or environment variables and render templates directly from the terminal. The project is actively maintained with infrequent but stable releases, primarily serving as a wrapper for Jinja2.

pip install jinja-cli
INSTALL
IMPORT
SIG · JINJA-CLI
J
jinja-cli
devopspythonv1.2.2
Install
2.1s avg
Import
Disk
20MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.2.2 · 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.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 21.3MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 2.1s · import 0.000s · 23MB
20MB installed
● package 20MB
Code
Verified usage

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

jinja-cli
This package is primarily a command-line interface tool.
jinja-cli is not designed for direct import as a Python library. It provides the `jinja` command for shell usage. For programmatic Jinja2 templating, directly import `jinja2`.

This quickstart demonstrates creating a simple Jinja2 template file and then rendering it from the command line using `jinja-cli`, passing data via the `--data` flag.

echo "Hello {{ name }}! Today is {{ day }}." > template.j2 jinja --data '{"name": "World", "day": "Friday"}' template.j2
jinja --version
Debug
Known issues
gotchaWhen providing data via multiple sources (e.g., --env, --yaml-data, --json-data, --data), there's a specific precedence. Environment variables (--env) are loaded first, followed by YAML files, then JSON files, and finally inline --data strings. Later sources override earlier ones for conflicting keys.
fix
Be mindful of the data loading order: `--env` -> `--yaml-data` -> `--json-data` -> `--data`. Use `--verbose` or print the data within your template to debug unexpected values.
affects: All versions
gotchaPassing complex JSON or YAML data directly via the `--data` flag can require careful shell escaping, especially with nested structures, quotes, or special characters. Incorrect escaping can lead to parsing errors or truncated data.
fix
For complex data, prefer using `--json-data FILENAME.json` or `--yaml-data FILENAME.yaml` to load data from a file, which avoids shell escaping issues. If using `--data`, ensure the string is correctly quoted and escaped for your shell.
affects: All versions
gotchaBy default, Jinja2 (and thus `jinja-cli`) auto-escapes HTML characters in variables. This is generally a security feature, but it can be unexpected if you intend to output raw HTML or certain characters.
fix
To disable auto-escaping for a specific variable, use the `| safe` filter: `{{ my_html_content | safe }}`. To disable auto-escaping for the entire template, use `{% autoescape false %}` and `{% endautoescape %}` blocks within the template, or specify `--no-autoescape` CLI option (though this option is not explicitly listed in common usage, it's a Jinja2 concept).
affects: All versions
Upgrade
Version history
1.2.2latest on PyPI · released Dec 25, 2021
Audit
Dependencies
jinja2requiredCore templating engine used by jinja-cli.
Agent activity
16 hits · last 30 days
node
16
Resources
jinja-cli — pip install jinja-cli · libregistry