All Tools View Categories About Contact Privacy

OpenTofu Command Builder

Build OpenTofu (tofu) plan, apply and destroy commands.

Runs entirely in your browser - nothing is uploaded and no command is executed.
0
lines
0
characters
Your command will appear here.

About OpenTofu Command Builder

OpenTofu is the community-driven open-source fork of Terraform, and it is driven from the terminal with the tofu command. Commands such as tofu plan, tofu apply and tofu destroy accept a long list of flags that control variables, parallelism, targeting, locking and output format. Remembering the exact flag spelling and the right combination for a given situation is error prone, especially when you are assembling a command for a CI pipeline or a teammate under time pressure and cannot afford a failed run that wastes minutes or hours.

The OpenTofu Command Builder assembles these commands for you. Choose an action, supply variable files, individual variables, resource targets, parallelism and output options, then get a correctly quoted command string you can copy straight into a terminal or a script. It validates the command name and flags such as parallelism and variable entries, so you catch mistakes before they reach a shell. Nothing is executed and nothing is uploaded: the tool only builds text. This makes it safe to experiment with flag combinations and to share a canonical command with others without any side effects on live infrastructure.

Use it to standardise how your team runs OpenTofu, to produce reliable CI snippets, or simply as a quick reference for the most common flags without leaving your browser. The output is portable and works in any POSIX shell or pipeline runner, and it can be committed to source control for total repeatability across environments and engineers.

Features

  • Broad command set - init, plan, apply, destroy, validate, fmt, show, providers, import, output, refresh and more.
  • Variable handling - one or many -var-file entries plus inline -var key=value pairs.
  • Resource targeting - add -target selectors to limit the resources acted on during a run.
  • Tuning flags - parallelism, -out plan file, -lock=false, -refresh=false and -no-color options.
  • Automation flags - -auto-approve and -json for non-interactive and machine-readable runs.
  • Correct quoting - variable values are wrapped in quotes exactly as the CLI expects them.
  • Validation - rejects unknown commands and malformed variable or parallelism input.
  • Copy and download - export the command as a shell script you can run anywhere.
  • CI friendly - output is ready to paste into GitHub Actions, GitLab CI or any runner.
  • Private - command text only, nothing is executed or sent anywhere outside your machine.
  • Repeatable - the same flags every run, committed to source control for audit.
  • Helpful - clear errors tell you exactly which flag is wrong and why.

How to Use

  1. Pick a command from the dropdown, for example apply or plan depending on intent.
  2. Add variable files if you use .tfvars, one per entry such as dev.tfvars.
  3. Add inline variables as key=value pairs, separated by commas if there are several.
  4. Add targets as comma separated resource addresses like aws_instance.web to scope changes.
  5. Set parallelism only when you need to override the default concurrency for a run.
  6. Toggle options such as auto-approve, no-color, lock, refresh and json as needed.
  7. Click Build command to assemble the full tofu invocation string safely.
  8. Review the preview and resolve any validation errors shown in the panel.
  9. Copy or download the command and run it where you need it to run.
  10. Paste into CI so the exact command is recorded in your repository history.

Examples

Worked example - apply with variables. Select apply, add dev.tfvars as a variable file, add region = us-east-1 as a variable, target aws_instance.web, set parallelism to 10, choose an -out file of plan.tfplan and enable auto-approve. The builder emits tofu apply -var-file=dev.tfvars -var="region=us-east-1" -target=aws_instance.web -parallelism=10 -out=plan.tfplan -auto-approve. Notice the variable value is quoted as a single token so spaces or special characters are preserved, and the -out flag records the plan for a later, identical apply that cannot drift from what you reviewed.

Benefits

  • Fewer syntax errors - flags and quoting are assembled correctly for you.
  • Faster onboarding - teammates copy a known-good command every single time.
  • Reproducible CI - the same command every run, committed to the repo.
  • Safe exploration - preview the command before anything actually runs.
  • Portable - output works in any shell or pipeline without modification needed.
  • No secrets leaked - nothing leaves the browser during generation of the text.
  • Clarity - a single source of truth for how tofu is invoked by the team.

Frequently Asked Questions

What is OpenTofu?
OpenTofu is the open-source fork of Terraform. Its CLI is invoked with the tofu command and is largely flag-compatible with terraform.
Which commands are supported?
init, plan, apply, destroy, validate, fmt, show, providers, import, output, refresh and state, with common flags.
Which flags are supported?
-var-file, -var, -auto-approve, -no-color, -parallelism, -lock, -target, -out, -refresh and -json.
Does it run anything?
No. Only the command text is assembled; nothing is executed or uploaded.
Can I copy it?
Yes. Copy to clipboard or download as a shell script.