j2cli
Command-line interface to Jinja2 for templating in shell scripts.
What it is and what it does
j2cli is a command-line wrapper around Jinja2 that lets you render templates from the shell without writing Python code. It accepts a Jinja2 template file and data in JSON, YAML, INI, or environment variable format, then outputs the rendered result. The tool is particularly useful in Docker and shell scripting contexts where you need to generate configuration files dynamically from structured data or environment variables.
The package depends only on jinja2 and optionally pyyaml for YAML support. It supports custom Jinja2 filters, tests, and environment customization through Python hook files. However, the project has been unmaintained since 2019 and its repository is now archived—the maintainer explicitly recommends using one of several actively maintained forks instead.
Use it for:
- Generate nginx or Apache configuration files from JSON/YAML templates in Docker containers at startup.
- Render application config files from environment variables in CI/CD pipelines without shell variable expansion.
- Template shell scripts or systemd unit files with data from structured config files.
- Batch-generate multiple configuration variants from a single template and different data sources.
- Inject secrets or runtime values into configuration templates using environment variables or data files.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
j2cli is a command-line tool that renders Jinja2 templates using data from JSON, YAML, INI files, or environment variables, designed for use in shell scripts and Docker environments.
No. While j2cli works and has low install friction, it is unmaintained since 2019 with an archived repository. The project's own documentation recommends using actively maintained forks (jinjanator, jinja2-cli, or jj2cli) instead. Install one of those alternatives unless you have a specific reason to use this exact version.
Install
j2cli on PyPI
pip
pip install j2cliuv
uv add j2clipoetry
poetry add j2cliInstalling j2cli
Before you install
Installation is straightforward with low friction—a single wheel dependency on jinja2. However, the project is abandoned as of 2019 with no active maintenance, and the repository is archived. The description explicitly recommends actively maintained forks instead.
License in practice
Licensed under BSD (permissive), which allows commercial and private use with minimal restrictions, though you should verify the exact BSD variant in the source.
Quickstart
pip install j2cli
# Render template with JSON data:
j2 -f json config.j2 data.json > config.conf
# Or render using environment variables:
export HOSTNAME=localhost
j2 config.j2
Verify before relying
- Whether the archived codebase has known security issues or compatibility problems with modern Python versions beyond what OSV reports.
- Whether the recommended forks (jinjanator, jinja2-cli, jj2cli) are true drop-in replacements or require workflow changes.
Package facts
| License | BSD (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — jinja2 |
| Maintenance | abandoned — 2,625 days since the last release |
| Last repo commit | (repository archived) |
| First released | |
| Downloads | 1,766,060/month — #3,578 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: j2cli-0.3.10-py2.py3-none-any.whl
Keywords: Jinja2, templating, command-line, CLI
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
anyconfigLoads, dumps, and merges configuration files in…
permissive · top 15,000 on PyPI
envtplRenders Jinja2 templates on the command line,…
copyleft · top 15,000 on PyPI
jinja2-cliA command-line interface for Jinja2 templating…
permissive · top 5,000 on PyPI
jinjanatorA command-line tool that renders Jinja2…
permissive · top 5,000 on PyPI
crudinicrudini is a command-line utility for reading,…
copyleft · top 15,000 on PyPI
ruamel.yaml.jinja2Enables Jinja2 templating within YAML files by…
permissive · top 5,000 on PyPI
jinja-cliA command-line tool that renders Jinja2…
copyleft · top 15,000 on PyPI
crossplaneParses NGINX configuration files into JSON and…
permissive · top 5,000 on PyPI
j2lintj2lint validates Jinja2 template syntax and…
permissive · top 15,000 on PyPI
django-jinjaIntegrates Jinja2 templating into Django,…
permissive · top 15,000 on PyPI