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.
[ ] + 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.
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: + create ~ update in-place - destroy Terraform will perform the following actions: # module.compute.aws_cloudwatch_log_group.app will be created + resource "aws_cloudwatch_log_group" "app" { + arn = (known after apply) + id = (known after apply) + log_group_class = (known after apply) + name = "/acme/app" + name_prefix = (known after apply) + retention_in_days = 30 + skip_destroy = false + tags_all = (known after apply) } # module.compute.aws_iam_role.app will be updated in-place ~ resource "aws_iam_role" "app" { id = "app" name = "app" ~ tags = { ~ "Owner" = "platform" -> "infra" "Team" = "core" } ~ tags_all = { ~ "Owner" = "platform" -> "infra" # (1 unchanged element hidden) } # (11 unchanged attributes hidden) } # module.compute.aws_instance.app[0] will be created + resource "aws_instance" "app" { + ami = "ami-0c55b159cbfafe1f0" + arn = (known after apply) + associate_public_ip_address = (known after apply) + availability_zone = (known after apply) + cpu_core_count = (known after apply) + cpu_threads_per_core = (known after apply) + disable_api_stop = (known after apply) + disable_api_termination = (known after apply) + ebs_optimized = (known after apply) + enable_primary_ipv6 = (known after apply) + get_password_data = false + host_id = (known after apply) + host_resource_group_arn = (known after apply) + iam_instance_profile = (known after apply) + id = (known after apply) + instance_initiated_shutdown_behavior = (known after apply) + instance_lifecycle = (known after apply) + instance_state = (known after apply) + instance_type = "t3.medium" + ipv6_address_count = (known after apply) + ipv6_addresses = (known after apply) + key_name = (known after apply) + monitoring = (known after apply) + outpost_arn = (known after apply) + password_data = (known after apply) + placement_group = (known after apply) + placement_partition_number = (known after apply) + primary_network_interface_id = (known after apply) + private_dns = (known after apply) + private_ip = (known after apply) + public_dns = (known after apply) + public_ip = (known after apply) + secondary_private_ips = (known after apply) + security_groups = (known after apply) + source_dest_check = true + spot_instance_request_id = (known after apply) + subnet_id = (known after apply) + tags = { + "Env" = "prod" + "Name" = "app-0" } + tags_all = { + "Env" = "prod" + "Name" = "app-0" } + tenancy = (known after apply) + user_data = (known after apply) + user_data_base64 = (known after apply) + user_data_replace_on_change = false + vpc_security_group_ids = [ + "sg-0f1e2d3c", ] + capacity_reservation_specification (known after apply) + cpu_options (known after apply) + ebs_block_device (known after apply) + enclave_options (known after apply) + ephemeral_block_device (known after apply) + instance_market_options (known after apply) + maintenance_options (known after apply) + metadata_options (known after apply) + network_interface (known after apply) + private_dns_name_options (known after apply) + root_block_device (known after apply) } # module.compute.aws_instance.app[1] will be created + resource "aws_instance" "app" { + ami = "ami-0c55b159cbfafe1f0" + arn = (known after apply) + associate_public_ip_address = (known after apply) + availability_zone = (known after apply) + cpu_core_count = (known after apply) + cpu_threads_per_core = (known after apply) + disable_api_stop = (known after apply) + disable_api_termination = (known after apply) + ebs_optimized = (known after apply) + enable_primary_ipv6 = (known after apply) + get_password_data = false + host_id = (known after apply) + host_resource_group_arn = (known after apply) + iam_instance_profile = (known after apply) + id = (known after apply) + instance_initiated_shutdown_behavior = (known after apply) + instance_lifecycle = (known after apply) + instance_state = (known after apply) + instance_type = "t3.medium" + ipv6_address_count = (known after apply) + ipv6_addresses = (known after apply) + key_name = (known after apply) + monitoring = (known after apply) + outpost_arn = (known after apply) + password_data = (known after apply) + placement_group = (known after apply) + placement_partition_number = (known after apply) + primary_network_interface_id = (known after apply) + private_dns = (known after apply) + private_ip = (known after apply) + public_dns = (known after apply) + public_ip = (known after apply) + secondary_private_ips = (known after apply) + security_groups = (known after apply) + source_dest_check = true + spot_instance_request_id = (known after apply) + subnet_id = (known after apply) + tags = { + "Env" = "prod" + "Name" = "app-1" } + tags_all = { + "Env" = "prod" + "Name" = "app-1" } + tenancy = (known after apply) + user_data = (known after apply) + user_data_base64 = (known after apply) + user_data_replace_on_change = false + vpc_security_group_ids = [ + "sg-0f1e2d3c", ] + capacity_reservation_specification (known after apply) + cpu_options (known after apply) + ebs_block_device (known after apply) + enclave_options (known after apply) + ephemeral_block_device (known after apply) + instance_market_options (known after apply) + maintenance_options (known after apply) + metadata_options (known after apply) + network_interface (known after apply) + private_dns_name_options (known after apply) + root_block_device (known after apply) } # module.networking.aws_security_group.web will be updated in-place ~ resource "aws_security_group" "web" { id = "sg-0f1e2d3c" name = "web" ~ tags = { "Env" = "prod" ~ "Owner" = "platform" -> "infra" } ~ tags_all = { ~ "Owner" = "platform" -> "infra" # (1 unchanged element hidden) } # (8 unchanged attributes hidden) } # module.networking.aws_subnet.public[0] will be created + resource "aws_subnet" "public" { + arn = (known after apply) + assign_ipv6_address_on_creation = false + availability_zone = "us-east-1a" + availability_zone_id = (known after apply) + cidr_block = "10.0.10.0/24" + enable_dns64 = false + enable_resource_name_dns_a_record_on_launch = false + enable_resource_name_dns_aaaa_record_on_launch = false + id = (known after apply) + ipv6_cidr_block_association_id = (known after apply) + ipv6_native = false + map_public_ip_on_launch = false + owner_id = (known after apply) + private_dns_hostname_type_on_launch = (known after apply) + tags = { + "Env" = "prod" + "Name" = "public-0" } + tags_all = { + "Env" = "prod" + "Name" = "public-0" } + vpc_id = "vpc-0a1b2c3d" } # module.networking.aws_subnet.public[1] will be created + resource "aws_subnet" "public" { + arn = (known after apply) + assign_ipv6_address_on_creation = false + availability_zone = "us-east-1b" + availability_zone_id = (known after apply) + cidr_block = "10.0.11.0/24" + enable_dns64 = false + enable_resource_name_dns_a_record_on_launch = false + enable_resource_name_dns_aaaa_record_on_launch = false + id = (known after apply) + ipv6_cidr_block_association_id = (known after apply) + ipv6_native = false + map_public_ip_on_launch = false + owner_id = (known after apply) + private_dns_hostname_type_on_launch = (known after apply) + tags = { + "Env" = "prod" + "Name" = "public-1" } + tags_all = { + "Env" = "prod" + "Name" = "public-1" } + vpc_id = "vpc-0a1b2c3d" } # module.storage.aws_db_instance.primary will be destroyed # (because aws_db_instance.primary is not in configuration) - resource "aws_db_instance" "primary" { - allocated_storage = 100 -> null - arn = "arn:aws:rds:us-east-1:123456789012:db:acme-primary" -> null - engine = "postgres" -> null - engine_version = "14.11" -> null - id = "db-PRIMARY" -> null - identifier = "acme-primary" -> null - instance_class = "db.r6g.large" -> null - password_wo = (write-only attribute) -> null - skip_final_snapshot = false -> null - tags = { - "Env" = "prod" } -> null - tags_all = { - "Env" = "prod" } -> null - username = "acme" -> null } # module.storage.aws_db_instance.primary_v2 will be created + resource "aws_db_instance" "primary_v2" { + address = (known after apply) + allocated_storage = 100 + apply_immediately = false + arn = (known after apply) + auto_minor_version_upgrade = true + availability_zone = (known after apply) + backup_retention_period = (known after apply) + backup_target = (known after apply) + backup_window = (known after apply) + ca_cert_identifier = (known after apply) + character_set_name = (known after apply) + copy_tags_to_snapshot = false + database_insights_mode = (known after apply) + db_name = (known after apply) + db_subnet_group_name = (known after apply) + dedicated_log_volume = false + delete_automated_backups = true + domain_fqdn = (known after apply) + endpoint = (known after apply) + engine = "postgres" + engine_lifecycle_support = (known after apply) + engine_version = "16.4" + engine_version_actual = (known after apply) + hosted_zone_id = (known after apply) + id = (known after apply) + identifier = "acme-primary-v2" + identifier_prefix = (known after apply) + instance_class = "db.r6g.large" + iops = (known after apply) + kms_key_id = (known after apply) + latest_restorable_time = (known after apply) + license_model = (known after apply) + listener_endpoint = (known after apply) + maintenance_window = (known after apply) + manage_master_user_password = true + master_user_secret = (known after apply) + master_user_secret_kms_key_id = (known after apply) + monitoring_interval = 0 + monitoring_role_arn = (known after apply) + multi_az = (known after apply) + nchar_character_set_name = (known after apply) + network_type = (known after apply) + option_group_name = (known after apply) + parameter_group_name = (known after apply) + password_wo = (write-only attribute) + performance_insights_enabled = false + performance_insights_kms_key_id = (known after apply) + performance_insights_retention_period = (known after apply) + port = (known after apply) + publicly_accessible = false + replica_mode = (known after apply) + replicas = (known after apply) + resource_id = (known after apply) + skip_final_snapshot = false + snapshot_identifier = (known after apply) + status = (known after apply) + storage_throughput = (known after apply) + storage_type = (known after apply) + tags = { + "Env" = "prod" } + tags_all = { + "Env" = "prod" } + timezone = (known after apply) + username = "acme" + vpc_security_group_ids = (known after apply) } # module.storage.aws_s3_bucket.logs will be updated in-place ~ resource "aws_s3_bucket" "logs" { id = "acme-logs" ~ tags = { "Env" = "prod" ~ "Owner" = "platform" -> "infra" } ~ tags_all = { ~ "Owner" = "platform" -> "infra" # (1 unchanged element hidden) } # (5 unchanged attributes hidden) } Plan: 6 to add, 3 to change, 1 to destroy. ───────────────────────────────────────────────────────────────────────────── Saved the plan to: tfplan To perform exactly these actions, run the following command to apply: terraform apply "tfplan" + 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: criticalTry 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:demoOpens 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
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 /.
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 classifiedPlan (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] ~ module.compute.aws_iam_role.app [HIGH] ~ module.storage.aws_s3_bucket.logs [HIGH] ~ module.storage.aws_s3_bucket_policy.logs - 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.
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
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.
Detects the agent
CLAUDECODE,AI_AGENTorCIin the environment, or a stderr that isn't a terminal.Skips the TUI
No alt-screen, no spinner, no escape codes. One line per change on stdout.
Never claims success on failure
Terraform's error goes to stderr, stdout stays empty, and the exit code is 1.
Exits with meaning
0no changes,2changes present,1error. The agent branches without reading a byte.
$ 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 tfuiGo
go install github.com/lmarqs/terraform-ui/cmd/tfui@latestmise
mise use github:lmarqs/terraform-uiBinary
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.
Read next