Version manager for OpenTofu, Terraform, Terragrunt, and others
Release history
v4.16.4
CompareGitHub
Changelog
- 7470d99 gh-actions: bump sigstore/cosign-installer from 4.1.2 to 4.1.3 (#670)
- 1fc8bd2 gh-actions: bump docker/setup-buildx-action from 4.1.0 to 4.4.1 (#659)
- 87921cd gh-actions: bump goreleaser/goreleaser-action from 7.2.3 to 7.3.0 (#660)
- 9d490a0 gh-actions: bump docker/login-action from 4.7.0 to 4.8.0 (#661)
- b6bcfaa feat: Update SECURITY.md links (#669)
- 13d64c1 fix: Workflow permissions to publish-chocolatey (#667)
- 33b8d2f Potential fix for code scanning alert no. 11: Workflow does not contain permissions (#665)
- 0a195af Potential fix for code scanning alert no. 4: Workflow does not contain permissions (#666)
- 4ba03cb Potential fix for code scanning alert no. 12: Workflow does not contain permissions (#663)
- ccbf011 ci: add build provenance attestation to release workflow (#657)
- 3fa9ac9 feat: Pin action to the full-length commit SHA (#655)
- 874a835 fix: Fix golangci-lint warnings (#656)
v4.16.3
CompareGitHub
Changelog
- 7470d99 gh-actions: bump sigstore/cosign-installer from 4.1.2 to 4.1.3 (#670)
- 1fc8bd2 gh-actions: bump docker/setup-buildx-action from 4.1.0 to 4.4.1 (#659)
- 87921cd gh-actions: bump goreleaser/goreleaser-action from 7.2.3 to 7.3.0 (#660)
- 9d490a0 gh-actions: bump docker/login-action from 4.7.0 to 4.8.0 (#661)
- b6bcfaa feat: Update SECURITY.md links (#669)
- 13d64c1 fix: Workflow permissions to publish-chocolatey (#667)
- 33b8d2f Potential fix for code scanning alert no. 11: Workflow does not contain permissions (#665)
- 0a195af Potential fix for code scanning alert no. 4: Workflow does not contain permissions (#666)
- 4ba03cb Potential fix for code scanning alert no. 12: Workflow does not contain permissions (#663)
- ccbf011 ci: add build provenance attestation to release workflow (#657)
- 3fa9ac9 feat: Pin action to the full-length commit SHA (#655)
- 874a835 fix: Fix golangci-lint warnings (#656)
v4.15.1
CompareGitHub
Changelog
- ef36e9a Merge pull request #620 from esmithaas/fix/trivy-detected-cves
- 274cedb fix: cves detected by trivy
- a1a206c Merge pull request #608 from tofuutils/dependabot/github_actions/actions/checkout-7.0.0
- cbca3fb gh-actions: bump actions/checkout from 6.0.3 to 7.0.0
- 5a50ce3 Merge pull request #607 from tofuutils/dependabot/go_modules/github.com/bradleyfalzon/ghinstallation/v2-2.19.0
- 799caeb go: bump github.com/bradleyfalzon/ghinstallation/v2
v4.12.0
CompareGitHub
Changelog
- b5612c8 Merge pull request #585 from jakubfronczyk/feat/shell-completion-installed-versions
- ce392ce feat: add shell completion for installed versions in use and uninstall commands
- df29766 update readme add winget installation variant (#583)
- 78958d2 Merge pull request #580 from tofuutils/dependabot/go_modules/tools/github.com/go-git/go-git/v5-5.18.0
- eb5d72e Merge pull request #581 from tofuutils/dependabot/go_modules/github.com/cloudflare/circl-1.6.3
- 6d7c8b8 go: bump github.com/cloudflare/circl from 1.6.2 to 1.6.3
- 735ab08 chore(deps): bump github.com/go-git/go-git/v5 in /tools
v4.11.1
CompareGitHub
Changelog
- a34f1a9 fix: disable slack notifications
- 9714580 Merge pull request #571 from tofuutils/dependabot/github_actions/docker/login-action-4.1.0
- bea1248 Merge pull request #572 from tofuutils/dependabot/github_actions/actions/setup-go-6.4.0
- 6aa7308 Merge pull request #573 from tofuutils/dependabot/go_modules/github.com/zclconf/go-cty-1.18.1
- 1b02772 go: bump github.com/zclconf/go-cty from 1.18.0 to 1.18.1
- c8c6624 gh-actions: bump actions/setup-go from 6.3.0 to 6.4.0
- a3ecba9 gh-actions: bump docker/login-action from 4.0.0 to 4.1.0
v4.10.1
CompareGitHub
Changelog
- b561815 Merge pull request #563 from tofuutils/dependabot/github_actions/codecov/codecov-action-6.0.0
- 222b8d3 Merge pull request #554 from tofuutils/dependabot/github_actions/docker/setup-qemu-action-4.0.0
- 64e06e0 Merge pull request #549 from tofuutils/dependabot/go_modules/github.com/zclconf/go-cty-1.18.0
- a038b59 fix
- 3ae83ef Merge branch 'main' into dependabot/go_modules/github.com/zclconf/go-cty-1.18.0
- 7c50478 Merge pull request #560 from tofuutils/dependabot/go_modules/github.com/ProtonMail/gopenpgp/v2-2.10.0
- 111ec73 Merge pull request #569 from tofuutils/dependabot/go_modules/github.com/hashicorp/go-version-1.9.0
- e3053a8 Merge pull request #561 from tofuutils/dependabot/go_modules/github.com/fatih/color-1.19.0
- 9f5f4a9 go: bump github.com/ProtonMail/gopenpgp/v2 from 2.9.0 to 2.10.0
- 44bf886 go: bump github.com/hashicorp/go-version from 1.8.0 to 1.9.0
- 79e1243 go: bump github.com/fatih/color from 1.18.0 to 1.19.0
- 80b3d19 Merge pull request #553 from tofuutils/dependabot/github_actions/docker/login-action-4.0.0
- cba625e Merge pull request #557 from tofuutils/dependabot/go_modules/github.com/PuerkitoBio/goquery-1.12.0
- adfa1f8 Merge pull request #562 from tofuutils/dependabot/github_actions/sigstore/cosign-installer-4.1.1
- e473e1e gh-actions: bump codecov/codecov-action from 5.5.3 to 6.0.0
- 7477239 gh-actions: bump sigstore/cosign-installer from 4.1.0 to 4.1.1
- 3df29ce go: bump github.com/PuerkitoBio/goquery from 1.11.0 to 1.12.0
- 531cb6e gh-actions: bump docker/setup-qemu-action from 3.7.0 to 4.0.0
- a52480f gh-actions: bump docker/login-action from 3.7.0 to 4.0.0
- 108d8c8 go: bump github.com/zclconf/go-cty from 1.17.0 to 1.18.0
README
<!-- BADGES --> <p align="center"> <a href="https://github.com/tofuutils/tenv/releases"><img src="https://img.shields.io/github/v/release/tofuutils/tenv?style=for-the-badge" alt="Github release"></a> <a href="https://github.com/tofuutils/tenv/graphs/contributors"><img src="https://img.shields.io/github/contributors/tofuutils/tenv?style=for-the-badge" alt="Contributors"></a> <img src="https://img.shields.io/maintenance/yes/2026.svg?style=for-the-badge" alt="maintenance status"> <a href="https://goreportcard.com/report/github.com/tofuutils/tenv/"><img src="https://img.shields.io/badge/go%20report-A+-brightgreen.svg?style=for-the-badge" alt="Go report"></a> <a href="https://codecov.io/gh/tofuutils/tenv"><img src="https://img.shields.io/codecov/c/github/tofuutils/tenv?token=BDU9X0BAZV&style=for-the-badge" alt="codecov"></a> </p>
<!-- LOGO --> <br /> <div align="center"> <a> <img src="assets/logo.png" alt="Logo" width="200" height="200"> </a> <h3 align="center">tenv</h3> <p align="center"> OpenTofu, Terraform, Terragrunt, Terramate and Atmos version manager, written in Go. <br /> · <a href="https://github.com/tofuutils/tenv/issues/new?assignees=&labels=issue%3A+bug&projects=&template=bug_report.md&title=">Report Bug</a> · <a href="https://github.com/tofuutils/tenv/issues/new?assignees=&labels=&projects=&template=feature_request.md&title=">Request Feature</a> · </p> </div>
<p align="center"> <a href="https://devhunt.org/tool/tenv" title="DevHunt - Tool of the Week"><img src="./assets/devhunt-badge.png" width=160 alt="DevHunt - Tool of the Week" /></a> </p>
<a id="about-the-project"></a>
About The Project
Welcome to tenv, a versatile version manager for OpenTofu, Terraform, Terragrunt, Terramate and Atmos, written in Go. Our tool simplifies the complexity of handling different versions of these powerful tools, ensuring developers and DevOps professionals can focus on what matters most - building and deploying efficiently.
tenv is a successor of tofuenv and tfenv.
<a id="key-features"></a>
Key Features
- Versatile version management: Easily switch between different versions of OpenTofu, Terraform, Terragrunt, Terramate and Atmos.
- Semver 2.0.0 Compatibility: Utilizes go-version for semantic versioning and use the HCL parser to extract required version constraint from OpenTofu/Terraform/Terragrunt files (see required_version and Terragrunt hcl).
- Signature verification: Supports cosign (if present on your machine) and PGP (via gopenpgp), see signature support.
- Intuitive installation: Simple installation process with Homebrew and manual options.
- Callable as Go module, with a Semver compatibility promise on tenvlib wrapper package (get more information in TENV_AS_LIB.md).
<a id="difference-with-asdf"></a>
Difference with asdf
asdf-vm share the same goals than tenv : simplify the usage of several version of tools.
asdf-vm is generic and extensible with a plugin system, key tenv differences :
- tenv is more specific and has features dedicated to OpenTofu, Terraform, Terragrunt, Terramate and Atmos, like HCL parsing based detection (see Key Features).
- tenv is distributed as independent binaries and does not rely on any shell or other CLI executable.
- tenv does better in terms of performance and platform compatibility. It works uniformly across all modern operating systems, including Linux, MacOS, Windows, BSD, and Solaris, whereas asdf-vm natively supports only Linux and MacOS.
- tenv checks the sha256 checksum and the signature of the checksum file with cosign. Check Signature support section for getting more information about it.
- tenv command compatibility: In nearly all places you can use the exact syntax that works in tfenv / tofuenv. If you're coming from tfenv/tofuenv and comfortable with that way of working you can almost always use the same syntax with tenv.
- tenv performance: It sounds incredibly useful, though it might be tough to get a real apples to apples comparison since the tools work differently in a lot of ways. The author of asdf did a great writeup of performance problems.
<a id="table-of-contents"></a>
Table of Contents
<!-- TABLE OF CONTENTS --> <details markdown="1"> <summary>Table of Contents</summary> <ol> <li> <a href="#about-the-project">About The Project</a> <ul> <li><a href="#key-features">Key Features</a></li> <li><a href="#difference-with-asdf">Difference with asdf</a></li> </ul> </li> <li> <a href="#table-of-contents">Table of contents</a> </li> <li> <a href="#getting-started">Getting Started</a> <ul> <li><a href="#prerequisites">Prerequisites</a></li> <li><a href="#installation">Installation</a></li> </ul> </li> <li><a href="#usage">Usage</a></li> <li><a href="#environment-variables">Environment variables</a></li> <li><a href="#version-files">Version files</a></li> <li><a href="#troubleshooting">Troubleshooting</a></li> <li><a href="#technical-details">Technical details</a></li> <li><a href="#verifying-signature">Verifying tenv Signatures</a></li> <li><a href="#contributing">Contributing</a></li> <li><a href="#community">Community</a></li> <li><a href="#authors">Authors</a></li> <li><a href="#licence">Licence</a></li> </ol> </details>
<a id="getting-started"></a>
Getting Started
<a id="prerequisites"></a>
Prerequisites
If you need to enable cosign checks, install cosign (v.2.0+) tool via one of the following commands:
<details markdown="1"><summary><b>MacOS (Homebrew, MacPorts)</b></summary><br>
Installation via Homebrew:
brew install cosignInstallation via MacPorts:
sudo port install cosign</details>
<details markdown="1"><summary><b>Windows (go install)</b></summary><br>
go install github.com/sigstore/cosign/v2/cmd/cosign@latest</details>
<details markdown="1"><summary><b>Alpine Linux</b></summary><br>
apk add cosign</details>
<details markdown="1"><summary><b>Arch Linux</b></summary><br>
sudo pacman -S cosign</details>
<details markdown="1"><summary><b>Gentoo (Portage)</b></summary><br>
emerge --ask app-containers/cosign</details>
<details markdown="1"><summary><b>Linux: RPM</b></summary><br>
LATEST_VERSION=$(curl https://api.github.com/repos/sigstore/cosign/releases/latest | jq -r .tag_name | tr -d "v")
curl -O -L "https://github.com/sigstore/cosign/releases/latest/download/cosign-${LATEST_VERSION}-1.x86_64.rpm"
sudo rpm -ivh cosign-${LATEST_VERSION}-1.x86_64.rpm</details> <details markdown="1"><summary><b>Linux: dkpg</b></summary><br>
LATEST_VERSION=$(curl https://api.github.com/repos/sigstore/cosign/releases/latest | jq -r .tag_name | tr -d "v")
curl -O -L "https://github.com/sigstore/cosign/releases/latest/download/cosign_${LATEST_VERSION}_amd64.deb"
sudo dpkg -i cosign_${LATEST_VERSION}_amd64.deb</details>
<a id="installation"></a>
Installation
<a id="automatic-installation"></a>
Automatic Installation
<details markdown="1"><summary><b>Arch Linux (AUR, Nix)</b></summary><br>
This package is available on the Arch Linux User Repository. It can be installed using the yay AUR helper:
yay tenv-binInstallation via Nix package manager:
nix-env -i tenv</details>
<details markdown="1"><summary><b>MacOS (Homebrew, MacPorts, Nix)</b></summary><br>
Installation via Homebrew:
brew install tenvInstallation via MacPorts:
sudo port install tenvInstallation via Nix package manager:
nix-env -i tenv</details>
<details markdown="1"><summary><b>Windows (Chocolatey, Scoop etc.)</b></summary><br>
Installation via Chocolatey:
choco install tenvInstallation via Scoop:
scoop install tenvInstallation via Nix package manager:
nix-env -i tenvInstallation via WinGet package manager:
winget install Tofuutils.Tenv</details>
<details markdown="1"><summary><b>Linux: Snapcraft</b></summary><br>
snap install tenv</details>
<details markdown="1"><summary><b>Alpine</b></summary><br>
apk add tenv --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing/Installation via Cloudsmith Artifact Management platform.
Setup Cloudsmith repository automatically:
sudo apk add --no-cache bash
curl -1sLf 'https://dl.cloudsmith.io/public/tofuutils/tenv/cfg/setup/bash.alpine.sh' | sudo bashInstall via apk:
apk add tenv</details>
<details markdown="1"><summary><b>Ubuntu</b></summary><br>
Install via PPA
Add the Launchpad PPA (amd64, arm64, armhf):
sudo add-apt-repository ppa:kvendingoldo/tenv
sudo apt update
sudo apt install tenvInstall via dpkg
LATEST_VERSION=$(curl --silent https://api.github.com/repos/tofuutils/tenv/releases/latest | jq -r .tag_name)
curl -O -L "https://github.com/tofuutils/tenv/releases/latest/download/tenv_${LATEST_VERSION}_amd64.deb"
sudo dpkg -i "tenv_${LATEST_VERSION}_amd64.deb"Install via Nix
Installation via Nix package manager:
nix-env -i tenvInstallation via Cloudsmith Artifact Management platform.
Setup Cloudsmith repository automatically:
curl -1sLf 'https://dl.cloudsmith.io/public/tofuutils/tenv/cfg/setup/bash.deb.sh' | sudo bashInstall via apt:
sudo apt install tenv</details>
<details markdown="1"><summary><b>RedHat</b></summary><br>
Installation via Cloudsmith Artifact Management platform.
Setup Cloudsmith repository automatically:
curl -1sLf 'https://dl.cloudsmith.io/public/tofuutils/tenv/cfg/setup/bash.rpm.sh' | sudo bashInstall via yum:
sudo yum install tenv</details>
<details markdown="1"><summary><b>NixOS</b></summary>
nix-env
nix-env -iA nixos.tenvNixOS Configuration
Add the following Nix code to your NixOS Configuration, usually located in /etc/nixos/configuration.nix
environment.systemPackages = [
pkgs.tenv
];nix-shell
nix-shell -p tenv</details>
<details markdown="1"><summary><b>Gentoo (Portage)</b></summary><br>
tenv is not yet packaged in the official Gentoo repository or in the GURU community overlay, so install the binaries from the release archive:
TENV_VERSION=$(curl --silent https://api.github.com/repos/tofuutils/tenv/releases/latest | jq -r .tag_name)
curl -O -L "https://github.com/tofuutils/tenv/releases/latest/download/tenv_${TENV_VERSION}_Linux_x86_64.tar.gz"
tar -xzf "tenv_${TENV_VERSION}_Linux_x86_64.tar.gz"
sudo install -m 0755 tenv tf tofu terraform terragrunt terramate atmos -t /usr/local/binOn Gentoo, Portage manages a single system version of Terraform (app-admin/terraform): tenv complements it by managing multiple OpenTofu, Terraform, Terragrunt, Terramate and Atmos versions per project in the TENV_ROOT directory (~/.tenv by default).
</details>
<a id="manual-installation"></a>
Manual Installation
Get the most recent packaged binaries (.deb, .rpm, .apk, pkg.tar.zst , .zip or .tar.gz format) by visiting the release page. After downloading, unzip the folder and seamlessly integrate it into your system's PATH.
<a id="docker-installation"></a>
Docker Installation
You can use dockerized version of tenv via the following command:
docker run -it --rm tofuutils/tenv:latest helpThe docker container is not meant as a way to run tenv for CI pipelines, for local use, you should use one of the packaged binaries. <a id="usage"></a>
<a id="shell-completion"></a>
Install shell completion
[!NOTE] If you install tenv via Brew, MacPorts, or Nix, completion will be installed automatically.
<details markdown="1"><summary><b>zsh</b></summary><br>
tenv completion zsh > ~/.tenv.completion.zsh
echo "source \$HOME/.tenv.completion.zsh" >> ~/.zshrc</details>
<details markdown="1"><summary><b>Oh My Zsh</b></summary><br>
tenv completion zsh > ~/.oh-my-zsh/completions/_tenvMake sure the completions folder ~/.oh-my-zsh/completions is listed under $fpath:
print -l $fpath</details>
<details markdown="1"><summary><b>powershell</b></summary><br>
tenv completion powershell | Out-String | Invoke-Expression</details>
<details markdown="1"><summary><b>bash</b></summary><br>
tenv completion bash > ~/.tenv.completion.bash
echo "source \$HOME/.tenv.completion.bash" >> ~/.bashrc</details>
<details markdown="1"><summary><b>fish</b></summary><br>
tenv completion fish > ~/.tenv.completion.fish
echo "source \$HOME/.tenv.completion.fish" >> ~/.config/fish/config.fish</details>
Usage
tenv supports OpenTofu,
Terraform, Terragrunt, Terramate and
Atmos. To manage each binary you can use tenv <tool> <command>. Below is a list of tools and commands that use actual subcommands:
| tool (alias) | env vars | description |
|---|---|---|
tofu (opentofu) | TOFUENV_ | OpenTofu |
tf (terraform) | TFENV_ | Terraform |
tg (terragrunt) | TG_ | Terragrunt |
tm (terramate) | TM_ | Terramate |
at (atmos) | ATMOS_ | Atmos |
Without subcommand tenv display interactive menus to manage tools and their versions.
<p align="center">
<a href="https://asciinema.org/a/670790">
<img alt="tenv interactive" src="https://raw.githubusercontent.com/tofuutils/tenv/main/assets/tenv.gif" width="100%">
</a>
</p>
<details markdown="1"><summary><b>tenv <tool> install [version]</b></summary><br>
Install a requested version of the tool (into TENV_ROOT directory from <TOOL>_REMOTE url).
Without a parameter, the version to use is resolved automatically (see resolution order in tools description, with latest as default in place of latest-allowed).
If a parameter is passed, available options include:
- an exact Semver 2.0.0 version string to install.
- a version constraint string (checked against versions available at
<TOOL>_REMOTEurl). latest,latest-stable(old name oflatest) orlatest-pre(include unstable version), which are checked against versions available at<TOOL>_REMOTEurl.latest:<re>ormin:<re>to get first version matching with<re>as a regexp after a descending or ascending version sort.latest-allowedormin-requiredto scan your IAC files to detect which version is maximally allowed or minimally required. See required_version docs.
tenv tofu install
tenv tofu install 1.6.0-beta5
tenv tf install "~> 1.6.0"
tenv tf install latest-pre
tenv tg install latest
tenv tg install latest-stable
tenv atmos install "~> 1.70"
tenv atmos install latest
tenv <tool> install latest-allowed
tenv <tool> install min-requiredA complete display :
$ tenv tofu install 1.6.0
Installing OpenTofu 1.6.0
Fetching release information from https://api.github.com/repos/opentofu/opentofu/releases/tags/v1.6.0
Downloading https://github.com/opentofu/opentofu/releases/download/v1.6.0/tofu_1.6.0_linux_amd64.zip
Downloading https://github.com/opentofu/opentofu/releases/download/v1.6.0/tofu_1.6.0_SHA256SUMS
Downloading https://github.com/opentofu/opentofu/releases/download/v1.6.0/tofu_1.6.0_SHA256SUMS.sig
Downloading https://github.com/opentofu/opentofu/releases/download/v1.6.0/tofu_1.6.0_SHA256SUMS.pem
Installation of OpenTofu 1.6.0 successful</details>
<details markdown="1"><summary><b>tenv <tool> use <version></b></summary><br>
Switch the default tool version to use (set in TENV_ROOT/<TOOL>/version file).
tenv <tool> use has a --working-dir, -w flag to write a version file in working directory.
Available parameter options:
- an exact Semver 2.0.0 version string to use.
- a version constraint string (checked against versions available in TENV_ROOT directory).
latest,latest-stable(old name oflatest) orlatest-pre(include unstable version), which are checked against versions available in TENV_ROOT directory.latest:<re>ormin:<re>to get first version matching with<re>as a regexp after a descending or ascending version sort.latest-allowedormin-requiredto scan your IAC files to detect which version is maximally allowed or minimally required. See required_version docs.
tenv tofu use v1.6.0-beta5
tenv tf use min-required
tenv tg use latest
tenv atmos use latest
tenv tofu use latest-allowed</details>
<details markdown="1"><summary><b>tenv <tool> detect</b></summary><br>
Detect the used version of tool for the working directory.
$ tenv tofu detect
No version files found for OpenTofu, fallback to latest-allowed strategy
Scan project to find .tf files
No OpenTofu version requirement found in project files, fallback to latest strategy
Found compatible version installed locally : 1.6.1
OpenTofu 1.6.1 will be run from this directory.
$ tenv tg detect -q
Terragrunt 0.55.1 will be run from this directory.
$ tenv atmos detect -q
Atmos 1.72.0 will be run from this directory.</details>
<details markdown="1"><summary><b>tenv <tool> reset</b></summary><br>
Reset used version of tool (remove TENV_ROOT/<TOOL>/version file).
$ tenv tofu reset
Removed /home/dvaumoron/.tenv/OpenTofu/version</details>
<details markdown="1"><summary><b>tenv <tool> uninstall [version]</b></summary><br>
Uninstall versions of the tool (remove it from TENV_ROOT directory).
Without parameter, display an interactive list to select several versions.
If a parameter is passed, available parameter options:
- an exact Semver 2.0.0 version string to remove (no confirmation required)
- a version constraint string
allbut-last(all versions except the highest installed)not-used-for:<duration>,<duration>in days or months, like "14d" or "2m"not-used-since:<date>,<date>format is YYYY-MM-DD, like "2024-06-30"
$ tenv tofu uninstall v1.6.0-alpha4
Uninstallation of OpenTofu 1.6.0-alpha4 successful (directory /home/dvaumoron/.tenv/OpenTofu/1.6.0-alpha4 removed)</details>
<details markdown="1"><summary><b>tenv <tool> list</b></summary><br>
List installed tool versions (located in TENV_ROOT directory), sorted in ascending version order.
tenv <tool> list has a --descending, -d flag to sort in descending order.
$ tenv tofu list -v
* 1.6.0 (set by /home/dvaumoron/.tenv/OpenTofu/version)
1.6.1
found 2 OpenTofu version(s) managed by tenv.</details>
<details markdown="1"><summary><b>tenv <tool> list-remote</b></summary><br>
List installable tool versions (from <TOOL>_REMOTE url), sorted in ascending version order.
tenv <tool> list-remote has a --descending, -d flag to sort in descending order.
tenv <tool> list-remote has a --stable, -s flag to display only stable version.
$ tenv tofu list-remote
Fetching all releases information from https://api.github.com/repos/opentofu/opentofu/releases
1.6.0-alpha1
1.6.0-alpha2
1.6.0-alpha3
1.6.0-alpha4
1.6.0-alpha5
1.6.0-beta1
1.6.0-beta2
1.6.0-beta3
1.6.0-beta4
1.6.0-beta5
1.6.0-rc1
1.6.0 (installed)
1.6.1 (installed)</details>
<details markdown="1"><summary><b>tenv <tool> constraint [expression]</b></summary><br>
Set or reset a default constraint expression for the tool.
$ tenv tf constraint "<= 1.5.7"
Written <= 1.5.7 in /home/dvaumoron/.tenv/Terraform/constraintOr without expression :
$ tenv tg constraint
Removed /home/dvaumoron/.tenv/Terragrunt/constraint</details>
<details markdown="1"><summary><b>tenv help [command]</b></summary><br>
Help about any command.
You can use --help -h flag instead.
$ tenv help tf detect
Display Terraform current version.
Usage:
tenv tf detect [flags]
Flags:
-a, --arch string specify arch for binaries downloading (default "amd64")
-f, --force-remote force search on versions available at TFENV_REMOTE url
-h, --help help for detect
-k, --key-file string local path to PGP public key file (replace check against remote one)
-n, --no-install disable installation of missing version
-c, --remote-conf string path to remote configuration file (advanced settings)
-u, --remote-url string remote url to install from
Global Flags:
-q, --quiet no unnecessary output (and no log)
-r, --root-path string local path to install versions of OpenTofu, Terraform and Terragrunt (default "/home/dvaumoron/.tenv")
-v, --verbose verbose output (and set log level to Trace)$ tenv tofu use -h
Switch the default OpenTofu version to use (set in TENV_ROOT/OpenTofu/version file)
Available parameter options:
- an exact Semver 2.0.0 version string to use
- a version constraint expression (checked against version available in TENV_ROOT directory)
- latest, latest-stable or latest-pre (checked against version available in TENV_ROOT directory)
- latest-allowed or min-required to scan your OpenTofu files to detect which version is maximally allowed or minimally required.
Usage:
tenv tofu use version [flags]
Flags:
-a, --arch string specify arch for binaries downloading (default "amd64")
-f, --force-remote force search on versions available at TOFUENV_REMOTE url
-t, --github-token string GitHub token (increases GitHub REST API rate limits)
-h, --help help for use
-k, --key-file string local path to PGP public key file (replace check against remote one)
-n, --no-install disable installation of missing version
-c, --remote-conf string path to remote configuration file (advanced settings)
-u, --remote-url string remote url to install from
-w, --working-dir create .opentofu-version file in working directory
Global Flags:
-q, --quiet no unnecessary output (and no log)
-r, --root-path string local path to install versions of OpenTofu, Terraform and Terragrunt (default "/home/dvaumoron/.tenv")
-v, --verbose verbose output (and set log level to Trace)</details>
<details markdown="1"><summary><b>tenv update-path</b></summary><br>
Display PATH updated with tenv directory location first. With GITHUB_ACTIONS set to true, write tenv directory location to GITHUB_PATH.
This command can be used when one of the managed tool is already installed on your system and hide the corresponding proxy (in that case which tenv and which <tool> will indicate different locations). The following shell call should resolve such issues :
export PATH=$(tenv update-path)</details>
<details markdown="1"><summary><b>tenv version</b></summary><br>
Display tenv current version.
$ tenv version
tenv version v1.7.0</details>
<a id="environment-variables"></a>
Environment variables
tenv commands support global environment variables and variables by tool for : OpenTofu, Terraform, TerraGrunt and Atmos.
<a id="tenv-vars"></a>
Global tenv environment variables
<details markdown="1"><summary><b>TENV_ARCH</b></summary><br>
String (Default: current tenv binaries architecture)
Allow to override the default architecture for binaries downloading during installation.
tenv <tool> subcommands detect, install and use support a --arch, -a flag version.
</details>
<details markdown="1"><summary><b>TENV_AUTO_INSTALL</b></summary><br>
String (Default: false)
If set to true tenv will automatically install missing tool versions needed.
tenv <tool> subcommands detect and use support a --install, -i enabling flag, and a --no-install, -n disabling flag.
</details>
<details markdown="1"><summary><b>TENV_FORCE_REMOTE</b></summary><br>
String (Default: false)
If set to true tenv detection of needed version will skip local check and verify compatibility on remote list.
tenv <tool> subcommands detect and use support a --force-remote, -f flag version.
</details>
<details markdown="1"><summary><b>TENV_GITHUB_TOKEN</b></summary><br>
String (Default: "")
Allow to specify a GitHub token to increase GitHub Rate limits for the REST API. Useful because OpenTofu, Terragrunt and Atmos binaries are downloaded from GitHub repository.
tenv tofu and tenv tg subcommands detect, install, list-remote and use support a --github-token, -t flag version.
</details>
<details markdown="1"><summary><b>TENV_GITHUB_APP_ID</b></summary><br>
String (Default: "")
The numeric ID of a GitHub App. When set (and TENV_GITHUB_TOKEN is not), tenv generates a short-lived installation access token from the App credentials and uses it as the bearer token for GitHub API calls. This is useful in CI systems (e.g. Atlantis) that already authenticate via a GitHub App, and raises the rate limit to 15,000 requests/hour per installation. Requires one of TENV_GITHUB_APP_PEM or TENV_GITHUB_APP_PEM_FILE to also be set.
</details>
<details markdown="1"><summary><b>TENV_GITHUB_APP_INSTALLATION_ID</b></summary><br>
String (Default: "")
The numeric installation ID of the GitHub App. Optional: when omitted, tenv auto-discovers it by querying the App's installations with the App JWT and using the first one returned. Set it explicitly when the App has more than one installation. Only used when TENV_GITHUB_APP_ID is set.
</details>
<details markdown="1"><summary><b>TENV_GITHUB_APP_PEM</b></summary><br>
String (Default: "")
The GitHub App's RSA private key as an inline PEM string. Alternative to TENV_GITHUB_APP_PEM_FILE; takes precedence over it when both are set. Only used when TENV_GITHUB_APP_ID is set.
</details>
<details markdown="1"><summary><b>TENV_GITHUB_APP_PEM_FILE</b></summary><br>
String (Default: "")
Path to a file containing the GitHub App's RSA private key in PEM format. Alternative to TENV_GITHUB_APP_PEM. Only used when TENV_GITHUB_APP_ID is set.
</details>
<details markdown="1"><summary><b>TENV_QUIET</b></summary><br>
String (Default: false)
If set to true tenv disable unnecessary output (including log level forced to off).
tenv subcommands support a --quiet, -q flag version.
</details>
<details markdown="1"><summary><b>TENV_LOG</b></summary><br>
String (Default: "warn")
Set tenv log level (possibilities sorted by decreasing verbosity : "trace", "debug", "info", "warn", "error", "off").
tenv support a --verbose, -v flag which set log level to "trace".
</details>
<details markdown="1"><summary><b>TENV_REMOTE_CONF</b></summary><br>
String (Default: ${TENV_ROOT}/remote.yaml)
The path to a yaml file for advanced remote configuration (can be used to call artifact mirror).
tenv <tool> subcommands detect, install, list-remote and use support a --remote-conf, -c flag version.
</details>
<details markdown="1"><summary><b>TENV_ROOT</b></summary><br>
String (Default: ${HOME}/.tenv)
The path to a directory where the local OpenTofu versions, Terraform versions, Terragrunt versions and tenv configuration files exist.
tenv support a --root-path, -r flag version.
</details>
<details markdown="1"><summary><b>TENV_SKIP_LAST_USE<
…(truncated)