tfenv is a simple CLI tool that converts .env
files into terraform.tfvars
for easy integration with Terraform. It supports Windows, Linux, and macOS.
π Installation
Go
You can install this by using:
go install github.com/henrriusdev/tfenv@latest
Windows
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
Linux/macOS
Run the following command in Terminal:
curl -fsSL https://raw.githubusercontent.com/henrriusdev/tfenv/main/install.sh | bash
Once installed, you can run:
tfenv
π― Usage
- Navigate to your project directory.
- If the
.env
file exists, just run:
tfenv
Otherwise, you will be prompted to enter the .env
file path.
- The tool will convert it to
terraform.tfvars
and optionally generate variables.tf
.
π Features
- 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
π§ Contributing
- 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
π License
This project is licensed under the MIT License.