Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.
/ tfvm Public archive

A Terraform Version Manager written in Go

License

Notifications You must be signed in to change notification settings

ehassett/tfvm

Repository files navigation

tfvm

Version MIT License tests release

A Terraform Version Manager written in Go

Deprecated

This project has been deprecated and archived at v2.0.0. It is recommended to use tfswitch as a replacement.

Table of Contents

Features

  • Easily manage multiple terraform versions to use across projects.
  • Run tfvm use with no version argument to switch to the version specified in the current directory's .tfversion file.
  • Works on Linux, Mac, and Windows.

How it Works

tfvm installs and manages different versions of terraform in the CLI.

Getting Started

Installation

Homebrew (for Mac and Linux)

Install via Homebrew:

brew tap ehassett/tfvm
brew install tfvm

Scoop (for Windows)

Install via Scoop:

scoop bucket add tfvm https://github.com/ehassett/tfvm
scoop install tfvm

Script (for Mac and Linux)

Install via the install script (requires both curl and wget):

wget -q -O - https://raw.githubusercontent.com/ehassett/tfvm/master/install.sh | bash

Go users

Install latest with go install (or substitute a version):

go install github.com/ehassett/tfvm@latest

Run tfvm --version to verify installation.

⚠️ Important Note
You may need to add $HOME/.tfvm to PATH after installing tfvm

CLI Usage

$ tfvm --help

Usage: tfvm [--version] [--help] <command> [<args>]

Available commands are:
    install    Install a version of Terraform
    list       List all installed versions of Terraform
    remove     Remove a specific version of Terraform
    use        Select a version of Terraform to use

Contributing

Contributions to this project are welcome and much appreciated!

Development

  1. Use Golang version 1.16.
  2. Fork this repo.
  3. Commit and push your changes, using proper conventional commit format.
  4. Open a Pull Request, rebasing against master if needed.

Bugs, feature requests, and comments are more than welcome in the issues.