| Crates.io | tmpltool |
| lib.rs | tmpltool |
| version | 1.5.0 |
| created_at | 2026-01-10 11:09:23.288961+00 |
| updated_at | 2026-01-10 11:09:23.288961+00 |
| description | A fast and simple command-line template rendering tool using MiniJinja templates with environment variables |
| homepage | |
| repository | https://github.com/bordeux/tmpltool |
| max_upload_size | |
| id | 2034052 |
| size | 2,083,396 |
A fast and simple command-line template rendering tool using MiniJinja templates with environment variables.
Get started in 30 seconds:
# Install tmpltool (works on macOS, Linux, and more)
curl -fsSL https://raw.githubusercontent.com/bordeux/repo/master/install.sh | sh -s -- tmpltool
# Create and render template
echo 'Hello {{ get_env(name="USER", default="World") }}!' > greeting.tmpltool
tmpltool greeting.tmpltool
# Output: Hello World!
get_env() and filter with filter_env()--trust modeThe easiest way to install tmpltool:
curl -fsSL https://raw.githubusercontent.com/bordeux/repo/master/install.sh | sh -s -- tmpltool
For detailed installation instructions including macOS, Linux, Docker, and building from source, see the Installation Guide.
📚 Complete documentation is available in the docs/ directory:
--ide flag for IDE pluginsSee docs/README.md for the full documentation index.
Template (greeting.tmpltool):
Hello {{ get_env(name="USER") }}!
Your home directory is: {{ get_env(name="HOME") }}
Render:
tmpltool greeting.tmpltool
Template (config.tmpltool):
Database: {{ get_env(name="DB_HOST", default="localhost") }}:{{ get_env(name="DB_PORT", default="5432") }}
Environment: {{ get_env(name="APP_ENV", default="development") }}
Debug: {{ get_env(name="DEBUG", default="false") }}
Render with defaults:
tmpltool config.tmpltool
# Output:
# Database: localhost:5432
# Environment: development
# Debug: false
Render with custom values:
DB_HOST=postgres DB_PORT=5432 APP_ENV=production tmpltool config.tmpltool
# Output:
# Database: postgres:5432
# Environment: production
# Debug: false
Template (status.tmpltool):
{% set debug = get_env(name="DEBUG", default="false") %}
{% if debug == "true" %}
DEBUG MODE ENABLED
Log level: verbose
{% else %}
Production mode
Log level: error
{% endif %}
{% set items_str = get_env(name="ITEMS", default="apple,banana,orange") %}
{% set items = items_str | split(pat=",") %}
Items:
{% for item in items %}
- {{ item }}
{% endfor %}
Render:
DEBUG=true ITEMS="apple,banana,orange,grape" tmpltool status.tmpltool
Template (server-vars.tmpltool):
Server Configuration:
{% for var in filter_env(pattern="SERVER_*") %}
{{ var.key }}={{ var.value }}
{% endfor %}
Render:
SERVER_HOST=localhost SERVER_PORT=8080 SERVER_NAME=myapp tmpltool server-vars.tmpltool
# Output:
# Server Configuration:
# SERVER_HOST=localhost
# SERVER_NAME=myapp
# SERVER_PORT=8080
Template (build-report.tmpltool):
# Build Report
{% if file_exists(path="README.md") %}
✓ README.md found ({{ file_size(path="README.md") | filesizeformat }})
{% else %}
✗ README.md missing
{% endif %}
Source files:
{% for file in glob(pattern="src/**/*.rs") %}
- {{ file }} ({{ file_size(path=file) | filesizeformat }})
{% endfor %}
Render:
tmpltool build-report.tmpltool
tmpltool uses the MiniJinja template engine, which is compatible with Python's Jinja2.
📖 For complete template syntax documentation, see Template Syntax Guide.
📖 For complete function reference, see Function Reference.
The function reference includes documentation for:
get_env, filter_env)exec, exec_raw) - requires --trust flag📖 See IDE Integration Guide for details on using the --ide flag.
📖 See Examples Guide for advanced use cases and examples.
📖 See Error Handling Guide for error handling details.
📖 See Development Guide for building, testing, and contributing.
📖 See CI/CD Guide for continuous integration and release process.
Contributions are welcome! For detailed guidelines, see CONTRIBUTING.md.
git clone https://github.com/YOUR_USERNAME/tmpltool.git
cd tmpltool
npm install # Installs commit hooks
cargo make qaNote: Commit messages are automatically validated. Invalid commits will be rejected.
This project is licensed under the MIT License - see the LICENSE file for details.
For more examples, see the examples/ directory and examples/README.md.
For complete MiniJinja/Jinja2 syntax documentation, visit: