{"id":9846,"library":"jinja-cli","title":"Jinja CLI","description":"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.","status":"active","version":"1.2.2","language":"python","source_language":"en","source_url":"https://github.com/cykerway/jinja-cli","tags":["jinja2","cli","templating","command-line"],"install":[{"cmd":"pip install jinja-cli","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Core templating engine used by jinja-cli.","package":"jinja2","optional":false}],"imports":[{"note":"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`.","symbol":"jinja-cli","correct":"This package is primarily a command-line interface tool."}],"quickstart":{"code":"echo \"Hello {{ name }}! Today is {{ day }}.\" > template.j2\njinja --data '{\"name\": \"World\", \"day\": \"Friday\"}' template.j2","lang":"bash","description":"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."},"warnings":[{"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.","message":"When 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.","severity":"gotcha","affected_versions":"All versions"},{"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.","message":"Passing 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.","severity":"gotcha","affected_versions":"All versions"},{"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).","message":"By 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.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'1.2.2':7 'activ':40 'allow':19 'cli':2,4,55 'command':11,58 'command-lin':10,57 'current':5 'data':23 'direct':33 'environ':28 'infrequ':43 'interfac':13 'jinja':1,3 'jinja2':16,53,54 'json':25 'line':12,59 'maintain':41 'pass':22 'primarili':47 'project':38 'provid':8 'releas':46 'render':15,31 'serv':48 'stabl':45 'templat':17,32,56 'termin':36 'user':20 'variabl':29 'version':6 'via':24 'wrapper':51 'yaml':26","created_at":"2026-04-17T01:21:01.740719+00:00","updated_at":"2026-04-17T01:21:01.740719+00:00","problems":{"verify_error":"no import statement found"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.2.2","cli_name":"jinja","cli_version":"usage: jinja [options] [template]","type":"library","homepage":null,"github":"https://github.com/cykerway/jinja-cli","docs":null,"changelog":null,"pypi":"https://pypi.org/project/jinja-cli/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"skip","verified_at":"2026-06-28","last_verified":"2026-06-28","next_check":"2026-07-05","install_tag":null}}