Get started

Your first report in minutes

Install one binary, verify it, and generate your first report. You don't need Node.js, a server or an account.

1. Download and verify

Releases provide binaries for macOS and Linux, on arm64 and amd64. Pin a version and check it before you run it.

VERSION=0.1.0-alpha.2
OS=darwin ARCH=arm64          # or linux / amd64
base=https://github.com/danushkastanley/tfviz/releases/download/v${VERSION}
curl -fsSLO "${base}/tfviz_${VERSION}_${OS}_${ARCH}.tar.gz"
curl -fsSLO "${base}/tfviz_${VERSION}_checksums.txt"
grep " tfviz_${VERSION}_${OS}_${ARCH}.tar.gz$" "tfviz_${VERSION}_checksums.txt" | shasum -a 256 -c -
gh attestation verify "tfviz_${VERSION}_${OS}_${ARCH}.tar.gz" --repo danushkastanley/tfviz

Then extract it and put tfviz on your PATH:

tar -xzf "tfviz_${VERSION}_${OS}_${ARCH}.tar.gz" tfviz
sudo install -m 0755 tfviz /usr/local/bin/tfviz
tfviz version

Each release includes a SHA-256 checksum file, an SBOM for every archive and GitHub build provenance. Don't pipe a remote install script into a shell. Windows builds will follow.

2. Review a plan

terraform plan -out=tfplan
terraform show -json tfplan | tfviz plan --input - --output review.html

Open review.html in any modern browser. It works offline, straight from disk. With OpenTofu, replace terraform with tofu.

3. Look at state

# a local state file
tfviz state --input terraform.tfstate --output state.html

# or the exact object in S3, with your usual AWS profile
aws sso login --profile work
tfviz state --input s3://example-state-bucket/prod/terraform.tfstate \
  --aws-profile work --aws-region eu-west-1 --output state.html

For S3, tfviz needs only s3:GetObject on that object, plus kms:Decrypt if it's encrypted with SSE-KMS. See the S3 guide for a least-privilege policy.

4. Explore privately

tfviz explore --state terraform.tfstate

This serves the same interface on 127.0.0.1 only and prints a private link. Press Refresh after you apply, and Ctrl+C to stop.

Useful options

OptionWhat it does
--safe-shareReplace identifying details with consistent stand-ins before sharing.
--icons <folder>Use the official AWS icons from the pack you downloaded.
--view modulesOpen in the module view instead of the architecture view.
--strictFail if anything can't be fully interpreted.
--offlineRefuse any input that would need the network.

Every option is in the command-line reference. Next, add tfviz to your pipeline.