tfutils / tfenv
Terraform version manager
AI Architecture Analysis
This repository is indexed by RepoMind. By analyzing tfutils/tfenv in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.
Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.
Repository Overview (README excerpt)
Crawler viewtfenv Terraform version manager inspired by rbenv Support Currently tfenv supports the following OSes • macOS • 64bit • Arm (Apple Silicon) • Linux • 64bit • Arm • Windows (64bit) - only tested in git-bash - currently presumed failing due to symlink issues in git-bash Installation Automatic Install via Homebrew Install via Arch User Repository (AUR) Install via puppet Using puppet module sergk-tfenv Manual • Check out tfenv into any path (here is ) • Add to your any way you like bash: zsh: fish: For WSL users: OR you can make symlinks for scripts into a path that is already added to your (e.g. ) On Ubuntu/Debian touching might require sudo access, but you can create or and on next login it will get added to the session or by running it will get added to the current shell session's . Usage tfenv install [version] Install a specific version of Terraform. If no parameter is passed, the version to use is resolved automatically via TFENV\_TERRAFORM\_VERSION environment variable or .terraform-version files, in that order of precedence, i.e. TFENV\_TERRAFORM\_VERSION, then .terraform-version. The default is 'latest' if none are found. If a parameter is passed, available options: • Semver 2.0.0 string specifying the exact version to install • is a syntax to install latest version • is a syntax to install latest version matching regex (used by grep -e) • is a syntax to scan your Terraform files to detect which version is maximally allowed. • is a syntax to scan your Terraform files to detect which version is minimally required. See required_version docs. Also see min-required & latest-allowed section below. If is present in the path, tfenv will verify the download against Hashicorp's published sha256 hash. If keybase is available in the path it will also verify the signature for those published hashes using Hashicorp's published public key. You can opt-in to using GnuPG tools for PGP signature verification if keybase is not available: Where is for example, or The directive means that verification uses a copy of the Hashicorp OpenPGP key found in the tfenv repository. Skipping that directive means that the Hashicorp key must be in the existing default trusted keys. Use the file to instead invoke the full tool and see web-of-trust status; beware that a lack of trust path will not cause a validation failure. .terraform-version If you use a .terraform-version file, (no argument) will install the version written in it. min-required & latest-allowed Please 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. Environment Variables TFENV String (Default: ) Specify architecture. Architecture other than the default amd64 can be specified with the environment variable Note: Default changes to for versions that have arm64 builds available when matches String (Default: true) Should tfenv automatically install terraform if the version specified by defaults or a .terraform-version file is not currently installed. Integer (Default: 2) Set the mechanism used for displaying download progress when downloading terraform versions from the remote server. • 2: v1 Behaviour: Pass to curl • 1: Use curl default • 0: Pass to curl Integer (Default: 0) Set the debug level for TFENV. • 0: No debug output • 1: Simple debug output • 2: Extended debug output, with source file names and interactive debug shells on error • 3: Debug level 2 + Bash execution tracing String (Default: https://releases.hashicorp.com) To install from a remote other than the default Integer (Default: 0) When using a custom remote, such as Artifactory, instead of the Hashicorp servers, the list of terraform versions returned by the curl of the remote directory may be inverted. In this case the functionality will not work as expected because it expects the versions to be listed in order of release date from newest to oldest. If your remote is instead providing a list that is oldes-first, set and functionality will be restored. Path (Default: ) The path to a directory where the local terraform versions and configuration files exist. String (Default: "") If not empty string, this variable overrides Terraform version, specified in .terraform-version files. and syntax are also supported. and command also respects this variable. e.g. String (Default: "") If not empty string, this variable specifies the credentials file used to access the remote location (useful if used in conjunction with TFENV_REMOTE). e.g. Bashlog Logging Library Integer (Default: 1) To disable colouring of console output, set to 0. String (Default: +%F %T) The display format for the date as passed to the binary to generate a datestamp used as a prefix to: • type log file lines. • Each console output line when Integer (Default: 0) By default, console output from tfenv does not print a date stamp or log severity. To enable this functionality, making normal output equivalent to FILE log output, set to 1. Integer (Default: 0) Set to 1 to enable plain text logging to file (FILE type logging). The default path for log files is defined by /tmp/$(basename $0).log Each executable logs to its own file. e.g. will log to String (Default: /tmp/$(basename ${0}).log) To specify a single file as the target for all FILE type logging regardless of the executing script. String (Default: "") *BE CAREFUL - MISUSE WILL DESTROY EVERYTHING YOU EVER LOVED* This variable allows you to pass a string containing a command that will be executed using in order to produce a prefix to each console output line, and each FILE type log entry. e.g. will prefix every log line with the calling process' PID. Integer (Default: 0) Set to 1 to enable JSON logging to file (JSON type logging). The default path for log files is defined by /tmp/$(basename $0).log.json Each executable logs to its own file. e.g. will log…