tfui latest

Open source · MIT

Terraform plans you can navigate.

A k9s-style terminal UI for Terraform, OpenTofu and Terragrunt. Read the plan as a tree, see the risk on every change, pin what you mean to apply. When an agent runs it, it goes headless.

  • Terraform
  • OpenTofu
  • Terragrunt

375lines of raw terraform

tfui

  • 10rows in the tree
  • 220tokens for your agent
  • 1CRITICAL change flagged

tfui plan 10 changes, sorted into modules, a risk badge on every one. Not 375 lines.

tfui plan
 [ ] + module.compute.aws_cloudwatch_log_group.app [low]
 [ ] ~ module.compute.aws_iam_role.app [HIGH]
 [ ] + module.compute.aws_instance.app[0] [low]
 [ ] + module.compute.aws_instance.app[1] [low]
 [ ] ~ module.networking.aws_security_group.web [medium]
 [ ] + module.networking.aws_subnet.public[0] [medium]
 [ ] + module.networking.aws_subnet.public[1] [medium]
 [ ] - module.storage.aws_db_instance.primary [CRITICAL]
 [ ] + module.storage.aws_db_instance.primary_v2 [medium]
 [ ] ~ module.storage.aws_s3_bucket.logs [HIGH]
 
 Plan: 6 to add, 3 to change, 1 to destroy
 Overall risk: CRITICAL

Same keys as tfui itself.esc or a scroll gives the page back.

Try it

Sixty seconds, no config

No account, no cloud service, no config file. Pick a way in.

No install

docker run --rm -it lmarqs/terraform-ui:demo

Opens tfui on a sample plan and state.

With tfui

terraform show -json tfplan.out | tfui -plan -

No plan handy? Use the sample plan:

curl -sLo /tmp/plan.json https://raw.githubusercontent.com/lmarqs/terraform-ui/main/demo/fixtures/plan-large.json
tfui -plan /tmp/plan.json
tfui
tfui home screen listing its plugins: context, state, plan, workspace, console, outputs, validate, init, risk, phantom and blast radius.

Features

From plan to apply, in one keyboard

Every screen below is a real recording of tfui on the same sample plan.

Plan tree

Expand the diff, not the scrollback

Navigate changes as a tree. Press enter on a row to read its attribute diff. Filter by address with /.

The plan plugin
tfui plan
The plan tree: changes grouped by module, each row with a risk badge, one row expanded to show its attribute diff.

Risk

Know the blast before you apply

  • [CRITICAL]
  • [HIGH]
  • [medium]
  • [low]

Rules know your resources. Destroying a database is critical. Changing an IAM role is high. Changing an instance is low.

How risk is classified
tfui plan · sample plan
Plan (14)
+ module.networking.aws_subnet.public[0]      [medium]
+ module.networking.aws_subnet.public[1]      [medium]
~ module.networking.aws_security_group.web    [medium]
+ module.compute.aws_instance.app[0]          [low]
~ module.compute.aws_iam_role.app             [HIGH]
~ module.storage.aws_s3_bucket.logs           [HIGH]
~ module.storage.aws_s3_bucket_policy.logs    [low]
- module.storage.aws_db_instance.primary      [CRITICAL]
+ module.storage.aws_db_instance.primary_v2   [medium]
…

Plan: 7 to add, 6 to change, 1 to destroy
Overall risk: CRITICAL

Pin and apply

space to pin, a to apply

Pin the resources you care about. tfui replans with them as targets, shows you exactly what will happen, and asks once. No -target flags to type, no copy-paste mistakes.

The apply plugin
tfui plan
Pinning two resources in the plan tree, then a targeted re-plan that shows only those two.

State

Search state, change it with a prompt

Fuzzy-search hundreds of resources and inspect their JSON. Taint, untaint, import, move and remove each wait for confirmation, so a typo never runs.

The state plugin
tfui state
The state browser: a fuzzy filter narrowing the resource list, then one resource's attributes inspected as JSON.

Phantom changes and blast radius

Tell noise from impact

Terraform says "1 to change" and nothing changes: null versus absent, a reordered list, provider normalization. tfui marks those as phantom. Blast radius groups the real changes by module and scores how far each one reaches.

Headless

220 tokens instead of 5287

When an agent runs tfui plan, it gets every change address, the summary and a risk verdict in a fraction of the tokens. Nothing to configure.

  1. Detects the agent

    CLAUDECODE, AI_AGENT or CI in the environment, or a stderr that isn't a terminal.

  2. Skips the TUI

    No alt-screen, no spinner, no escape codes. One line per change on stdout.

  3. Never claims success on failure

    Terraform's error goes to stderr, stdout stays empty, and the exit code is 1.

  4. Exits with meaning

    0 no changes, 2 changes present, 1 error. The agent branches without reading a byte.

agent session
$ tfui plan
+ module.compute.aws_cloudwatch_log_group.app
~ module.compute.aws_iam_role.app
+ module.compute.aws_instance.app[0]
+ module.compute.aws_instance.app[1]
~ module.networking.aws_security_group.web
+ module.networking.aws_subnet.public[0]
+ module.networking.aws_subnet.public[1]
- module.storage.aws_db_instance.primary
+ module.storage.aws_db_instance.primary_v2
~ module.storage.aws_s3_bucket.logs

Plan: 6 to add, 3 to change, 1 to destroy.
Risk: critical

$ echo $?
2
  • 24×fewer tokens
  • 28×fewer lines
  • 0bytes on stderr when it succeeds

Measured on the plan in the demo above, Terraform v1.14.9: 5287 tokens from terraform plan -no-color, 220 from tfui plan, as Claude counts them (claude-opus-5-5). How agent integration works.

Compared

The raw CLI, and tfui

Without tfui: Hundreds of lines of unstructured plan output

With tfui: A navigable tree with expand and collapse

Without tfui: Scanning by eye for destructive changes

With tfui: Inline risk badges, from [CRITICAL] to [low]

Without tfui: terraform apply -target=…, typed by hand

With tfui: Pin with space, apply with a

Without tfui: terraform state rm with no confirmation

With tfui: A state browser with a prompt before every change

Without tfui: Twenty minutes chasing a phantom diff

With tfui: Phantom changes detected and marked

Without tfui: Five terminal windows

With tfui: One TUI for every operation

Without tfui: Plan output flooding an agent's context

With tfui: One line per change plus a risk verdict

Built for infrastructure engineers

Single binary, local only

One binary

No runtime dependencies. Download it and run it.

Keyboard first

Vim-style navigation. You never need the mouse.

Three CLIs, one tool

Terraform, OpenTofu and Terragrunt behave the same.

Agent-ready

Agents and CI get headless, truthful output without setup.

Stays on your machine

No telemetry, no account, no cloud service.

Plugins all the way down

Every feature is a plugin you can configure or turn off.

Install

Pick a package manager

Every release ships binaries for Linux, macOS and Windows.

Homebrew

brew tap lmarqs/terraform-ui https://github.com/lmarqs/terraform-ui
brew trust --cask lmarqs/terraform-ui/tfui   # Homebrew 7+ only loads trusted third-party casks
brew install --cask tfui

Go

go install github.com/lmarqs/terraform-ui/cmd/tfui@latest

mise

mise use github:lmarqs/terraform-ui

Binary

curl -sL https://github.com/lmarqs/terraform-ui/releases/latest/download/tfui_linux_amd64.tar.gz | tar xz
sudo mv tfui /usr/local/bin/

Getting started walks through your first plan.