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@latest
Run the following command in PowerShell:
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/henrriusdev/tfenv/main/install.ps1" -OutFile "install.ps1"
.\install.ps1
After installation, restart the terminal and run:
tfenv
Run the following command in Terminal:
curl -fsSL https://raw.githubusercontent.com/henrriusdev/tfenv/main/install.sh | bash
Once installed, you can run:
tfenv
- Navigate to your project directory.
- If the
.env
file exists, just run:Otherwise, you will be prompted to enter thetfenv
.env
file path. - The tool will convert it to
terraform.tfvars
and 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.