# 使用 Homebrew, apk, Nix, apt 安装 jinja2-cli

查看 jinja2-cli 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:jinja2-cli
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install jinja2-cli
```

  证据: local Homebrew formula metadata

### Linux

- apk (92%):

```sh
sudo apk add jinja2-cli
```

  证据: Alpine Linux edge package indexes: jinja2-cli from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- Nix (92%):

```sh
nix profile install nixpkgs#jinja2-cli
```

  证据: nixpkgs package indexes: pkgs/by-name/ji/jinja2-cli/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- Debian apt (92%):

```sh
sudo apt install python-jinja2-doc
```

  证据: Debian stable package indexes: python-jinja2-doc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

## 软件包事实

- **软件包键:** brew:jinja2-cli
- **软件包管理器:** Homebrew
- **版本:** 1.0.1
- **来源摘要:** CLI for the Jinja2 templating language
- **主页:** <https://github.com/mattrobenolt/jinja2-cli>
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- jinja2 (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 1.0.1
## 项目历史与用法

jinja2-cli is a command-line wrapper around the Jinja2 templating engine. It turns Jinja templates plus structured data files or standard input into a Unix-style filter, making Jinja useful outside Python applications for shell scripts, deployment templates, generated config files, and CI jobs.

### 项目历史

The package appeared on PyPI in 2012 as `jinja2-cli`, described as the CLI for Jinja2. Its early releases established the core pattern that still defines the tool: run `jinja2 template.j2 data.json`, or pipe data into `jinja2`, and render with Jinja using JSON and related input formats.

The 0.x release line gradually added and maintained data-format handling and CLI behavior. In 2026 the project reached v1.0.0 after the maintainer returned to the backlog and open pull requests, kept backward compatibility except for dropping Python 2, and pointed users to the expanded docs directory.

### 采用历史

The README lists several real-world dependents, including Freedom of the Press Foundation's Dangerzone, Elastic Docker images, and ScyllaDB CloudFormation templates, plus hundreds of GitHub dependents. Its packaging footprint includes PyPI, Homebrew, nixpkgs, AUR, and Alpine, matching its role as a small automation tool used from many operating-system package ecosystems.

### 使用方式

The tool reads data from files or stdin, supports inline variables with `-D key=value`, allows custom Jinja2 extensions, imports custom filters with `-F`, and exposes Jinja2 environment options. Built-in formats include JSON, INI, ENV, querystring, and TOML on Python versions with standard TOML support, with optional extras for YAML, XML, HJSON, and JSON5.

### 为什么软件包爱好者会关心

jinja2-cli is significant because it packages a Python template engine in the smallest useful Unix shape: one executable that accepts a template and data. It is the kind of tool that appears in Docker builds, release scripts, Kubernetes and cloud-template generation, and distro package sets because it avoids dragging a bespoke Python application into each repository.

### 时间线

- 2012: PyPI release 0.1.0 introduced the package as a CLI for Jinja2.
- 2015: The 0.3 and 0.4 releases continued the early Python packaging line.
- 2017: Version 0.6.0 extended the 0.x series.
- 2019: Version 0.7.0 continued the tool's use as a small templating CLI.
- 2022: Version 0.8.2 closed the pre-1.0 release line.
- 2026: v1.0.0 dropped Python 2 support and refreshed the project after backlog and pull-request review.

### Related projects

- jinja2-cli depends conceptually on Jinja2 from the Pallets project and overlaps with command-line templating tools such as gomplate, envsubst, mustache CLIs, yq/jq pipelines, cookiecutter, and configuration generators used in infrastructure repositories.

### 来源

- <https://api.github.com/repos/mattrobenolt/jinja2-cli/releases?per_page=100>
- <https://github.com/mattrobenolt/jinja2-cli>
- <https://github.com/mattrobenolt/jinja2-cli/tree/main/docs>
- <https://jinja.palletsprojects.com/>
- <https://pypi.org/pypi/jinja2-cli/json>
- <https://raw.githubusercontent.com/mattrobenolt/jinja2-cli/main/README.md>


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals

## 其他软件包管理器记录

- Nix - jinja2-cli: normalized package name match | nixpkgs package indexes: pkgs/by-name/ji/jinja2-cli/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- apk - jinja2-cli - 1.0.1-r0: normalized package name match | Alpine Linux edge package indexes: jinja2-cli from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | CLI for Jinja2 | https://github.com/mattrobenolt/jinja2-cli
- apk - jinja2-cli-pyc - 1.0.1-r0: normalized package name match | Alpine Linux edge package indexes: jinja2-cli-pyc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Precompiled Python bytecode for jinja2-cli | https://github.com/mattrobenolt/jinja2-cli
- Debian apt - python-jinja2-doc - 3.1.6-1: installed executable or alias match | Debian stable package indexes: python-jinja2-doc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | documentation for the Jinja2 Python library | http://jinja.pocoo.org/
- Debian apt - python3-jinja2 - 3.1.6-1: installed executable or alias match | Debian stable package indexes: python3-jinja2 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | small but fast and easy to use stand-alone template engine | http://jinja.pocoo.org/
- Ubuntu apt - python-jinja2-doc - 3.1.2-1ubuntu1: installed executable or alias match | Ubuntu 24.04 LTS package indexes: python-jinja2-doc from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | documentation for the Jinja2 Python library | http://jinja.pocoo.org/
- Ubuntu apt - python3-jinja2 - 3.1.2-1ubuntu1: installed executable or alias match | Ubuntu 24.04 LTS package indexes: python3-jinja2 from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | small but fast and easy to use stand-alone template engine | http://jinja.pocoo.org/


## Combined YAML source

View the package source record on GitHub. [combined/jinja2-cli.yml](https://github.com/mxcl/pkgdb/blob/main/combined/jinja2-cli.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
