{"id":13505890,"url":"https://github.com/tofuutils/tofuenv","last_synced_at":"2025-05-16T07:06:45.504Z","repository":{"id":214240835,"uuid":"736036811","full_name":"tofuutils/tofuenv","owner":"tofuutils","description":"OpenTofu version manager","archived":false,"fork":false,"pushed_at":"2024-10-16T20:29:22.000Z","size":651,"stargazers_count":181,"open_issues_count":15,"forks_count":5,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-08T18:19:56.906Z","etag":null,"topics":["bash","hacktoberfest","hacktoberfest2024","hashicorp","hashicorp-terraform","iac","opentofu","tenv","terraform","tfenv","tofuenv"],"latest_commit_sha":null,"homepage":"https://tofuutils.github.io/tofuenv/","language":"Shell","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/tofuutils.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"contributing/changelog-process.md","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}},"created_at":"2023-12-26T20:00:06.000Z","updated_at":"2025-04-01T06:50:03.000Z","dependencies_parsed_at":"2024-01-10T22:46:10.921Z","dependency_job_id":"9a75ee4d-a600-45e6-9e7b-f6e9b36cd5ac","html_url":"https://github.com/tofuutils/tofuenv","commit_stats":{"total_commits":475,"total_committers":97,"mean_commits":4.896907216494846,"dds":0.8063157894736842,"last_synced_commit":"f22b4abb5dda8351a7aae667d61b4c2c750cc1aa"},"previous_names":["opentofuutils/tofuenv","tofuutils/tofuenv"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tofuutils%2Ftofuenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tofuutils%2Ftofuenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tofuutils%2Ftofuenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tofuutils%2Ftofuenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tofuutils","download_url":"https://codeload.github.com/tofuutils/tofuenv/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254485066,"owners_count":22078767,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["bash","hacktoberfest","hacktoberfest2024","hashicorp","hashicorp-terraform","iac","opentofu","tenv","terraform","tfenv","tofuenv"],"created_at":"2024-08-01T00:01:16.360Z","updated_at":"2025-05-16T07:06:40.494Z","avatar_url":"https://github.com/tofuutils.png","language":"Shell","readme":"\u003c!-- BADGES --\u003e\n[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/8816/badge)](https://www.bestpractices.dev/projects/8816) [![Github release](https://img.shields.io/github/v/release/tofuutils/tofuenv)](https://github.com/tofuutils/tofuenv/releases) [![Contributors](https://img.shields.io/github/contributors/tofuutils/tofuenv)](https://github.com/tofuutils/tofuenv/graphs/contributors) ![maintenance status](https://img.shields.io/maintenance/yes/2024.svg)\n\n\u003ch1 align=\"center\"\u003etofuenv\u003c/h1\u003e\n\n\u003ch3 align=\"center\"\u003e \u003ca href=\"https://opentofu.org/\"\u003eOpenTofu\u003c/a\u003e version manager inspired by \u003ca href=\"https://github.com/tfutils/tfenv\"\u003etfenv\u003c/a\u003e \u003c/h3\u003e\n\n### Table of Content\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"#important-notice\"\u003eImportant Notice\u003c/a\u003e •\n  \u003ca href=\"#supported-os\"\u003eSupported OS\u003c/a\u003e •\n  \u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e •\n  \u003ca href=\"#install-dependencies\"\u003eInstall dependencies\u003c/a\u003e •\n  \u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e •\n  \u003ca href=\"#environment-variables\"\u003eEnvironment Variables\u003c/a\u003e •\n  \u003ca href=\"#upgrading\"\u003eUpgrading\u003c/a\u003e •\n  \u003ca href=\"#uninstalling\"\u003eUninstalling\u003c/a\u003e •\n  \u003ca href=\"#contributing\"\u003eContributing\u003c/a\u003e •\n  \u003ca href=\"#community\"\u003eCommunity\u003c/a\u003e •\n  \u003ca href=\"#authors\"\u003eAuthors\u003c/a\u003e •\n  \u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\n\u003c/div\u003e\n\n### Important Notice\nMany people have asked about Terraform support, and we are finally ready to announce a successor for **tfenv** and **tofuenv**: \u003ca href=\"https://github.com/tofuutils/tenv\"\u003etenv \u003c/a\u003e 🚀 written in Golang. tenv is able to handle Terraform binaries as well as OpenTofu binaries. 🎉\n\nPlease contribute to \u003ca href=\"https://github.com/tofuutils/tenv\"\u003etenv \u003c/a\u003e and award us stars⭐.\n\n## Supported OS\n\nCurrently, **tofuenv** supports the following operating systems:\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003cb\u003emacOS\u003c/b\u003e\u003c/summary\u003e\n  \u003cul\u003e\n    \u003cli\u003e64bit\u003c/li\u003e\n    \u003cli\u003eArm (Apple Silicon)\u003c/li\u003e\n  \u003c/ul\u003e\n\u003c/details\u003e\n\u003cdetails\u003e\n  \u003csummary\u003e\u003cb\u003eLinux\u003c/b\u003e\u003c/summary\u003e\n  \u003cul\u003e\n    \u003cli\u003e64bit\u003c/li\u003e\n    \u003cli\u003eArm\u003c/li\u003e\n  \u003c/ul\u003e\n\u003c/details\u003e\n\u003cdetails\u003e\n  \u003csummary\u003e\u003cb\u003eWindows\u003c/b\u003e (Only tested in git-bash - currently presumed failing due to symlink issues in git-bash)\u003c/summary\u003e \n  \u003cul\u003e\n    \u003cli\u003e64bit\u003c/li\u003e\n  \u003c/ul\u003e\n\u003c/details\u003e\n\n\n## Installation\n\n### Automatic\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eInstall via Homebrew\u003c/b\u003e\u003c/summary\u003e\n\n  ```console\n    brew tap tofuutils/tap\n    brew install tofuenv\n  ```  \n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eInstall via Arch User Repository (AUR)\u003c/b\u003e\u003c/summary\u003e\n\n```console\ngit clone https://aur.archlinux.org/tofuenv.git\ncd tofuenv\nmakepkg -si\n```\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eInstall via Arch User Repository (AUR) via yay\u003c/b\u003e\u003c/summary\u003e\n   \n```console\nyay --sync tofuenv\n```\n\u003c/details\u003e\n\n### Manual\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eLinux and MacOS\u003c/b\u003e\u003c/summary\u003e\n  \n1. Check out tofuenv into any path (here is `${HOME}/.tofuenv`)\n\n```console\ngit clone --depth=1 https://github.com/tofuutils/tofuenv.git ~/.tofuenv\n```\n\n2. Add `~/.tofuenv/bin` to your `$PATH` any way you like\n\nbash:\n```console\necho 'export PATH=\"$HOME/.tofuenv/bin:$PATH\"' \u003e\u003e ~/.bash_profile\n```\nzsh:\n```console\n$ echo 'export PATH=\"$HOME/.tofuenv/bin:$PATH\"' \u003e\u003e ~/.zprofile\n```\n\nFor WSL users:\n```bash\necho 'export PATH=$PATH:$HOME/.tofuenv/bin' \u003e\u003e ~/.bashrc\n```\n\n  OR you can make symlinks for `tofuenv/bin/*` scripts into a path that is already added to your `$PATH` (e.g. `/usr/local/bin`) `OSX/Linux Only!`\n\n```console\nln -s ~/.tofuenv/bin/* /usr/local/bin\n```\n\n  On Ubuntu/Debian touching `/usr/local/bin` might require sudo access, but you can create `${HOME}/bin` or `${HOME}/.local/bin` and on next login it will get added to the session `$PATH`\n  or by running `. ${HOME}/.profile` it will get added to the current shell session's `$PATH`.\n\n```console\nmkdir -p ~/.local/bin/\n. ~/.profile\nln -s ~/.tofuenv/bin/* ~/.local/bin\nwhich tofuenv\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eWindows\u003c/b\u003e\u003c/summary\u003e\n  \n1. Install Git-Bash\n```console\nwinget install --id Git.Git -e --source winget\n```\n\n2. Launch git-bash environment, execute (keep the quotes):\n```console\n\"C:\\Program Files\\Git\\bin\\sh.exe\"\n```\n\n3. Check out tofuenv into any path (here is ${HOME}/.tofuenv)\n```console\ngit clone --depth=1 https://github.com/tofuutils/tofuenv.git ~/.tofuenv\n```\n\n4. Add ~/.tofuenv/bin to your $PATH\n```console\necho 'export PATH=$PATH:$HOME/.tofuenv/bin' \u003e\u003e ~/.bashrc\n```\n\n5. Relaunch git-bash environment for the changes to be applied (you can do it via ```exit``` command).\n\n6. Verify installation by executing:\n```console\nwhich tofuenv\n```\n\n\u003c/details\u003e\n\n## Install dependencies\n\nInstall **jq** (required) and **GnuPG** (optional, in case you want to enable GPG verification during OpenTofu installation)\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eMacOs\u003c/b\u003e\u003c/summary\u003e\n  \n```console\nbrew install jq gnupg grep\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eLinux\u003c/b\u003e\u003c/summary\u003e\n  \n```console\nsudo apt-get update -y\nsudo apt-get install -y jq gnupg\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eWindows\u003c/b\u003e (git-bash)\u003c/summary\u003e\nInstall jq package into git-bash default installation folder:\n  \n```console\ncurl -L -o /usr/bin/jq.exe https://github.com/jqlang/jq/releases/latest/download/jq-win64.exe\n```\n\u003c/details\u003e\n\n## Usage\n\n### tofuenv install [version]\n\nInstall a specific version of OpenTofu.\n\nIf no parameter is passed, the version to use is resolved automatically via [TOFUENV_TOFU_VERSION environment variable](#TOFUENV_TOFU_VERSION) or [.opentofu-version files](#opentofu-version-file), in that order of precedence, i.e. TOFUENV_TOFU_VERSION, then .opentofu-version. The default is `latest` if none are found.\n\nIf a parameter is passed, available options:\n\n- `x.y.z` [Semver 2.0.0](https://semver.org/) string specifying the exact version to install\n- `latest:\u003cregex\u003e` is a syntax to install latest version matching regex (used by grep -e)\n- `latest-allowed` is a syntax to scan your OpenTofu files to detect which version is maximally allowed.\n- `min-required` is a syntax to scan your OpenTofu files to detect which version is minimally required.\n\nOptions will be available after first stable release:\n\n- `latest` is a syntax to install latest stable version\n\nSee [required_version](https://developer.hashicorp.com/terraform/language/settings) docs. Also [see min-required \u0026 latest-allowed](#min-required) section below.\n\n```console\n$ tofuenv install 1.6.0-rc1 \n$ tofuenv install latest:^1.6\n$ tofuenv install latest-allowed\n$ tofuenv install min-required\n```\n\nIf `shasum` is present in the path, tofuenv will verify the download against OpenTofu published sha256 hash.\n\nYou can opt-in to using GnuPG tools for GPG signature verification:\n\n\n```console\necho 'trust-tofuenv: yes' \u003e ${TOFUENV_INSTALL_DIR}/use-gpgv\ntofuenv install\n```\nWhere `TOFUENV_INSTALL_DIR` is for example, `~/tofuenv` or `/opt/homebrew/Cellar/tofuenv/\u003cversion\u003e`\n\nThe `trust-tofuenv` directive means that verification uses a copy of the\nOpenTofu GPG key found in the tofuenv repository. Skipping that directive\nmeans that the OpenTofu key must be in the existing default trusted keys.\nUse the file `${TOFUENV_INSTALL_DIR}/use-gnupg` to instead invoke the full `gpg` tool and\nsee web-of-trust status; beware that a lack of trust path will not cause a\nvalidation failure.\nDefault `gpg/gpgv` command can be overridden by adding `binary` directive to `use-gpgv`/`use-gnupg` file, ex.:\n```console\necho 'binary: gpgv --keyring ./path/to/gpg/opentofu.gpg' \u003e ${TOFUENV_INSTALL_DIR}/use-gpgv\ntofuenv install\n```\n\nFor now keybase tool GPG signature verification is not supported by OpenTofu. This verification mechanism will be added after support is added by OpenTofu.\n\n#### .opentofu-version\n\nIf you use a [.opentofu-version](#opentofu-version-file) file, `tofuenv install` (no argument) will install the version written in it.\n\n\u003ca name=\"min-required\"\u003e\u003c/a\u003e\n#### min-required \u0026 latest-allowed\n\nPlease note that we don't do semantic version range parsing but use first ever found version as the candidate for minimally required one. It is up to the user to keep the definition reasonable. I.e.\n\n```terraform\n// this will detect 0.12.3\nterraform {\n  required_version  = \"\u003c0.12.3, \u003e= 0.10.0\"\n}\n```\n\n```terraform\n// this will detect 0.10.8 (the latest 0.10.x release)\nterraform {\n  required_version  = \"~\u003e 0.10.0, \u003c0.12.3\"\n}\n```\n\n## Environment Variables\n\n### TOFUENV\n\n\u003cdetails id=\"TOFUENV_GITHUB_TOKEN\"\u003e\u003csummary\u003e\u003cb\u003eTOFUENV_GITHUB_TOKEN\u003c/b\u003e\u003c/summary\u003e\u003cbr\u003e\n  \nString (Default: \"\")\n\nSpecify GitHub token. Because of OpenTofu binares placed in the GitHub you may encounter with rate limit problem.\nUsing a personal access token dramatically increases rate limit.\n[GitHub Rate limits for the REST API](https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api)\n\u003c/details\u003e\n\n\u003cdetails id=\"TOFUENV_ARCH\"\u003e\u003csummary\u003e\u003cb\u003eTOFUENV_ARCH\u003c/b\u003e\u003c/summary\u003e\u003cbr\u003e\n  \nString (Default: `amd64`)\n\nSpecify architecture. Architecture other than the default amd64 can be specified with the `TOFUENV_ARCH` environment variable\n\nNote: Default changes to `arm64` for versions that have arm64 builds available when `$(uname -m)` matches `aarch64* | arm64*`\n\n```console\nTOFUENV_ARCH=arm64 tofuenv install 0.7.9\n```\n\u003c/details\u003e\n\n\u003cdetails id=\"TOFUENV_AUTO_INSTALL\"\u003e\u003csummary\u003e\u003cb\u003eTOFUENV_AUTO_INSTALL\u003c/b\u003e\u003c/summary\u003e\u003cbr\u003e\n  \nString (Default: true)\n\nShould tofuenv automatically install tofu if the version specified by defaults or a .opentofu-version file is not currently installed.\n\nExample: if auto installation is enabled, the version will be installed.\n```console\nTOFUENV_AUTO_INSTALL=true tofu use \u003cversion that is not yet installed\u003e\n```\n\nExample: use 1.6.0-beta3 version that is not installed, and auto installation is disabled.\n```console\n$ TOFUENV_AUTO_INSTALL=false tofuenv use 1.6.0-beta3\nNo installed versions of opentofu matched '^1.6.0-beta3$'. TOFUENV_AUTO_INSTALL is set to false, so exiting.\n```\n\u003c/details\u003e\n\n\u003cdetails id=\"TOFUENV_CURL_OUTPUT\"\u003e\u003csummary\u003e\u003cb\u003eTOFUENV_CURL_OUTPUT\u003c/b\u003e\u003c/summary\u003e\u003cbr\u003e\n\nInteger (Default: 2)\n\nSet the mechanism used for displaying download progress when downloading tofu versions from the remote server.\n\n* 2: v1 Behaviour: Pass `-#` to curl\n* 1: Use curl default\n* 0: Pass `-s` to curl\n\u003c/details\u003e\n\n\u003cdetails id=\"TOFUENV_DEBUG\"\u003e\u003csummary\u003e\u003cb\u003eTOFUENV_DEBUG\u003c/b\u003e\u003c/summary\u003e\u003cbr\u003e\n\nInteger (Default: 0)\n\nSet the debug level for tofuenv.\n\n* 0: No debug output\n* 1: Simple debug output\n* 2: Extended debug output, with source file names and interactive debug shells on error\n* 3: Debug level 2 + Bash execution tracing\n\u003c/details\u003e\n\n\u003cdetails id=\"TOFUENV_REMOTE\"\u003e\u003csummary\u003e\u003cb\u003eTOFUENV_REMOTE\u003c/b\u003e\u003c/summary\u003e\u003cbr\u003e\n\nString (Default: https://github.com/opentofu/opentofu/releases)\n\nTo install from a remote other than the default\n\n```console\nTOFUENV_REMOTE=https://example.jfrog.io/artifactory/opentofu\n```\n\u003c/details\u003e\n\n\u003cdetails id=\"TOFUENV_REVERSE_REMOTE\"\u003e\u003csummary\u003e\u003cb\u003eTOFUENV_REVERSE_REMOTE\u003c/b\u003e\u003c/summary\u003e\u003cbr\u003e\n\nInteger (Default: 0)\n\nWhen using a custom remote, such as Artifactory, instead of the OpenTofu servers,\nthe list of tofu versions returned by the curl of the remote directory may be inverted.\nIn this case the `latest` functionality will not work as expected because it expects the\nversions to be listed in order of release date from newest to oldest. If your remote\nis instead providing a list that is oldes-first, set `TOFUENV_REVERSE_REMOTE=1` and\nfunctionality will be restored.\n\n```console\nTOFUENV_REVERSE_REMOTE=1 tofuenv list-remote\n```\n\u003c/details\u003e\n\n\u003cdetails id=\"TOFUENV_SKIP_LIST_REMOTE\"\u003e\u003csummary\u003e\u003cb\u003eTOFUENV_SKIP_LIST_REMOTE\u003c/b\u003e\u003c/summary\u003e\u003cbr\u003e\n\nInteger (Default: 0)\n\nSkip list remote versions in installation step. Can be useful for a custom remote, such as Artifactory.\n\nDisabled: 0\nEnable: any other value\n\n```console\nTOFUENV_SKIP_LIST_REMOTE=1 tofuenv install 1.6.0-rc1\n```\n\u003c/details\u003e\n\n\u003cdetails id=\"TOFUENV_CONFIG_DIR\"\u003e\u003csummary\u003e\u003cb\u003eTOFUENV_CONFIG_DIR\u003c/b\u003e\u003c/summary\u003e\u003cbr\u003e\n\nPath (Default: `$TOFUENV_ROOT`)\n\nThe path to a directory where the local tofu versions and configuration files exist.\n\n```console\nTOFUENV_CONFIG_DIR=\"$XDG_CONFIG_HOME/tofuenv\"\n```\n\u003c/details\u003e\n\n\u003cdetails id=\"TOFUENV_TOFU_VERSION\"\u003e\u003csummary\u003e\u003cb\u003eTOFUENV_TOFU_VERSION\u003c/b\u003e\u003c/summary\u003e\u003cbr\u003e\n\nString (Default: \"\")\n\nIf not empty string, this variable overrides OpenTofu version, specified in [.opentofu-version files](#opentofu-version-file).\n`latest` and `latest:\u003cregex\u003e` syntax are also supported.\n[`tofuenv install`](#tofuenv-install-version) and [`tofuenv use`](#tofuenv-use-version) command also respects this variable.\n\ne.g.\n\n```console\nTOFUENV_TOFU_VERSION=latest:^0.11. tofu --version\n```\n\u003c/details\u003e\n\n\u003cdetails id=\"TOFUENV_NETRC_PATH\"\u003e\u003csummary\u003e\u003cb\u003eTOFUENV_NETRC_PATH\u003c/b\u003e\u003c/summary\u003e\u003cbr\u003e\n\nString (Default: \"\")\n\nIf not empty string, this variable specifies the credentials file used to access the remote location (useful if used in conjunction with TOFUENV_REMOTE).\n\ne.g.\n\n```console\nTOFUENV_NETRC_PATH=\"$PWD/.netrc.tofuenv\"\n```\n\u003c/details\u003e\n\n---\n\n### Bashlog Logging Library\n\n\u003cdetails id=\"BASHLOG_COLOURS\"\u003e\u003csummary\u003e\u003cb\u003eBASHLOG_COLOURS\u003c/b\u003e\u003c/summary\u003e\u003cbr\u003e\n\nInteger (Default: 1)\n\nTo disable colouring of console output, set to 0.\n\u003c/details\u003e\n\n\u003cdetails id=\"BASHLOG_DATE_FORMAT\"\u003e\u003csummary\u003e\u003cb\u003eBASHLOG_DATE_FORMAT\u003c/b\u003e\u003c/summary\u003e\u003cbr\u003e\n\nString (Default: +%F %T)\n\nThe display format for the date as passed to the `date` binary to generate a datestamp used as a prefix to:\n\n* `FILE` type log file lines.\n* Each console output line when `BASHLOG_EXTRA=1`\n\u003c/details\u003e\n\n\u003cdetails id=\"BASHLOG_EXTRA\"\u003e\u003csummary\u003e\u003cb\u003eBASHLOG_EXTRA\u003c/b\u003e\u003c/summary\u003e\u003cbr\u003e\n\nInteger (Default: 0)\n\nBy default, console output from tofuenv does not print a date stamp or log severity.\n\nTo enable this functionality, making normal output equivalent to FILE log output, set to 1.\n\u003c/details\u003e\n\n\u003cdetails id=\"BASHLOG_FILE\"\u003e\u003csummary\u003e\u003cb\u003eBASHLOG_FILE\u003c/b\u003e\u003c/summary\u003e\u003cbr\u003e\n\nInteger (Default: 0)\n\nSet to 1 to enable plain text logging to file (FILE type logging).\n\nThe default path for log files is defined by /tmp/$(basename $0).log\nEach executable logs to its own file.\n\ne.g.\n\n```console\nBASHLOG_FILE=1 tofuenv use latest\n```\n\nwill log to `/tmp/tofuenv-use.log`\n\u003c/details\u003e\n\n\u003cdetails id=\"BASHLOG_FILE_PATH\"\u003e\u003csummary\u003e\u003cb\u003eBASHLOG_FILE_PATH\u003c/b\u003e\u003c/summary\u003e\u003cbr\u003e\n\nString (Default: /tmp/$(basename ${0}).log)\n\nTo specify a single file as the target for all FILE type logging regardless of the executing script.\n\u003c/details\u003e\n\n\u003cdetails id=\"BASHLOG_I_PROMISE_TO_BE_CAREFUL_CUSTOM_EVAL_PREFIX\"\u003e\u003csummary\u003e\u003cb\u003eBASHLOG_I_PROMISE_TO_BE_CAREFUL_CUSTOM_EVAL_PREFIX\u003c/b\u003e\u003c/summary\u003e\u003cbr\u003e\n\nString (Default: \"\")\n\n*BE CAREFUL - MISUSE WILL DESTROY EVERYTHING YOU EVER LOVED*\n\nThis variable allows you to pass a string containing a command that will be executed using `eval` in order to produce a prefix to each console output line, and each FILE type log entry.\n\ne.g.\n\n```console\nBASHLOG_I_PROMISE_TO_BE_CAREFUL_CUSTOM_EVAL_PREFIX='echo \"${$$} \"'\n```\nwill prefix every log line with the calling process' PID.\n\u003c/details\u003e\n\n\u003cdetails id=\"BASHLOG_JSON\"\u003e\u003csummary\u003e\u003cb\u003eBASHLOG_JSON\u003c/b\u003e\u003c/summary\u003e\u003cbr\u003e\n\nInteger (Default: 0)\n\nSet to 1 to enable JSON logging to file (JSON type logging).\n\nThe default path for log files is defined by /tmp/$(basename $0).log.json\nEach executable logs to its own file.\n\ne.g.\n\n```console\nBASHLOG_JSON=1 tofuenv use latest\n```\n\nwill log in JSON format to `/tmp/tofuenv-use.log.json`\n\nJSON log content:\n\n`{\"timestamp\":\"\u003cdate +%s\u003e\",\"level\":\"\u003clog-level\u003e\",\"message\":\"\u003clog-content\u003e\"}`\n\u003c/details\u003e\n\n\u003cdetails  id=\"BASHLOG_JSON_PATH\"\u003e\u003csummary\u003e\u003cb\u003eBASHLOG_JSON_PATH\u003c/b\u003e\u003c/summary\u003e\u003cbr\u003e\n\nString (Default: /tmp/$(basename ${0}).log.json)\n\nTo specify a single file as the target for all JSON type logging regardless of the executing script.\n\u003c/details\u003e\n\n\u003cdetails id=\"BASHLOG_SYSLOG\"\u003e\u003csummary\u003e\u003cb\u003eBASHLOG_SYSLOG\u003c/b\u003e\u003c/summary\u003e\u003cbr\u003e\n\nInteger (Default: 0)\n\nTo log to syslog using the `logger` binary, set this to 1.\n\nThe basic functionality is thus:\n\n```console\nlocal tag=\"${BASHLOG_SYSLOG_TAG:-$(basename \"${0}\")}\";\nlocal facility=\"${BASHLOG_SYSLOG_FACILITY:-local0}\";\nlocal pid=\"${$}\";\nlogger --id=\"${pid}\" -t \"${tag}\" -p \"${facility}.${severity}\" \"${syslog_line}\"\n```\n\u003c/details\u003e\n\n\u003cdetails id=\"BASHLOG_SYSLOG_FACILITY\"\u003e\u003csummary\u003e\u003cb\u003eBASHLOG_SYSLOG_FACILITY\u003c/b\u003e\u003c/summary\u003e\u003cbr\u003e\n\nString (Default: local0)\n\nThe syslog facility to specify when using SYSLOG type logging.\n\u003c/details\u003e\n\n\u003cdetails id=\"BASHLOG_SYSLOG_TAG\"\u003e\u003csummary\u003e\u003cb\u003eBASHLOG_SYSLOG_TAG\u003c/b\u003e\u003c/summary\u003e\u003cbr\u003e\n\nString (Default: $(basename $0))\n\nThe syslog tag to specify when using SYSLOG type logging.\n\nDefaults to the PID of the calling process.\n\u003c/details\u003e\n\n---\n\n### tofuenv use [version]\n\nSwitch a version to use\n\nIf no parameter is passed, the version to use is resolved automatically via [.opentofu-version files](#opentofu-version-file) or [TOFUENV_TOFU_VERSION environment variable](#TOFUENV_TOFU_VERSION) (TOFUENV_TOFU_VERSION takes precedence), defaulting to 'latest' if none are found.\n\n`latest` is a syntax to use the latest installed stable version\nNOTE: `latest` syntax will be available after first stable OpenTofu release\n`latest:\u003cregex\u003e` is a syntax to use latest installed version matching regex (used by grep -e)\n`min-required` will switch to the version minimally required by your tofu sources (see above `tofuenv install`)\n`latest-allowed` will switch to the version maximally allowed by your tofu sources (see above `tofuenv install`).\n\n```console\n$ tofuenv use\n$ tofuenv use min-required\n$ tofuenv use 0.7.0\n$ tofuenv use latest\n$ tofuenv use latest:^0.8\n$ tofuenv use latest-allowed\n```\n\nNote: `tofuenv use latest` or `tofuenv use latest:\u003cregex\u003e` will find the latest matching version that is already installed. If no matching versions are installed, and TOFUENV_AUTO_INSTALL is set to `true` (which is the default) the latest matching version in the remote repository will be installed and used.\n\n### tofuenv uninstall \u0026lt;version\u003e\n\nUninstall a specific version of OpenTofu\n`latest` is a syntax to uninstall latest version\n`latest:\u003cregex\u003e` is a syntax to uninstall latest version matching regex (used by grep -e)\n\n```console\n$ tofuenv uninstall 0.7.0\n$ tofuenv uninstall latest\n$ tofuenv uninstall latest:^0.8\n```\n\n### tofuenv list\n\nList installed versions\n\n```console\n$ tofuenv list\n  1.6.0-alpha5\n* 1.6.0-rc1 (set by /opt/.tofuenv/version)\n```\n\n### tofuenv list-remote\n\nList installable versions\n\n```console\n$ tofuenv list-remote\n1.6.0-rc1\n1.6.0-beta5\n1.6.0-beta4\n1.6.0-beta3\n1.6.0-beta2\n1.6.0-beta1\n1.6.0-alpha5\n1.6.0-alpha4\n1.6.0-alpha3\n1.6.0-alpha2\n1.6.0-alpha1\n...\n```\n\n### tofuenv version-name\nPrints the version of OpenTofu, used in the current directory.\nThe version is resolved automatically via [TOFUENV_TOFU_VERSION environment variable](#TOFUENV_TOFU_VERSION) or [.opentofu-version files](#opentofu-version-file), in that order of precedence, i.e. TOFUENV_TOFU_VERSION, then .opentofu-version.\n```console\n$ tofuenv version-name\n1.6.0\n```\n\n### tofuenv pin\nWrites the current active OpenTofu version to ./.opentofu-version file (creates if no file exists).\n```console\n$ tofuenv pin\nPinned version by writing \"1.6.0\" to /Users/anastasiiakozlova/coding/opensource/tofuenv/.opentofu-version\n$ cat .opentofu-version\n1.6.0\n```\n\n#### .opentofu-version file\n\nIf you put a `.opentofu-version` file on your project root, or in your home directory (automatically using `tofuenv pin` command or manually), tofuenv detects it and uses the version written in it. If the version is `latest` or `latest:\u003cregex\u003e`, the latest matching version currently installed will be selected.\n\nNote, that [TOFUENV_TOFU_VERSION environment variable](#TOFUENV_TOFU_VERSION) can be used to override version, specified by `.opentofu-version` file.\n\n```console\n$ cat .opentofu-version\n1.6.0-beta5\n\n$ tofu version\nOpenTofu v1.6.0-beta5\non darwin_amd64\n\n$ echo 1.6.0-alpha5 \u003e .opentofu-version\n\n$ tofu version\nOpenTofu v1.6.0-alpha5\non darwin_amd64\n\n$ echo latest:^1.6 \u003e .opentofu-version\n\n$ tofu version\nOpenTofu v1.6.0-rc1\non darwin_amd64\n\n$ TOFUENV_TOFU_VERSION=1.6.0-alpha1 tofu --version\ntofu v1.6.0-alpha1\non darwin_amd64\n```\n\n## Upgrading\n\n```console\ngit --git-dir=~/.tofuenv/.git pull\n```\n\n## Uninstalling\n\n```console\nrm -rf /some/path/to/tofuenv\n```\n\n## Contributing\n\nContributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.\n\nCheck out our [contributing guide](CONTRIBUTING.md) to get started.\n\nDon't forget to give the project a star! Thanks again!\n\n## Community\nHave questions or suggestions? Reach out to us via:\n\n* [GitHub Issues](https://github.com/tofuutils/tofuenv/issues)\n* User/Developer Group: Join github community to get update of Harbor's news, features, releases, or to provide suggestion and feedback.\n* Slack: Join tofuutils's community for discussion and ask questions: OpenTofu, channel: #tofuutils\n\n## Authors\n This project was made possible by the help of these awesome contributors:\n\u003ca href=\"https://github.com/tofuutils/tofuenv/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=tofuutils/tofuenv\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://star-history.com/#tofuutils/tofuenv\u0026Date\"\u003e\n  \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/svg?repos=tofuutils/tofuenv\u0026type=Date\u0026theme=dark\" /\u003e\n    \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/svg?repos=tofuutils/tofuenv\u0026type=Date\" /\u003e\n    \u003cimg alt=\"Star History Chart\" src=\"https://api.star-history.com/svg?repos=tofuutils/pre-commit-opentofu\u0026type=Date\" /\u003e\n  \u003c/picture\u003e\n\u003c/a\u003e\n\n## LICENSE\n\n- [tofuenv itself](https://github.com/tofuutils/tofuenv/blob/main/LICENSE)\n- [tfenv](https://github.com/tfutils/tfenv/blob/master/LICENSE)\n  - tofuenv uses tfenv's source code\n- [rbenv](https://github.com/rbenv/rbenv/blob/master/LICENSE)\n  - tfenv partially uses rbenv's source code\n","funding_links":[],"categories":["Tools","Version Managers","Shell"],"sub_categories":["Environment managers","OpenTofu","Community providers"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftofuutils%2Ftofuenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftofuutils%2Ftofuenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftofuutils%2Ftofuenv/lists"}