tfinit is a command-line interface (CLI) tool to quickly scaffold and manage your Terraform projects. It provides an interactive TUI to select common providers and also includes commands to keep your provider versions up-to-date.
- Interactive Scaffolding: Interactively select from a list of popular Terraform providers (AWS, Google Cloud, Azure, etc.) to generate your initial project files.
- Version Management: Automatically fetches the latest provider versions from the Terraform Registry.
- Automated Updates: A simple
updatecommand to parse your existingprovider.tfand update versions to the latest available. - Standard File Generation: Creates
provider.tf,variables.tf,main.tf, andterraform.tfvarswith sensible defaults.
Once the project is published, you will be able to install it via Homebrew:
brew install warike/tools/tfinitEnsure you have a working Go environment (Go 1.18+).
go install github.com/warike/terraform-files@latestThe create command launches an interactive terminal UI to help you scaffold a new Terraform project.
To create a project in the current directory:
tfinit create --name .To create a project in a new directory called my-infra:
tfinit create --name my-infraInteractive Selection:
- Use the arrow keys (
↑/↓orj/k) to navigate. - Press Spacebar to select or deselect providers.
- Press
yto confirm and generate the files. - Press
qorCtrl+Cto quit.
The update command checks for newer versions of the providers listed in your provider.tf file and updates them automatically.
To update a project in the current directory:
tfinit update --name .To update a project in the my-infra directory:
tfinit update --name my-infraThe tool will print a list of providers that were updated.
Contributions are welcome! Please see the Contributing Guidelines for more details on how to set up your development environment and submit pull requests.
This project is licensed under the MIT License.