Render Jinja2 templates on the command line using shell environment variables. Installed as a CLI tool, it reads a template file, substitutes variables from the environment, and outputs the result. Current version 0.8.0 (2025-03-21) drops Python 2 support and requires Python >=3.10.
pip install envtplVerified import paths — ran on the pinned version, not inferred.
Create a Jinja2 template and render it with envtpl, passing environment variables.
Upgrade to Python 3.10+.
Use `envtpl -u template.j2` to suppress errors for undefined variables.
Use `envtpl < template.j2` or `cat template.j2 | envtpl`. Do not omit the `<` or pipe.
Provide input: `envtpl < mytemplate.j2` or `echo '...' | envtpl`.
Set the variable before running: `export VARIABLE=value; envtpl template.j2`, or use `-u` flag.