-
Notifications
You must be signed in to change notification settings - Fork 95
Open
Description
Summary
tofu (OpenTofu) commands are among the heaviest unhandled commands in my RTK discover output -- 321 combined calls over 30 days across tofu fmt, tofu test, tofu apply, tofu validate, tofu output, tofu plan, and tofu init.
Discover output
tofu fmt 88 tofu fmt
tofu test 76 tofu test 2>&1
tofu apply 56 AWS_ACCESS_KEY_ID=... tofu apply -auto-approve ...
tofu validate 37 tofu validate 2>&1
tofu output 24 AWS_ACCESS_KEY_ID=... tofu output -json ...
tofu plan 22 AWS_ACCESS_KEY_ID=... tofu plan ...
tofu init 18 AWS_ACCESS_KEY_ID=... tofu init ...
Use cases
tofu plan/tofu apply-- very verbose output with full resource diffs, provider logs, and state refresh lines. Most of the output is "Refreshing state..." noise; only the actual plan summary and changes matter for LLM contexttofu test-- test runner output similar togo test, lots of boilerplate around pass/failtofu validate-- usually short on success ("Success! The configuration is valid.") but verbose on error with full HCL context blockstofu fmt-- no output on success, diff output on failure; minimal filtering neededtofu output -json-- full JSON state dumps, often large when only a few values mattertofu init-- provider download progress bars, plugin cache messages, backend config echo
Suggested filters
- Strip all "Refreshing state..." lines from
plan/apply(biggest single win) - Strip provider download progress from
init - Compact
planoutput: keep resource change summary (+/- counts) and changed attributes, strip unchanged attributes - For
apply: keep final summary ("Apply complete! Resources: X added, Y changed, Z destroyed") and any errors - For
output -json: keep key/value pairs, strip metadata fields - For
test: keep only pass/fail summary and failure details (same pattern as test runners)
Notes
- OpenTofu is a drop-in replacement for Terraform --
tofuandterraformshare the same CLI interface and output format. Supportingtofuwould also coverterraformwith minimal extra work (alias or shared filter logic) - Output format is identical between
tofuandterraform, so a single filter implementation covers both
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels