{"id":35313551,"url":"https://github.com/bordeux/tmpltool","last_synced_at":"2026-01-13T21:46:33.437Z","repository":{"id":331252471,"uuid":"1125313973","full_name":"bordeux/tmpltool","owner":"bordeux","description":"Fast template renderer supporting many datasources and hundreds of functions","archived":false,"fork":false,"pushed_at":"2026-01-04T17:44:54.000Z","size":644,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-01-05T01:13:34.135Z","etag":null,"topics":["cli","code-generation","command-line","config-generator","configuration-management","devops","environment-variables","file-generation","golang-template","iac","infrastructure-as-code","jinja2","json","minijinja","rust","template-engine","templating","toml","yaml"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bordeux.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-30T14:03:18.000Z","updated_at":"2026-01-04T17:44:56.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/bordeux/tmpltool","commit_stats":null,"previous_names":["bordeux/tmpltool"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/bordeux/tmpltool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bordeux%2Ftmpltool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bordeux%2Ftmpltool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bordeux%2Ftmpltool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bordeux%2Ftmpltool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bordeux","download_url":"https://codeload.github.com/bordeux/tmpltool/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bordeux%2Ftmpltool/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28401086,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T14:36:09.778Z","status":"ssl_error","status_checked_at":"2026-01-13T14:35:19.697Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","code-generation","command-line","config-generator","configuration-management","devops","environment-variables","file-generation","golang-template","iac","infrastructure-as-code","jinja2","json","minijinja","rust","template-engine","templating","toml","yaml"],"created_at":"2025-12-30T18:07:36.307Z","updated_at":"2026-01-13T21:46:33.432Z","avatar_url":"https://github.com/bordeux.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tmpltool\n\n[![CI](https://github.com/bordeux/tmpltool/actions/workflows/ci.yml/badge.svg)](https://github.com/bordeux/tmpltool/actions/workflows/ci.yml)\n[![Release](https://github.com/bordeux/tmpltool/actions/workflows/release.yml/badge.svg)](https://github.com/bordeux/tmpltool/actions/workflows/release.yml)\n[![codecov](https://codecov.io/gh/bordeux/tmpltool/branch/master/graph/badge.svg)](https://codecov.io/gh/bordeux/tmpltool)\n[![GitHub release](https://img.shields.io/github/v/release/bordeux/tmpltool)](https://github.com/bordeux/tmpltool/releases)\n[![Crates.io](https://img.shields.io/crates/v/tmpltool)](https://crates.io/crates/tmpltool)\n[![docs.rs](https://docs.rs/tmpltool/badge.svg)](https://docs.rs/tmpltool)\n[![MSRV](https://img.shields.io/badge/MSRV-1.85-blue)](https://github.com/bordeux/tmpltool)\n[![Docker](https://img.shields.io/badge/docker-ghcr.io-blue)](https://github.com/bordeux/tmpltool/pkgs/container/tmpltool)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\nA fast and simple command-line template rendering tool using [MiniJinja](https://github.com/mitsuhiko/minijinja) templates with environment variables.\n\n## Table of Contents\n\n- [Quick Start](#quick-start)\n- [Features](#features)\n- [Installation](#installation)\n- [Basic Usage](#basic-usage)\n- [Documentation](#documentation)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Quick Start\n\nGet started in 30 seconds:\n\n```bash\n# Install tmpltool (works on macOS, Linux, and more)\ncurl -fsSL https://raw.githubusercontent.com/bordeux/repo/master/install.sh | sh -s -- tmpltool\n\n# Create and render template\necho 'Hello {{ get_env(name=\"USER\", default=\"World\") }}!' \u003e greeting.tmpltool\ntmpltool greeting.tmpltool\n# Output: Hello World!\n```\n\n## Features\n\n- **Environment Variables**: Access env vars with `get_env()` and filter with `filter_env()`\n- **Hash \u0026 Crypto**: MD5, SHA1, SHA256, SHA512, UUID generation, random strings\n- **Encoding \u0026 Security**: Base64, hex, bcrypt, HMAC, HTML/XML/shell escaping, secure random strings\n- **Filesystem**: Read files, check existence, list directories, glob patterns, file info, path manipulation\n- **Data Parsing**: Parse and read JSON, YAML, TOML files\n- **Data Serialization**: Convert objects to JSON, YAML, TOML strings with pretty-printing options\n- **Object Manipulation**: Deep merge, get/set nested values by path, extract keys/values, check key existence\n- **Validation**: Validate emails, URLs, IPs, UUIDs, regex matching\n- **System \u0026 Network**: Get hostname, username, directories, IP addresses, DNS resolution, port availability\n- **Web \u0026 URL**: Parse and build URLs, generate query strings, HTTP Basic Auth headers\n- **Kubernetes**: Resource requests, label sanitization, ConfigMap/Secret references for manifests\n- **Math \u0026 Logic**: Min/max, rounding, percentages, default values, ternary operations, range checks\n- **Array \u0026 Statistics**: Sorting, grouping, chunking, sum/avg/median, unique values, flattening\n- **Debugging \u0026 Development**: Debug output, type checking, assertions, warnings, error handling\n- **String Filters**: 12+ filters for case conversion, indentation, padding, quoting, and more\n- **Security**: Built-in protections with optional `--trust` mode\n- **Flexible I/O**: File or stdin input, file or stdout output\n- **Full Jinja2 Syntax**: Conditionals, loops, filters, and more\n- **Single Binary**: No runtime dependencies, static binaries available\n- **Docker-Friendly**: Extract binary from Docker image (multi-arch support)\n\n## Installation\n\nThe easiest way to install tmpltool:\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/bordeux/repo/master/install.sh | sh -s -- tmpltool\n```\n\nFor detailed installation instructions including macOS, Linux, Docker, and building from source, see the [Installation Guide](docs/INSTALLATION.md).\n\n## Documentation\n\n📚 **Complete documentation is available in the [docs/](docs/) directory:**\n\n- **[Installation Guide](docs/INSTALLATION.md)** - Detailed installation instructions for all platforms\n- **[CLI Reference](docs/CLI.md)** - Complete command-line interface documentation\n- **[Template Syntax](docs/TEMPLATE_SYNTAX.md)** - MiniJinja/Jinja2 template syntax guide\n- **[Function Reference](docs/FUNCTIONS.md)** - Complete reference for all available functions\n- **[Examples](docs/EXAMPLES.md)** - Advanced examples and use cases\n- **[Error Handling](docs/ERROR_HANDLING.md)** - Understanding and handling errors\n- **[IDE Integration](docs/IDE_INTEGRATION.md)** - Using `--ide` flag for IDE plugins\n- **[Development Guide](docs/DEVELOPMENT.md)** - Building, testing, and contributing\n- **[CI/CD](docs/CICD.md)** - Continuous integration and release process\n\nSee [docs/README.md](docs/README.md) for the full documentation index.\n\n## Basic Usage\n\n### Simple Variable Substitution\n\n**Template** (`greeting.tmpltool`):\n```\nHello {{ get_env(name=\"USER\") }}!\nYour home directory is: {{ get_env(name=\"HOME\") }}\n```\n\n**Render:**\n```bash\ntmpltool greeting.tmpltool\n```\n\n### Using Default Values\n\n**Template** (`config.tmpltool`):\n```\nDatabase: {{ get_env(name=\"DB_HOST\", default=\"localhost\") }}:{{ get_env(name=\"DB_PORT\", default=\"5432\") }}\nEnvironment: {{ get_env(name=\"APP_ENV\", default=\"development\") }}\nDebug: {{ get_env(name=\"DEBUG\", default=\"false\") }}\n```\n\n**Render with defaults:**\n```bash\ntmpltool config.tmpltool\n# Output:\n# Database: localhost:5432\n# Environment: development\n# Debug: false\n```\n\n**Render with custom values:**\n```bash\nDB_HOST=postgres DB_PORT=5432 APP_ENV=production tmpltool config.tmpltool\n# Output:\n# Database: postgres:5432\n# Environment: production\n# Debug: false\n```\n\n### Conditionals and Loops\n\n**Template** (`status.tmpltool`):\n```\n{% set debug = get_env(name=\"DEBUG\", default=\"false\") %}\n{% if debug == \"true\" %}\nDEBUG MODE ENABLED\nLog level: verbose\n{% else %}\nProduction mode\nLog level: error\n{% endif %}\n\n{% set items_str = get_env(name=\"ITEMS\", default=\"apple,banana,orange\") %}\n{% set items = items_str | split(pat=\",\") %}\nItems:\n{% for item in items %}\n  - {{ item }}\n{% endfor %}\n```\n\n**Render:**\n```bash\nDEBUG=true ITEMS=\"apple,banana,orange,grape\" tmpltool status.tmpltool\n```\n\n### Filtering Environment Variables\n\n**Template** (`server-vars.tmpltool`):\n```\nServer Configuration:\n{% for var in filter_env(pattern=\"SERVER_*\") %}\n  {{ var.key }}={{ var.value }}\n{% endfor %}\n```\n\n**Render:**\n```bash\nSERVER_HOST=localhost SERVER_PORT=8080 SERVER_NAME=myapp tmpltool server-vars.tmpltool\n# Output:\n# Server Configuration:\n#   SERVER_HOST=localhost\n#   SERVER_NAME=myapp\n#   SERVER_PORT=8080\n```\n\n### Working with Files\n\n**Template** (`build-report.tmpltool`):\n```\n# Build Report\n\n{% if file_exists(path=\"README.md\") %}\n✓ README.md found ({{ file_size(path=\"README.md\") | filesizeformat }})\n{% else %}\n✗ README.md missing\n{% endif %}\n\nSource files:\n{% for file in glob(pattern=\"src/**/*.rs\") %}\n  - {{ file }} ({{ file_size(path=file) | filesizeformat }})\n{% endfor %}\n```\n\n**Render:**\n```bash\ntmpltool build-report.tmpltool\n```\n\n## Template Syntax\n\ntmpltool uses the [MiniJinja](https://github.com/mitsuhiko/minijinja) template engine, which is compatible with Python's Jinja2.\n\n**📖 For complete template syntax documentation, see [Template Syntax Guide](docs/TEMPLATE_SYNTAX.md).**\n\n## Function Reference\n\n**📖 For complete function reference, see [Function Reference](docs/FUNCTIONS.md).**\n\nThe function reference includes documentation for:\n- Environment Variables (`get_env`, `filter_env`)\n- Hash \u0026 Crypto Functions (MD5, SHA1, SHA256, SHA512, UUID, random strings)\n- Encoding \u0026 Security Functions (Base64, hex, bcrypt, HMAC, escaping)\n- Date/Time Functions (formatting, parsing, timezone conversion)\n- Command Execution Functions (`exec`, `exec_raw`) - requires `--trust` flag\n- Filesystem Functions (read files, list directories, glob patterns)\n- Path Manipulation Functions (basename, dirname, join_path, normalize_path)\n- Data Parsing \u0026 Serialization (JSON, YAML, TOML)\n- Object Manipulation Functions (merge, get/set nested values, flatten)\n- Validation Functions (email, URL, IP, UUID validation)\n- System \u0026 Network Functions (hostname, IP addresses, DNS, port checking)\n- Math Functions (min, max, round, ceil, floor, percentage)\n- Array \u0026 Statistical Functions (sum, avg, median, sort, group, unique)\n- Predicate Functions (array_any, array_all, contains, starts_with, ends_with)\n- Kubernetes Functions (resource requests, label sanitization, probes)\n- Web \u0026 URL Functions (URL parsing, query strings, Basic Auth)\n- Logic Functions (default, coalesce, ternary, in_range)\n- String Manipulation Functions (regex, substring, truncate, and more)\n- Debugging \u0026 Development Functions (type checking, assertions, warnings)\n\n## IDE Integration\n\n**📖 See [IDE Integration Guide](docs/IDE_INTEGRATION.md) for details on using the `--ide` flag.**\n\n## Advanced Examples\n\n**📖 See [Examples Guide](docs/EXAMPLES.md) for advanced use cases and examples.**\n\n## Error Handling\n\n**📖 See [Error Handling Guide](docs/ERROR_HANDLING.md) for error handling details.**\n\n## Development\n\n**📖 See [Development Guide](docs/DEVELOPMENT.md) for building, testing, and contributing.**\n\n## CI/CD\n\n**📖 See [CI/CD Guide](docs/CICD.md) for continuous integration and release process.**\n\n## Contributing\n\nContributions are welcome! For detailed guidelines, see [CONTRIBUTING.md](CONTRIBUTING.md).\n\n### Quick Start\n\n1. Fork the repository\n2. Clone and install dependencies:\n   ```bash\n   git clone https://github.com/YOUR_USERNAME/tmpltool.git\n   cd tmpltool\n   npm install  # Installs commit hooks\n   ```\n3. Create a feature branch\n4. Make your changes\n5. Run QA checks: `cargo make qa`\n6. Commit using conventional commits\n7. Push and open a Pull Request\n\n**Note:** Commit messages are automatically validated. Invalid commits will be rejected.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n---\n\nFor more examples, see the [examples/](examples/) directory and [examples/README.md](examples/README.md).\n\nFor complete MiniJinja/Jinja2 syntax documentation, visit:\n- MiniJinja Docs: https://docs.rs/minijinja/\n- Jinja2 Template Designer: https://jinja.palletsprojects.com/templates/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbordeux%2Ftmpltool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbordeux%2Ftmpltool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbordeux%2Ftmpltool/lists"}