tfenv

Much like rbenv, pyenv

Table of contents
  1. Installation
  2. Usage
    1. List all versions available
    2. Install and uninstall
    3. List all installed versions
    4. Use a specific version
    5. Print current version
    6. Pin current version to project

Installation

brew install tfenv

tfenv conflicts with terraform, so if you have terraform installed, you need to uninstall it first.

Usage

List all versions available

tfenv list-remote

Install and uninstall

tfenv install [version]
tfenv uninstall [version]

List all installed versions

tfenv list

Use a specific version

tfenv use [version]
tfenv version-name

Pin current version to project

tfenv pin

Command above will create a .terraform-version file in the current directory.


References: