https://github.com/unitvectory-labs/tofu-template-tester
A lightweight Go CLI that renders Terraform-compatible templates by replacing ${NAME} placeholders with user-supplied values.
https://github.com/unitvectory-labs/tofu-template-tester
Last synced: 9 days ago
JSON representation
A lightweight Go CLI that renders Terraform-compatible templates by replacing ${NAME} placeholders with user-supplied values.
- Host: GitHub
- URL: https://github.com/unitvectory-labs/tofu-template-tester
- Owner: UnitVectorY-Labs
- License: mit
- Created: 2025-05-19T23:05:53.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-17T01:23:36.000Z (12 months ago)
- Last Synced: 2025-06-17T02:29:34.695Z (12 months ago)
- Language: Go
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/UnitVectorY-Labs/tofu-template-tester/releases/latest) [](https://opensource.org/licenses/MIT) [](https://guide.unitvectorylabs.com/bestpractices/status/#active) [](https://codecov.io/gh/UnitVectorY-Labs/tofu-template-tester) [](https://goreportcard.com/report/github.com/UnitVectorY-Labs/tofu-template-tester)
# tofu-template-tester
A lightweight Go CLI that renders Terraform-compatible templates by replacing ${NAME} placeholders with user-supplied values.
## Releases
All official versions of **tofu-template-tester** are published on [GitHub Releases](https://github.com/UnitVectorY-Labs/tofu-template-tester/releases). Since this application is written in Go, each release provides pre-compiled executables for macOS, Linux, and Windows—ready to download and run.
Alternatively, if you have Go installed, you can install **tofu-template-tester** directly from source using the following command:
```bash
go install github.com/UnitVectorY-Labs/tofu-template-tester@latest
```
## Command-Line Parameters
* `-list-params`: List all template variables found in the input template.
* `-in `: Path to the input template file. If not specified, input is read from STDIN.
* `-properties `: Path to a properties file (key=value format) containing variable assignments.
* `-interactive`: Prompt for missing template variables interactively.
* `-out `: Path to write the output. If not specified, output is written to STDOUT.
## Example Usage
Suppose you have a template file named `template.txt` with the following content:
```
Hello, ${NAME}!
Your favorite color is ${COLOR}.
```
And a properties file named `vars.properties` with:
```
NAME=World
COLOR=Blue
```
You can render the template using the following command:
```bash
tofu-template-tester -in template.txt -properties vars.properties -out output.txt
```
This will produce the following output:
```
Hello, World!
Your favorite color is Blue.
```
Alternatively, you can use interactive mode:
```bash
tofu-template-tester -in template.txt -interactive
```
The tool will then prompt you to enter values for `NAME` and `COLOR`.