terraform-docs is available on Linux, macOS, Windows, and FreeBSD platforms.
If you are a macOS user, you can use Homebrew.
brew install terraform-docs
If you are a Windows user:
You can use Scoop.
scoop bucket add terraform-docs https://github.com/terraform-docs/scoop-bucket scoop install terraform-docs
or you can use Chocolatey.
choco install terraform-docs
You also can run
terraform-docs as a container:
docker run quay.io/terraform-docs/terraform-docs:0.14.1
latest refers to latest stable released version and
to HEAD of
master at any given point in time. And any named version tags are
identical to the official GitHub releases without leading
Stable binaries are available on the GitHub Release page. To install, download
the file for your platform from “Assets” and place it into your
curl -sSLo ./terraform-docs.tar.gz https://terraform-docs.io/dl/v0.14.1/terraform-docs-v0.14.1-$(uname)-amd64.tar.gz tar -xzf terraform-docs.tar.gz chmod +x terraform-docs mv terraform-docs /some-dir-in-your-PATH/terraform-docs
Note: Windows releases are in
The latest version can be installed using
GO111MODULE="on" go get email@example.com
NOTE: to download any version before
v0.9.1 (inclusive) you need to use to
old module namespace (
# only for v0.9.1 and before GO111MODULE="on" go get firstname.lastname@example.org
NOTE: please use the latest Go to do this, minimum
go1.16 or greater.
This will put
$(go env GOPATH)/bin. If you encounter the error
terraform-docs: command not found after installation then you may need to either add
that directory to your
$PATH as shown [here] or do a manual installation by cloning
the repo and run
make build from the repository which will put
$(go env GOPATH)/src/github.com/terraform-docs/terraform-docs/bin/$(uname | tr '[:upper:]' '[:lower:]')-amd64/terraform-docs
The code completion for
zsh can be installed as follow. Note that shell
auto-completion is not available on Windows platform.
terraform-docs completion bash > ~/.terraform-docs-completion source ~/.terraform-docs-completion # or the one-liner below source <(terraform-docs completion bash)
terraform-docs completion zsh > /usr/local/share/zsh/site-functions/_terraform-docs autoload -U compinit && compinit
To make this change permanent, the above commands can be added to