$ account tfutils
tfenv is a command-line Terraform version manager written in Bash, modelled after rbenv. It provides a `terraform` shim that intercepts invocations and selects the appropriate Terraform binary based on a `.terraform-version` file, the `TFENV_TERRAFORM_VERSION` environment variable, or the default version file under `TFENV_CONFIG_DIR`. The repository implements full version lifecycle operations: install (download, verify SHA256 and optional PGP signatures, unzip), switch (`use`), uninstall (including multiple versions), list local and remote versions, pin current version, and a `min-required`/`latest-allowed` resolver that reads `required_version` constraints from `.tf` files. Architecturally it follows the rbenv pattern: a dispatcher (`bin/tfenv`), a shim (`bin/terraform`), shared libraries in `lib/` (logging, version-file discovery, version-name resolution, execution), and standalone subcommand scripts in `libexec/` that each include boilerplate to resolve `TFENV_ROOT`. The code deliberately avoids shellcheck and additional dependencies, maintaining portability across Linux, macOS, and Windows (git-bash). An extensive integration test suite downloads real Terraform binaries, and CI covers a broad OS matrix plus Docker validation. The codebase demonstrates solid engineering practice for a Bash project: clean separation of concerns, a capable logging library (`lib/bashlog.sh`) that supports file, JSON, syslog and coloured console output; careful handling of cross-platform differences (BSD vs GNU grep, CRLF line endings, ARM architecture detection); and a concurrency-safe install lock using atomic `mkdir`. Notable weaknesses are intentional boilerplate duplication across `libexec/` scripts, a test runner that historically exits 0 on failure (documented as a known bug being fixed), and regex-based HCL constraint parsing that is functional but fragile. A proposed ADR outlines a future Go edition, but the Bash implementation remains canonical.