Skip to content
tiv
GitHub

tiv plan

See what a Terraform plan will do before you apply it: every change with before and after values, and a graph of how the changing resources relate.

From an initialized Terraform directory:

Terminal window
tiv plan

tiv runs terraform plan into a temporary file, converts it, and serves the report at http://127.0.0.1:4747, opening your browser. Nothing is applied, and no plan files are left behind.

  • Change counts across the top: add (green), change (amber), destroy (red), replace (purple). Each chip is a filter. Click one to hide that kind of change in both the list and the graph.
  • The graph shows changed resources inside their module containers, with arrows for dependencies between them. A module called from another module draws inside its parent’s container. Clicking a node jumps to its detail card. When filters change, the graph re-lays itself out.
  • Change cards, grouped by module, expand to an attribute diff. Values Terraform cannot know yet show as (known after apply). Sensitive values are masked. Updates show only the attributes that change, with a count of the hidden unchanged ones.
  • Dependency chips on each card (“depends on” / “used by”) jump to the related resource.
  • Search filters cards by resource address.

Pass --console to review the same plan without leaving the terminal:

Terminal window
tiv plan --console

Changed resources are laid out in dependency columns, each card bordered in its action’s colour and led by its sign: + create (green), ~ update (amber), − destroy (red), ± replace (purple). Resources the plan leaves alone stay hidden until you ask for them.

  • ↑↓ move within a column; ←→ follow dependency edges across columns, with connector arrows drawn beside the selection
  • space expands the selected change into a diff: - lines are values leaving, + lines are values arriving, (known after apply) marks what Terraform cannot know yet, and sensitive values stay masked
  • u reveals the unchanged resources, with their current values; press it again to hide them
  • t cycles three views of the plan: the dependency graph, a flat list, and the modules the changes sit in. The module view shows what each module is passed and declares
  • / searches by resource address and Enter jumps to the first match, then n and N walk forward and back through the rest
  • m cycles all → each action present; p cycles providers; the two filters combine
  • ? shows the full key reference; q quits

--console and --browser are mutually exclusive. The browser remains the default for now.

Terraform saves plans as a binary file that no tool reads directly. terraform show -json converts it, so producing plan input by hand is a two-step process:

Terminal window
terraform plan -out=tf.plan
terraform show -json tf.plan > plan.json

Then any of these work:

Terminal window
tiv plan --plan plan.json # explicit path
tiv plan < plan.json # redirected
terraform show -json tf.plan | tiv plan # piped, skipping the .json file
tiv plan # picks up plan.json from the current directory
  • The binary plan file itself (tf.plan)
  • Human-readable terraform plan output, with or without -no-color
  • The terraform plan -json log stream, which carries no before/after values

If you pass one of these, tiv tells you the exact commands to produce the right format.

These apply when tiv runs terraform for you, and are omitted otherwise:

Terminal window
tiv plan --chdir infra --var 'region=eu-west-1' --var-file prod.tfvars
Flag Default What it does
--plan none Path to a plan JSON file
--console false Render the report as an interactive terminal UI
--browser false Serve the report in the browser (the current default; excludes --console)
--port 4747 Report server port (random fallback when taken)
--open true Open the report in your browser
--chdir none Directory to run terraform in (like terraform -chdir)
--var none Terraform input variable, repeatable
--var-file none Terraform variable file, repeatable