Terraform Provider Manager (tpm
) is a command-line interface (CLI) tool designed to simplify the management of Terraform providers in the plugin cache directory. With tpm
you can easily install, uninstall, and list providers, helping you to streamline your Terraform workflow.
One of the key benefits of tpm
is that it does not require Terraform to be installed, making it a lightweight and efficient tool for managing your cached providers.
Installation • Usage • Useful Links • License
Arch Linux from AUR (maintained by @jonathanio):
yay -S terraform-tpm-bin
Via Homebrew:
brew install madh93/tap/tpm
Via Scoop:
scoop bucket add madh93 https://github.com/madh93/scoop-bucket.git
scoop install tpm
Stable binaries for all platforms are available on the releases page. To install, download the binary for your platform from "Assets", extract the downloaded file and place tpm
into your PATH
:
curl -L https://github.com/Madh93/tpm/releases/latest/download/tpm_$(uname -s)_$(uname -m).tar.gz | tar -xz -O tpm > /usr/local/bin/tpm
chmod +x /usr/local/bin/tpm
If you have Go installed:
go install github.com/Madh93/tpm@latest
Install Go if it is not already installed. You can download it from the official website.
Clone the Terraform Provider Manager repository to build and install the binary:
git clone https://github.com/Madh93/tpm && cd tpm && make install
Terraform Provider Manager is a simple CLI to manage Terraform providers in the Terraform plugin cache directory
Usage:
tpm [flags]
tpm [command]
Available Commands:
completion Generate the autocompletion script for the specified shell
help Help about any command
install Install a provider
list List all installed providers
purge Purge all installed providers
uninstall Uninstall a provider
Flags:
-c, --config string config file for tpm
-d, --debug enable debug mode
-h, --help help for tpm
-p, --terraform-plugin-cache-dir string the location of the Terraform plugin cache directory (default "/home/user/.terraform.d/plugin-cache")
-r, --terraform-registry string the Terraform registry provider hostname (default "registry.terraform.io")
-v, --version version for tpm
Use "tpm [command] --help" for more information about a command.
To install a provider you only need to provide the name. Optionally, you can specify a version by using <package>@<version>
. By default, if no version is specified, the latest available version, also known as @latest
, will be installed.
You can also specify the architecture and operating system. If not specified, the information from the system where tpm is being executed will be used.
In addition, it's possible to install multiple providers at once specifying a providers.yml
file, making it easier to share and reuse installation requirements. For example:
providers:
- name: hashicorp/[email protected]
- name: hashicorp/[email protected]
os:
- linux
- darwin
arch:
- amd64
- arm64
- name: hashicorp/random
os:
- linux
- darwin
arch:
- amd64
- arm64
The providers are installed in parallel by default. You can adjust the number of parallel jobs by using the --jobs <NUMBER>
flag.
This will display on the screen the installed providers. Optionally, you can specify an output format. Valid output formats are:
text
(default)json
csv
table
Uninstalling a provider is exactly the same as installing it. You can specify both the version, operating system, and architecture.
This will delete all installed providers from the current registry.
- Terraform
- Terraform Registry
- Terraform Providers Docs
- Terraform Provider Plugin Cache Docs
- Terraform plugin caching
- How to Speed Up Terraform in CI/CD Pipelines
This project is licensed under the MIT license.