Metadata-Version: 2.4
Name: tmpl-cli
Version: 0.1.0
Summary: Render Jinja2 templates from the command line with JSON/YAML/env data
Author-email: Marcus <marcus.builds.things@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/marcusbuildsthings-droid/tmpl
Project-URL: Issues, https://github.com/marcusbuildsthings-droid/tmpl/issues
Keywords: template,jinja2,cli,render,config
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Text Processing
Classifier: Topic :: Utilities
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click>=8.0
Requires-Dist: jinja2>=3.0
Provides-Extra: yaml
Requires-Dist: pyyaml>=6.0; extra == "yaml"
Dynamic: license-file

# tmpl-cli

Render Jinja2 templates from the command line with JSON, YAML, environment variables, or inline values.

## Install

```bash
pip install tmpl-cli

# With YAML support:
pip install tmpl-cli[yaml]
```

## Usage

```bash
# Render a template file with a data file
tmpl render template.conf -d config.json

# Inline template with --set
tmpl render "Hello {{name}}!" --set name=World

# Multiple data sources (later overrides earlier)
tmpl render app.conf -d defaults.json -d overrides.json --set debug=true

# Use environment variables
tmpl render deploy.yaml --env
tmpl render deploy.yaml --env-prefix APP_

# List variables in a template
tmpl vars template.conf

# Validate syntax
tmpl validate template.conf

# Check template + data completeness
tmpl check template.conf -d data.json --strict
```

## Commands

| Command | Description |
|---------|-------------|
| `render` | Render a template (file, inline string, or stdin with `-`) |
| `vars` | List undeclared variables in a template |
| `validate` | Check template syntax |
| `check` | Validate template and verify all variables are provided |

## Data Sources (priority low→high)

1. `-d` / `--data` files (JSON or YAML, repeatable)
2. `--env` (all env vars) or `--env-prefix PREFIX` (filtered, prefix stripped)
3. `-s` / `--set key=value` (highest priority, repeatable)

Values in `--set` are auto-parsed as JSON when possible (`--set count=5` → int, `--set items='["a","b"]'` → list).

## For AI Agents

See [SKILL.md](SKILL.md) for agent-optimized documentation.

## License

MIT
