Skip to content

henrriusdev/tfenv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tfenv - Terraform Environment Manager

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

  1. Navigate to your project directory.
  2. If the .env file exists, just run:
    tfenv
    Otherwise, you will be prompted to enter the .env file path.
  3. 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

  1. Clone the repository:
    git clone https://github.com/henrriusdev/tfenv.git
  2. Navigate to the project:
    cd tfenv
  3. Build the project:
    go build -o tfenv
  4. Run it:
    ./tfenv

📜 License

This project is licensed under the MIT License.