All Apps

Terraform / OpenTofu Command Helper

Client-SideOffline ReadyDev ToolsNo login required

Interactive CLI command generator and safe state surgery helper for HashiCorp Terraform and OpenTofu IaC workflows.

CLI Tool:
Init & Workspaces

Initialize Working Directory

Download required providers, modules, and configure remote state backend.

terraform init
Init & Workspaces

Upgrade Providers to Latest Compatible

Re-evaluate provider version constraints and update the dependency lock file.

terraform init -upgrade
Init & Workspaces

Reconfigure Backend State

Ignore existing backend configuration and configure a new remote backend.

terraform init -reconfigure
Init & Workspaces

List All Workspaces

Show all isolated state workspaces in current working directory.

terraform workspace list
Init & Workspaces

Create New Workspace

Create and immediately switch to a new environment workspace (e.g. staging, prod).

terraform workspace new production
Init & Workspaces

Switch to Existing Workspace

Switch active state context to the specified workspace.

terraform workspace select production
Plan & Apply

Preview Changes (Standard Plan)

Compare local configuration against live state and display planned infrastructure additions/deletions.

terraform plan
Plan & Apply

Save Plan to File for Safe Apply

Serialize exact execution plan to disk to guarantee identical changes upon apply.

terraform plan -out=tfplan
Plan & Apply

Apply Saved Plan File

Execute changes exactly as recorded in the saved plan without re-prompting.

terraform apply tfplan
Plan & Apply

Target Plan (Single Resource or Module)

Isolate execution planning to a single resource or module, ignoring other changes.

terraform plan -target=module.vpc.aws_subnet.public[0]
Plan & Apply

Target Apply with Auto-Approve

Execute changes only on the designated target resource, bypassing manual prompt.

terraform apply -target=module.vpc.aws_subnet.public[0] -auto-approve
Plan & Apply

Apply with Variable File

Load environment-specific variables from a tfvars file (e.g. prod.tfvars).

terraform apply -var-file="environments/production.tfvars"
Plan & Apply

Refresh State Only (Check Drift)

Query real-world cloud infrastructure without planning any resource modifications.

terraform plan -refresh-only
Plan & Apply

Destroy Specific Target Resource Only

Tear down only the specified cloud resource while leaving the rest intact.

terraform destroy -target=module.vpc.aws_subnet.public[0]
State Operations

List All Resources in State

Output every resource address tracked in the active remote or local state.

terraform state list
State Operations

Show Resource Attributes from State

Inspect all live attributes, IDs, and metadata for a tracked resource.

terraform state show module.vpc.aws_subnet.public[0]
State Operations

Remove Resource from State (Keep Cloud Asset Alive)

Safely un-track a resource from state without running cloud deletion.

terraform state rm module.vpc.aws_subnet.public[0]
State Operations

Move / Rename Resource in State

Update state address after refactoring code, preventing destructive destroy & recreate.

terraform state mv module.vpc.aws_subnet.public[0] module.network.aws_subnet.public[0]
State Operations

Pull Raw State JSON to Terminal or File

Export the complete live remote state JSON directly to a local backup file.

terraform state pull > terraform.tfstate.backup
State Operations

Release Stuck State Lock

Manually remove a lingering state lock left behind by a killed or timed-out process.

terraform force-unlock -force 8a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d
Imports & Validation

Import Existing Cloud Resource

Link an existing unmanaged cloud resource to your Terraform/OpenTofu code.

terraform import module.vpc.aws_subnet.public[0] i-0123456789abcdef0
Imports & Validation

Format All Code Files Recursively

Standardize syntax, indentation, and alignment across all .tf and .tfvars files.

terraform fmt -recursive
Imports & Validation

Validate Configuration Syntax

Verify that configuration files are syntactically valid and internally consistent.

terraform validate
Imports & Validation

Export Dependency Graph as PNG Image

Render visual dependency relationships between resources using Graphviz dot.

terraform graph | dot -Tpng -o graph.png
Imports & Validation

View Output Values

Extract all declared output values (IPs, endpoints, ARNs) from current state.

terraform output

Terraform & OpenTofu Support

Seamlessly switch between HashiCorp Terraform and Linux Foundation OpenTofu commands with 1-click toggle.

State Surgery & Recovery

Safe commands for removing stuck resources, renaming modules with state mv, force-unlocking state, and targeted plans.

100% Client-Side Parameterization

Generates commands locally in browser memory. No cloud credentials, API keys, or state files are ever uploaded.

Frequently Asked Questions

Can I switch between HashiCorp Terraform and Linux Foundation OpenTofu?
Yes. Toggle between "terraform" and "tofu" at the top of the tool to automatically rewrite all CLI syntax and arguments.
How do I remove a resource from state without destroying real cloud infrastructure?
Run "terraform state rm <resource_address>". Terraform removes the resource from its state file, leaving the physical cloud infrastructure untouched.
How do I release a stuck state lock caused by a crashed CI/CD runner?
Retrieve the Lock ID from your terminal error message and run "terraform force-unlock -force <lock_id>".
Recommended For You

More Dev Tools Utilities

View all Dev Tools tools