tfenv is a simple CLI tool that converts .env files into terraform.tfvars for easy integration with Terraform. It supports Windows, Linux, and macOS.
You can install this by using:
go install github.com/henrriusdev/tfenv@latestRun the following command in PowerShell:
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/henrriusdev/tfenv/main/install.ps1" -OutFile "install.ps1"
.\install.ps1After installation, restart the terminal and run:
tfenvRun the following command in Terminal:
curl -fsSL https://raw.githubusercontent.com/henrriusdev/tfenv/main/install.sh | bashOnce installed, you can run:
tfenv- Navigate to your project directory.
- If the
.envfile exists, just run:Otherwise, you will be prompted to enter thetfenv
.envfile path. - The tool will convert it to
terraform.tfvarsand optionally generatevariables.tf.
- Converts .env to terraform.tfvars
- Generates variables.tf (optional)
- Interactive CLI with Bubble Tea and Huh
- Works on Windows, Linux, and macOS
- Can be installed with Go
- Clone the repository:
git clone https://github.com/henrriusdev/tfenv.git
- Navigate to the project:
cd tfenv - Build the project:
go build -o tfenv
- Run it:
./tfenv
This project is licensed under the MIT License.