jinja2-cli
The CLI for Jinja2
What it is and what it does
jinja2-cli is a command-line wrapper around the Jinja2 templating engine that lets you render templates from the shell, reading data from files or standard input. It accepts multiple data formats (JSON, INI, ENV, querystring, TOML, and optional YAML/XML/JSON5 via extras) and supports inline variable definition, custom Jinja2 extensions, and custom filter modules. This makes it useful for generating configuration files, documentation, or any text output driven by structured data, without writing Python code.
The tool is designed for shell scripting and DevOps workflows—you can pipe data directly from curl, jq, or other CLI tools into a template, or read from files. It supports full control over the Jinja2 environment and can load custom filters from Python modules, including Ansible's filter library. The package is actively maintained, supports Python 3.8 through 3.12, and has no known vulnerabilities.
Use it for:
- Generate configuration files (nginx, Docker, CloudFormation) from JSON or YAML data in CI/CD pipelines
- Render documentation or reports by combining templates with data fetched from APIs or databases
- Transform structured data (JSON, TOML) into text output using Jinja2 filters and logic from the command line
- Build shell scripts that template output without embedding Python or shell templating logic
- Extend template rendering with custom filters by loading your own Python filter modules
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A command-line interface for Jinja2 templating that renders templates with data from files or stdin, supporting multiple input formats including JSON, TOML, YAML, and XML.
Yes. It is a lightweight, actively maintained tool with low install friction, permissive licensing, no security vulnerabilities, and a clear use case for anyone templating text from the shell. Install it if you need to render Jinja2 templates from the command line or in scripts without writing Python code.
Install
jinja2-cli on PyPI
pip
pip install jinja2-cliuv
uv add jinja2-clipoetry
poetry add jinja2-cliInstalling jinja2-cli
Before you install
Low friction install with a single runtime dependency on jinja2. Actively maintained with recent releases and a stable repository.
License in practice
BSD License (permissive) allows use in commercial and private projects with minimal restrictions—retain copyright notice and disclaimer.
Quickstart
$ pip install jinja2-cli
$ jinja2 template.j2 data.json
$ curl -s http://api.example.com | jinja2 template.j2
Requires Python 3.8 or later; TOML format support requires Python 3.11+
Verify before relying
- Whether custom filter modules can be loaded from arbitrary paths or only from installed packages
- Performance characteristics with large data files or complex templates
- Exact behavior when template or data file is malformed or missing
Package facts
| License | Copyright (c) 2017-2026, Matt Robenolt All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — jinja2 |
| Maintenance | actively maintained — 131 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,679,960/month — #3,658 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: jinja2_cli-1.0.1-py3-none-any.whl
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
j2clij2cli is a command-line tool that renders…
permissive · top 5,000 on PyPI
jinjanatorA command-line tool that renders Jinja2…
permissive · top 5,000 on PyPI
envtplRenders Jinja2 templates on the command line,…
copyleft · top 15,000 on PyPI
jinja2-ansible-filtersProvides a collection of Jinja2 template…
copyleft · top 5,000 on PyPI
jinja-cliA command-line tool that renders Jinja2…
copyleft · top 15,000 on PyPI
Jinja2Jinja2 is a templating engine that renders…
permissive · top 100 on PyPI
jcConverts output from popular CLI tools,…
permissive · top 15,000 on PyPI
django-jinjaIntegrates Jinja2 templating into Django,…
permissive · top 15,000 on PyPI
ruamel.yaml.jinja2Enables Jinja2 templating within YAML files by…
permissive · top 5,000 on PyPI
json2xmlConverts JSON data to XML format via Python…
permissive · top 15,000 on PyPI