Skip to content
tiv
GitHub

tiv state

Browse everything Terraform currently manages: every resource with its live attribute values, grouped by module, with outputs and a dependency graph.

Terminal window
tiv state

From a Terraform directory, tiv finds your state automatically: a local state file if one exists, otherwise it reads through your configured backend with terraform show. Remote backends (S3, Terraform Cloud, and the rest) work without any extra setup because terraform itself does the reading.

If no state is reachable at all, tiv falls back to scanning your .tf files so you still get a picture of the configuration.

Pass --console to explore the same report without leaving the terminal:

Terminal window
tiv state --console

Resources are laid out in dependency columns: anything with no dependencies sits on the left, and each column depends on the ones before it. Cards are Terraform purple for resources and blue for data sources; the tiv teal is reserved for the cursor and chrome so the accent never competes with resource meaning.

  • ↑↓ move within a column; ←→ follow dependency edges across columns, with connector arrows drawn beside the selection
  • space expands the selected resource’s attribute table in place (sensitive values stay masked)
  • t cycles three views of the state: the dependency graph, a flat list, and the modules the resources sit in, with modules linked wherever their resources depend on each other; the selection carries over
  • / searches by resource address and Enter jumps to the first match, then n and N walk forward and back through the rest; the footer shows which match you are on and how many there are
  • m cycles all → resources → data sources; 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.

  • Summary chips across the top: resource and data source counts, module count, outputs.
  • The graph shows every resource inside its module container, with dependency arrows drawn from state. Cross-module dependencies show as arrows between containers, and a module called from another module draws inside its parent’s container.
  • The module sidebar filters the resource list to one module. Outputs are listed beneath it, with sensitive outputs masked.
  • Resource cards expand to the full attribute table. Sensitive values are masked. Dependency chips (“depends on” / “used by”) jump between related resources.
  • Search filters cards by resource address.

Both state formats are accepted:

Terminal window
terraform show -json > state.json
tiv state --state state.json # the JSON representation
tiv state --state terraform.tfstate # a raw state file, converted automatically
terraform show -json | tiv state # piped

Raw .tfstate files are transformed into the same canonical form, keeping module addresses, dependencies, and outputs.

Flag Default What it does
--state none Path to state JSON or a raw .tfstate 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)