A powerful CLI tool for template rendering using the Tera template engine. Transform JSON data into any text format with custom filters for encoding, decoding, and data manipulation.
# Install from releases
wget https://github.com/skitsanos/teraclio/releases/latest/download/teraclio-linux-amd64.tar.gz
tar -xzf teraclio-linux-amd64.tar.gz
sudo mv teraclio /usr/local/bin/
# Basic usage
echo '{"name": "World"}' > data.json
echo 'Hello {{ data.name }}!' > template.txt
teraclio --source data.json --template template.txt
# Output: Hello World!
- 🚀 Fast & Lightweight - Single binary with no dependencies
- 📝 Powerful Templating - Full Tera template engine support
- 🔧 Extensive Filter Library - 16+ custom filters for data transformation
- 📊 Multi-Format Input - JSON, YAML, TOML with auto-detection
- 🌍 Cross-Platform - Linux, macOS, Windows (Intel & ARM)
- ⚡ Flexible Output - File output or stdout with format detection
- 🔒 Security Filters - Hash generation (MD5, SHA1, SHA256)
- 🌐 Web-Ready - URL encoding, HTML/XML escaping
- 🔤 Case Conversion - snake_case, kebab-case, camelCase, PascalCase
- 🌍 Environment Integration - Access environment variables in templates
- Installation Guide - Download binaries or build from source
- Usage Guide - Command-line interface and examples
- Custom Filters - Base64 and bytes conversion filters
- Tera Template Basics - Template syntax and features
- Examples - Real-world usage scenarios
teraclio --source <data-file> --template <template-file> [OPTIONS]
Argument | Required | Description |
---|---|---|
--source, -s |
✅ | Data file (JSON, YAML, TOML) |
--template, -t |
✅ | Tera template file |
--dest, -d |
❌ | Output file (stdout if omitted) |
--format, -f |
❌ | Input format (auto-detected from extension) |
--env-vars |
❌ | Include environment variables as data.env |
# Create data
echo '{"user": "Alice", "items": ["laptop", "mouse"]}' > data.json
# Create template
cat > report.txt << 'EOF'
User Report: {{ data.user }}
Items: {{ data.items | join(sep=", ") }}
Count: {{ data.items | length }}
EOF
# Generate report
teraclio -s data.json -t report.txt
# Encode data
echo '{"message": "Hello World"}' > data.json
echo '{{ data.message | base64_encode }}' > encode.txt
teraclio -s data.json -t encode.txt
# Output: SGVsbG8gV29ybGQ=
Teraclio extends Tera with 16+ custom filters organized by category:
Hash & Security
md5
,sha1
,sha256
- Generate cryptographic hashesbase64_encode
/base64_decode
- Base64 operations
Web & URL
url_encode
/url_decode
- URL encoding/decodinghtml_escape
/xml_escape
- HTML/XML entity escaping
String Transformation
snake_case
,kebab_case
,camel_case
,pascal_case
- Case conversionsbytes_to_str
/str_to_bytes
- Bytes/string conversion
See Custom Filters Documentation for complete details and examples.
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License - see the LICENSE file for details.