Open-source project
tofuutils/tenv avatar
tofuutils/tenv

tenv Version Management for OpenTofu, Terraform, and Related CLIs

OpenTofu / Terraform / Terragrunt / Terramate and Atmos version manager

1,456 stars83 forksGoApache-2.0

At a glance

What is it?
tenv is a Go-based version manager for OpenTofu, Terraform, Terragrunt, Terramate, and Atmos. Its HCL-aware detection, checksum verification, signature support, and command-specific binaries target infrastructure teams working across several IaC tools.
Who is it for?
tenv is a sensible choice for developers and platform engineers who need repeatable OpenTofu, Terraform, Terragrunt, Terramate, or Atmos versions without maintaining separate tfenv and tofuenv installations. It is less appropriate for teams that require a generic plugin-based version manager or organizations that cannot accommodate a separate verification policy for each managed tool.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 4 days ago.
What is it written in?
Mainly Go, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 22, 2026, and from our analysis. They are not legal advice.

Editorial analysis

Why tenv Covers Five Infrastructure Tools

tenv addresses a specific infrastructure workflow problem: a repository or workstation may use more than one version of OpenTofu, Terraform, Terragrunt, Terramate, or Atmos. Manually replacing executables makes it easy to select the wrong version, while maintaining separate version managers for closely related tools adds configuration and migration work. tenv is aimed at developers and DevOps professionals who install and invoke these command-line tools as part of infrastructure delivery.

The project describes itself as the successor to both tofuenv and tfenv. That lineage matters because the README says tenv generally accepts the same command syntax used by those predecessors. This is a compatibility claim documented by the project, not a guarantee that every edge case behaves identically. Users moving from either tool still need to check the commands for the specific managed executable.

tenv is purpose-built rather than a universal runtime manager. It knows about the relationship between HCL-based tool configurations and required versions. That focus is its main reason to exist. If a team only needs to manage unrelated programs across several repositories, the dedicated five-tool coverage would be unnecessary.

HCL Detection, Semantic Versions, and Selection

tenv uses HashiCorp's `go-version` library for semantic-version handling and the HCL parser to extract version constraints from OpenTofu, Terraform, and Terragrunt configuration files. The repository also documents separate handling for Terragrunt HCL files. This gives the tool a configuration-aware selection mechanism instead of requiring every version choice to be expressed only as a loose command-line value.

The repository layout supports a central `tenv` executable plus tool-specific commands. The build configuration creates `tenv`, `tofu`, `terraform`, `terragrunt`, `terramate`, `tf`, and `atmos` binaries. The latter names indicate wrappers or entry points associated with individual tools, but the README does not explain the complete dispatch path. It does state that the distribution consists of independent binaries and does not depend on a shell or another CLI executable.

Version constraints and exact versions are therefore distinct parts of the design. HCL parsing can identify a declared constraint, while semantic-version logic evaluates whether an available version fits it. The README does not fully document conflict resolution, prerelease behavior, network failures, or what happens when no available version satisfies a constraint. Those cases need direct examination in the command documentation or through a controlled adoption test.

Installing tenv and Enabling cosign Checks

The project provides Homebrew and manual installation options, but the visible README section ends before showing the commands for installing tenv itself. It does document `cosign` version 2.0 or newer as a prerequisite when cosign checks are enabled. On macOS, Homebrew can install that verifier as follows.

bash
brew install cosign

This step is optional for basic tenv use unless cosign verification is required. The README also gives a Go-based Windows installation command for cosign.

bash
go install github.com/sigstore/cosign/v2/cmd/cosign@latest

Users considering verification should confirm that `cosign` is on `PATH` after installation. The README does not state that tenv fails when cosign is absent, so the presence of this prerequisite should not be interpreted as a mandatory dependency for every installation.

For a source build, the documented Makefile target retrieves dependencies, formats the Go packages, creates a `build` directory, and compiles the principal binaries. The target is named `build`.

The repository does not show the resulting usage or installation output, so the verifiable expectation is the build output under `./build/`, not a particular terminal message. The Makefile then offers a local run target that launches the central binary after building.

bash
./build/tenv

The README does not present a complete first-use sequence or identify the default version-file names and command syntax in the visible section. That omission prevents a confirmed tutorial for selecting a particular tool version without adding unsupported commands.

Checksum, PGP, and cosign Verification Paths

tenv supports checksum verification and signatures rather than treating a downloaded executable as sufficient by itself. The README states that it checks the SHA-256 checksum and can verify the checksum file's signature. Two signature paths are named: cosign when that program is available locally, and PGP through the `gopenpgp` library.

The division matters operationally. cosign is an external executable, so teams selecting that verification path must install and maintain it separately. PGP support is linked into the Go implementation through `github.com/ProtonMail/gopenpgp/v2`. The README does not describe trust roots, public-key configuration, failure behavior, key rotation, or whether signature verification is enabled by default. It would be unsafe to infer those details from the feature list.

The Go module also includes release and verification-related dependencies, while the Dockerfile builds separate executables for every supported tool. A containerized deployment must account for the tools available in the final image as well as the binaries produced by the build stage. The repository's Dockerfile starts from Alpine and installs runtime packages, but the remainder of that file is truncated, so a complete container invocation cannot be reproduced from the available repository text.

For security-conscious adoption, the first project-specific check is therefore not merely whether verification exists. It is which verifier the intended tenv path invokes, what identity or key it expects, and how a failed verification is surfaced. Those details are not fully documented in the README.

tenv Compared with asdf-vm and Separate Managers

The closest documented alternative is `asdf-vm`. Both tools attempt to reduce the difficulty of using multiple versions of command-line software, but their architecture and scope differ. According to the README, `asdf-vm` uses a generic plugin system, while tenv ships independent binaries with logic dedicated to OpenTofu, Terraform, Terragrunt, Terramate, and Atmos.

That specialization is visible in tenv's dependencies and implementation. It includes HCL parsing, semantic-version handling, tool-specific command directories, and signature verification. A plugin-based manager can offer a broader catalog of tools, but it introduces plugin selection and plugin maintenance into the workflow. tenv instead concentrates on a small family of infrastructure tools and their configuration formats.

The README also says tenv supports Linux, macOS, Windows, BSD, and Solaris, while it characterizes `asdf-vm` as natively supporting Linux and macOS. Those are claims from the tenv documentation and should be checked against the current requirements of both projects before standardizing on either approach. The repository does not include comparative measurements, so its performance wording cannot be treated as a measured result.

Maintaining separate tfenv and tofuenv installations is another alternative, but it divides related behavior across more tools. tenv can reduce that duplication for supported infrastructure CLIs. It cannot replace a generic manager when teams also need broad language and tooling coverage.

Maintenance, Library Use, and Apache-2.0 Obligations

The repository is not archived. Its last push was on 2026-10-05, and recent releases include v4.15.1 on 2026-07-24, v4.14.8 on 2026-06-10, and v4.14.7 on 2026-06-10. These facts show recent repository activity and release production, but they do not establish compatibility with every upstream tool release.

The module path is `github.com/tofuutils/tenv/v4`, and the README says the `tenvlib` wrapper package can be called as a Go module with a semantic-version compatibility promise. Source builds require Go 1.25.12 according to `go.mod`, while the Dockerfile uses `golang:1.25.12`. Library adopters must account for both the stated compatibility promise and the module's dependency graph, which includes HCL, Cobra, cryptographic, GitHub, terminal UI, and serialization packages.

tenv is licensed under Apache-2.0. That license permits broad use, modification, and distribution subject to its conditions, including preservation of applicable notices and the license text. This is not legal advice. Teams embedding `tenvlib`, distributing modified binaries, or shipping containers should review the repository `LICENSE`, notices, dependency licenses, and their own distribution policy.

Upgrade work is not limited to replacing one executable. Because tenv fronts several upstream tools and verification mechanisms, a release review should consider its compatibility with the OpenTofu, Terraform, Terragrunt, Terramate, and Atmos versions that the organization actually installs.

Editorial conclusion

tenv is a sensible choice for developers and platform engineers who need repeatable OpenTofu, Terraform, Terragrunt, Terramate, or Atmos versions without maintaining separate tfenv and tofuenv installations. It is less appropriate for teams that require a generic plugin-based version manager or organizations that cannot accommodate a separate verification policy for each managed tool. Before adoption, inspect the version-file behavior and exact command documented for the intended tools in your configuration, then confirm whether cosign or PGP verification is required in your environment.

Frequently asked questions

Which tools can tenv manage versions for?

tenv manages OpenTofu, Terraform, Terragrunt, Terramate, and Atmos versions. It also builds separate `tofu`, `terraform`, `terragrunt`, `terramate`, `tf`, and `atmos` binaries.

Can tenv read version constraints from OpenTofu or Terraform files?

Yes. The README states that tenv uses the HCL parser to extract required version constraints from OpenTofu, Terraform, and Terragrunt files.

Does tenv require cosign for every installation?

No. cosign version 2.0 or newer is required only when cosign checks are enabled. PGP verification is also supported through `gopenpgp`.

Can tenv be used as a Go library?

Yes. The README says the `tenvlib` wrapper package can be called as a Go module and carries a SemVer compatibility promise.

What is the difference between tenv and asdf-vm?

tenv is specialized for OpenTofu, Terraform, Terragrunt, Terramate, and Atmos, with HCL-aware detection and independent binaries. asdf-vm uses a generic plugin system for a broader collection of tools.

Official sources

  1. License: Apache-2.0
  2. Project website
  3. README
  4. Releases
  5. tofuutils/tenv on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/tofuutils-tenv.svg)](https://hysenlabs.com/projects/tofuutils-tenv)

Was this useful?