Command line
pip install "tplx[cli,jinja]" adds the tplx command (also python -m tplx).
Without the cli extra the command exits naming the extra.
tplx render templates/boot.cfg.j2 -s hostname=web01 # one file
tplx render boot.cfg -r templates -d host.json -o boot.cfg # a name, data from JSON
tplx render web01.boot.cfg boot.cfg -r templates # the first name found
tplx find boot.cfg -r templates # which file, which engine
tplx engines # what is registered
tplx render nginx.conf -r templates --env -u debug # envsubst from the environment
tplx [--version]
tplx render NAME... [-r ROOT]... [-p PATH]... [-u MODE] [--env] [-d FILE|-] [-s KEY=VALUE]... [-o FILE|-]
tplx find NAME... [-r ROOT]... [-p PATH]... [--json] (alias: which)
tplx engines [--json]
NAMEis looked up in the roots; several names are tried in order and the first found wins. With no-r, a singleNAMEthat is an existing file is that file, its directory the root.-r/--root(repeat; defaulttemplates),-p/--path(repeat; searched first, relative ones inside each root),-u/--undefined(strict,lenient,debug).render:--envstarts the data from the environment variables;-d/--dataa JSON object file or-for standard input over it;-s/--set key=valueover it (repeat;a.b=vnests and merges into--data; a valuejson:...is JSON);-o/--outputa file or-. Output is written as bytes, unchanged.findprints<origin>\t<Engine>, or{"origin", "engine"}with--json.enginesprints<Engine>\t<suffixes>\t<priority>per engine, highest priority first, or a JSON array with--json.renderandfindalso take-v/-qand--loglevel [NAME:]LEVEL.
Exit status: 0 done, 1 the operation failed (no such template, an engine
error, a file that cannot be read or written), 2 a usage error. A failure
prints tplx: error: <message> on standard error.