CLI tool to fetch Terraform outputs and expose them as environment variables or print to stdout in various formats. Current stable version 1.8.3, last updated in 2021. Allows running commands with Terraform outputs injected, exporting to shell, and supports path templates, auto-init, and plan checking. Compared to manual terraform output parsing, it provides a unified interface across multiple Terraform directories and modules.
npm install tf-outputNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates installing tf-output globally and various CLI usage patterns including direct output, environment injection, and path templating.
Consider alternatives like terraform output -json parsing manually with jq.
Use -a flag for auto-init or manually run terraform init in each directory.
Ensure all template variables (e.g., {stage}, {region}) are supplied via command-line arguments.Use child_process.exec or execSync to invoke tf-output from Node.js code.
Run: npm install -g tf-output
Run terraform apply in the target directory first, ensure outputs are defined in Terraform configuration.
Use -a flag or run terraform init manually in the directory.