tgswitch
June 29, 2026 ยท View on GitHub
Installs multiple versions of Terragrunt to ~/.terragrunt.versions and allows fast switching between them similar
to what tfenv does for Terraform.
This is more recently updated than tgenv.
Install
On Mac:
brew install warrensbox/tap/tgswitch
On Linux:
The repo's installer script tries to install to /usr/local/bin/ and gets permission denied on Linux:
curl -L https://raw.githubusercontent.com/warrensbox/tgswitch/release/install.sh | bash
Instead use this script from DevOps-Bash-tools repo:
install_tgswitch.sh
Usage
Will prompt to download a version of Terragrunt from a list of recent versions:
tgswitch
or install a specific version as an arg without the v prefix:
tgswitch 0.39.2
using environment variable (put this in direnv's .envrc):
export TG_VERSION=0.39.2
will now automatically download and switch to the above version:
tgswitch
.terragrunt-version
Instead of an environment variable you can create a file .terragrunt-version containing the version:
cat > .terragrunt-version <EOF
0.39.2
EOF
and then run tgswitch in that directory to detect the version and switch.