{"id":25195720,"url":"https://github.com/dmakeienko/tfenvgo","last_synced_at":"2026-04-13T10:01:43.529Z","repository":{"id":275921068,"uuid":"924904312","full_name":"dmakeienko/tfenvgo","owner":"dmakeienko","description":"Terraform version manager","archived":false,"fork":false,"pushed_at":"2026-04-08T08:57:33.000Z","size":192,"stargazers_count":3,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-08T10:31:29.132Z","etag":null,"topics":["devops","devops-tools","go","iac-terraform","terraform","version-manager"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dmakeienko.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-30T21:08:58.000Z","updated_at":"2026-04-08T08:57:40.000Z","dependencies_parsed_at":"2025-04-01T09:22:01.789Z","dependency_job_id":"80dcb238-21bd-4d6b-85a6-39e3d1d5e129","html_url":"https://github.com/dmakeienko/tfenvgo","commit_stats":null,"previous_names":["dmakeienko/tfenvgo"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/dmakeienko/tfenvgo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmakeienko%2Ftfenvgo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmakeienko%2Ftfenvgo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmakeienko%2Ftfenvgo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmakeienko%2Ftfenvgo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmakeienko","download_url":"https://codeload.github.com/dmakeienko/tfenvgo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmakeienko%2Ftfenvgo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31747178,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T09:16:15.125Z","status":"ssl_error","status_checked_at":"2026-04-13T09:16:05.023Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["devops","devops-tools","go","iac-terraform","terraform","version-manager"],"created_at":"2025-02-10T01:28:19.120Z","updated_at":"2026-04-13T10:01:43.521Z","avatar_url":"https://github.com/dmakeienko.png","language":"Go","readme":"# tfenvgo\n\nTerraform version manager like [tfenv](https://github.com/tfutils/tfenv) but written in Go. Now supports Opentofu!\n\n\u003e **WARNING:** This is my first project written in Go to learn it. It is inspired by `tfenv`, but is written without inspecting the source, only documentation is used.\n\n## OpenTofu support\n\n`tfenvgo` manages both **Terraform** and **OpenTofu** (`tofu`) side-by-side. Use the `--flavor` flag or the `flavor` command to switch between them.\n\n## Why use `tfenvgo` instead of `tfenv`?\n\nHere are the reasons:\n\n1. Distributed as a single binary, easy to install.\n2. `min-required` and `latest-allowed` don't have limitations as `tfenv`: `tfenvgo` uses real Go regex.\n3. Ability to work with *pre-release* Terraform versions (see `--include-prerelease` flag).\n4. `tfenvgo` is faster by around 50%.\n5. Supports opentofu out of the box\n\n## Support\n\nCurrently, `tfenvgo` supports the following OS and archs:\n\n* Linux\n  * AMD64\n  * ARM64\n* macOS\n  * AMD64\n  * ARM64\n* Windows - *Not supported and will not be*\n\n### Quickstart\n\n```sh\n# Set OpenTofu as the persistent default\ntfenvgo flavor tofu\n\n# Install and activate the latest OpenTofu release\ntfenvgo install latest\ntfenvgo use latest\n\n# Now ~/.tfenvgo/bin/tofu points to the installed binary\ntofu version\n\n# Override flavor for a single command without changing the default\ntfenvgo install latest --flavor terraform\ntfenvgo list --flavor terraform\n```\n\nBoth flavors are fully isolated — installed versions live under separate directories and have independent active-version symlinks:\n\n```text\n~/.tfenvgo/\n├── flavor                          # persisted default: \"tofu\" or \"terraform\"\n├── bin/\n│   ├── terraform -\u003e ../versions/terraform/1.5.7/terraform\n│   └── tofu      -\u003e ../versions/tofu/1.8.0/tofu\n└── versions/\n    ├── terraform/1.5.7/terraform\n    └── tofu/1.8.0/tofu\n```\n\n### Flavor resolution order\n\n1. `--flavor \u003cvalue\u003e` flag (highest priority)\n2. `TFENVGO_FLAVOR` environment variable\n3. `~/.tfenvgo/flavor` file (written by `tfenvgo flavor \u003cvalue\u003e`)\n4. `terraform` (built-in default)\n\n### tfenvgo flavor [tofu|terraform]\n\nGet or set the default binary flavor.\n\n```sh\n# Print the currently resolved flavor and where it comes from\ntfenvgo flavor\n\n# Persist \"tofu\" as the default for all future invocations\ntfenvgo flavor tofu\n\n# Switch back to terraform\ntfenvgo flavor terraform\n```\n\n## Installation\n\n### Manual\n\n1. Get the latest release: \n\n  ```sh\n  ARCH=$(uname -m); ARCH=${ARCH/x86_64/amd64}; curl -sSL \"https://github.com/dmakeienko/tfenvgo/releases/download/$(curl -s \"https://api.github.com/repos/dmakeienko/tfenvgo/releases\" | jq -r '.[].tag_name' | head -1)/tfenvgo-$(curl -s \"https://api.github.com/repos/dmakeienko/tfenvgo/releases\" | jq -r '.[].tag_name' | head -1)-$(uname -s)-$ARCH.tar.gz\" | tar xzf -\n  ```\n\nOR\n\n1.1 Download specific version:\n\n  ```sh\n  VERSION=\"vX.Y.Z\"\n  PLATFORM=$(uname -s)\n  ARCH=$(uname -m); ARCH=${ARCH/x86_64/amd64}\n\n  curl -LO https://github.com/dmakeienko/tfenvgo/releases/download/$VERSION/tfenvgo-$VERSION-$PLATFORM-$ARCH.tar.gz\n  ```\n\n1.2 Then unarchive it:\n\n  ```sh\n  tar -xvzf tfenvgo-$VERSION-$PLATFORM-$ARCH.tar.gz\n  ```\n\n\n2. Install `tfenvgo` into any location that is in your `PATH`:\n\n  ```sh\n  sudo mv tfenvgo /usr/local/bin\n  ```\n\n3. Update your shell profile:\n\n  Add the following line to your shell config file:\n\n  ```sh\n  export PATH=$PATH:$HOME/.tfenvgo/bin\n  ```\n\n  Optionally, run:\n\n  ```sh\n  tfenvgo init\n  ```\n\n  This command will precreate the `$HOME/.tfenvgo/bin` folder structure.\n\n## Usage\n\n### tfenvgo install [version]\n\nInstall a specific version of Terraform. If no parameter is passed, the version to install is resolved automatically via the **TFENVGO_TERRAFORM_VERSION** environment variable or **.terraform-version** file, in that order of precedence. If no argument is provided, it will default to the `latest`.\n\n**Available options:**\n\n* `x.y.z` - Semver 2.0.0 string specifying the exact version to install.\n* `latest` - Syntax to install the latest available *stable* version.\n* `latest-allowed` - Syntax to scan your Terraform files to detect which version is maximally allowed.\n* `min-required` - Syntax to scan your Terraform files to detect which version is minimally required.\n* `latest \"regex\"` - Syntax to install the latest version matching the regex.\n\n\u003e NOTE: because some symbols interpreted by shell as commands, use quotes (\" or ') to specify regex.\n\u003e NOTE: `latest \"regex\"` does not work with prerelease versions\n\n**Available flags:**\n\n* `--include-prerelease` - Include prerelease versions when specifying `latest`, e.g., *1.12.0-alpha20250213*, *0.12.0-rc1*, etc.\n\n**Environment variables:**\n\n* `TFENVGO_ARCH` - Specify to install the binary for a different architecture than your own.\n* `TFENVGO_OS_TYPE` - Specify to install the binary for a different OS type than your own.\n\n### tfenvgo use [version]\n\nSwitch to a specific version to use. If no parameter is passed, the version to use is resolved automatically via the **TFENVGO_TERRAFORM_VERSION** environment variable or **.terraform-version** file, in that order of precedence, defaulting to `latest` if none are found.\n\n**Available options:**\n\n* `x.y.z` - Semver 2.0.0 string specifying the exact version to use.\n* `latest` - Syntax to use the latest installed *stable* version.\n* `min-required` - Syntax to scan your Terraform files to detect which version is minimally required.\n* `latest-allowed` - Syntax to scan your Terraform files to detect which version is the latest allowed.\n* `latest \"regex\"` - Syntax to install the latest version matching the regex.\n\n\u003e NOTE: because some symbols interpreted by shell as commands, use quotes (\" or ') to specify regex.\n\u003e NOTE: `latest \"regex\"` does not work with prerelease versions\n\n### tfenvgo uninstall [version]\n\nUninstall a specific version of Terraform.\n\n**Available options:**\n\n* `x.y.z` - Semver 2.0.0 string specifying the exact version to uninstall.\n* `latest` - Syntax to uninstall the latest present version.\n* `latest \"regex\"` - Syntax to install the latest version matching the regex.\n\n\u003e NOTE: because some symbols interpreted by shell as commands, use quotes (\" or ') to specify regex.\n\u003e NOTE: `latest \"regex\"` does not work with prerelease versions\n\n**Available flags:**\n\n* `--include-prerelease` - Include prerelease versions when specifying `latest`, e.g., *1.12.0-alpha20250213*, *0.12.0-rc1*, etc.\n\n### tfenvgo list\n\nList all available Terraform versions installed locally. By default, it fetches *only stable* versions.\n\n**Available flags:**\n\n* `--include-prerelease` - Include prerelease versions, e.g., *1.12.0-alpha20250213*, *0.12.0-rc1*, etc.\n\n### tfenvgo list-remote\n\nGet all available versions of Terraform from the Hashicorp release page. By default, it fetches *only stable* versions.\n\n**Available flags:**\n\n* `--include-prerelease` - Include prerelease versions, e.g., *1.12.0-alpha20250213*, *0.12.0-rc1*, etc.\n\n### tfenvgo pin\n\nWrite the current Terraform version set by `tfenvgo` to the `.terraform-version` file.\n\n### tfenvgo version (version-name)\n\nDisplay the current Terraform version set by `tfenvgo`.\n\n## Environment variables\n\n* `TFENVGO_ARCH` - Specifies the architecture. The default architecture is defined during compilation. Override to download the Terraform binary for another architecture.\n* `TFENVGO_OS_TYPE` - Specifies the OS type. The default OS type is defined during compilation. Override to download the Terraform binary for another OS.\n* `TFENVGO_TERRAFORM_VERSION` - If not an empty string, this variable overrides the Terraform version provided by the `.terraform-version` file and commands `tfenvgo install`, `tfenvgo use`.\n\n## .terraform-version file\n\nIf you put a `.terraform-version` file in your project root, `tfenvgo` detects it and uses the version written in it. If the version is `latest` or `latest: \"regex\"`, the latest matching version will be selected.\n\n\u003e **NOTE:** The `TFENVGO_TERRAFORM_VERSION` environment variable can be used to override the version specified by the `.terraform-version` file.\n\nFor `tfenvgo` to be able to detect the `.terraform-version` file, add the provided shell hook to your shell config (`.zshrc` or `.bashrc`):\n\n```sh\ncd() {\n  builtin cd \"$@\" || return\n\n  if [ -f \".terraform-version\" ]; then\n    tfenvgo use\n  fi\n}\n```\n\n## SemVer evaluation\n\n`tfenvgo` uses [SemVer package](https://github.com/Masterminds/semver) to parse, sort and evaluate constraints.\n\n### Hyphen Range Comparisons\n\nThere are multiple methods to handle ranges and the first is hyphens ranges. These look like:\n\n```sh\n1.2 - 1.4.5 which is equivalent to \u003e= 1.2 \u003c= 1.4.5\n2.3.4 - 4.5 which is equivalent to \u003e= 2.3.4 \u003c= 4.5\n```\n\n\u003eNOTE: 1.2-1.4.5 without whitespace is parsed completely differently; it's parsed as a single constraint 1.2.0 with prerelease 1.4.5.\n\n### Wildcards In Comparisons\n\nThe x, X, and * characters can be used as a wildcard character. This works for all comparison operators. When used on the = operator it falls back to the patch level comparison (see tilde below). For example,\n\n```sh\n1.2.x is equivalent to \u003e= 1.2.0, \u003c 1.3.0\n\u003e= 1.2.x is equivalent to \u003e= 1.2.0\n\u003c= 2.x is equivalent to \u003c 3\n* is equivalent to \u003e= 0.0.0\n```\n\n### Tilde Range Comparisons (Patch)\n\nThe tilde (~) comparison operator is for patch level ranges when a minor version is specified and major level changes when the minor number is missing. For example,\n\n```sh\n~1.2.3 is equivalent to \u003e= 1.2.3, \u003c 1.3.0\n~1 is equivalent to \u003e= 1, \u003c 2\n~2.3 is equivalent to \u003e= 2.3, \u003c 2.4\n~1.2.x is equivalent to \u003e= 1.2.0, \u003c 1.3.0\n~1.x is equivalent to \u003e= 1, \u003c 2\n```\n\n### Caret Range Comparisons (Major)\n\nThe caret (^) comparison operator is for major level changes once a stable (1.0.0) release has occurred. Prior to a 1.0.0 release the minor versions acts as the API stability level. This is useful when comparisons of API versions as a major change is API breaking. For example,\n\n```sh\n^1.2.3 is equivalent to \u003e= 1.2.3, \u003c 2.0.0\n^1.2.x is equivalent to \u003e= 1.2.0, \u003c 2.0.0\n^2.3 is equivalent to \u003e= 2.3, \u003c 3\n^2.x is equivalent to \u003e= 2.0.0, \u003c 3\n^0.2.3 is equivalent to \u003e=0.2.3 \u003c0.3.0\n^0.2 is equivalent to \u003e=0.2.0 \u003c0.3.0\n^0.0.3 is equivalent to \u003e=0.0.3 \u003c0.0.4\n^0.0 is equivalent to \u003e=0.0.0 \u003c0.1.0\n^0 is equivalent to \u003e=0.0.0 \u003c1.0.0\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmakeienko%2Ftfenvgo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmakeienko%2Ftfenvgo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmakeienko%2Ftfenvgo/lists"}