id = "opentofu"
name = "OpenTofu"
homepage = "https://opentofu.org"
description = "OpenTofu is an open-source infrastructure as code tool."
executables = ["tofu"]
[dotfiles]
paths = [
"~/.tofurc",
"[configHome]/opentofu/tofurc",
"%APPDATA%/tofu.rc",
]
secret = []
side_effect = false
[commands]
format = 1
label = "OpenTofu"
description = "Initialize, plan and apply OpenTofu configurations. Backend settings, state commands, workspaces and other subcommands are outside these forms."
quality = "ai-draft"
parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = false, short_bundles = false }
[[commands.subcommand]]
path = ["init"]
label = "Initialize working directory"
description = "Download providers and modules. Backend configuration options are left out."
[[commands.subcommand.source]]
id = "docs"
kind = "manual"
url = "https://opentofu.org/docs/cli/commands/init/"
evidence = """
* `-upgrade` Upgrade all previously-selected plugins to the newest version
* `-input=true` Ask for input if necessary. If false, will error if
* `-no-color` Disable color codes in the command output.
* `-lock=false` Disable locking of state files during state-related operations.
"""
[[commands.subcommand.field]]
id = "upgrade"
label = "Upgrade providers and modules"
type = "boolean"
option = ["-upgrade"]
sources = ["docs"]
[[commands.subcommand.field]]
id = "no_color"
label = "No color"
type = "boolean"
option = ["-no-color"]
sources = ["docs"]
[[commands.subcommand.field]]
id = "no_lock"
label = "Disable state locking"
type = "boolean"
option = ["-lock=false"]
sources = ["docs"]
[[commands.subcommand.task]]
id = "init"
label = "Initialize"
fields = ["upgrade", "no_color"]
required = []
[[commands.subcommand.group]]
id = "basic"
label = "Basic"
fields = ["upgrade", "no_color", "no_lock"]
[[commands.subcommand]]
path = ["plan"]
label = "Create an execution plan"
description = "Preview changes. Variable assignments and target/replace addresses are included; planning modes beyond destroy and refresh-only are not."
[[commands.subcommand.source]]
id = "docs"
kind = "manual"
url = "https://opentofu.org/docs/cli/commands/plan/"
evidence = """
Activate destroy mode using the `-destroy` command line option.
Activate refresh-only mode using the `-refresh-only` command line option.
- `-refresh=false` - Disables the default behavior of synchronizing the
- `-target=ADDRESS` - Instructs OpenTofu to focus its planning efforts only
- `-var-file=FILENAME` - Sets values for potentially many
* `-detailed-exitcode` - Returns a detailed exit code when the command exits.
* `-out=FILENAME` - Writes the generated plan to the given filename in an
* `-no-color` - Disables terminal formatting sequences in the output. Use this
"""
[[commands.subcommand.field]]
id = "destroy"
label = "Plan to destroy everything"
type = "boolean"
option = ["-destroy"]
sources = ["docs"]
[[commands.subcommand.field]]
id = "refresh_only"
label = "Refresh-only plan"
type = "boolean"
option = ["-refresh-only"]
sources = ["docs"]
[[commands.subcommand.field]]
id = "no_refresh"
label = "Skip refresh"
type = "boolean"
option = ["-refresh=false"]
sources = ["docs"]
[[commands.subcommand.field]]
id = "target"
label = "Target address"
type = "string"
option = ["-target"]
multiple = true
sources = ["docs"]
[[commands.subcommand.field]]
id = "var_file"
label = "Variables file"
type = "path"
option = ["-var-file"]
path = { kind = "file", role = "input" }
multiple = true
sources = ["docs"]
[[commands.subcommand.field]]
id = "out"
label = "Save plan to file"
type = "path"
option = ["-out"]
path = { kind = "file", role = "output" }
sources = ["docs"]
[[commands.subcommand.field]]
id = "detailed_exitcode"
label = "Detailed exit code"
type = "boolean"
option = ["-detailed-exitcode"]
sources = ["docs"]
[[commands.subcommand.field]]
id = "no_color"
label = "No color"
type = "boolean"
option = ["-no-color"]
sources = ["docs"]
[[commands.subcommand.task]]
id = "plan"
label = "Plan and save"
fields = ["out", "var_file", "target", "no_color"]
required = []
[[commands.subcommand.task]]
id = "plan-destroy"
label = "Preview destroy"
set = { destroy = [true] }
lock = ["destroy"]
fields = ["destroy", "var_file", "target", "no_color"]
required = []
[[commands.subcommand.group]]
id = "basic"
label = "Basic"
fields = ["destroy", "refresh_only", "var_file", "target", "out"]
[[commands.subcommand.group]]
id = "advanced"
label = "Advanced"
fields = ["no_refresh", "detailed_exitcode", "no_color"]
[[commands.subcommand]]
path = ["apply"]
label = "Apply changes"
description = "Apply the configuration or a saved plan file. Review a plan first."
[[commands.subcommand.source]]
id = "docs"
kind = "manual"
url = "https://opentofu.org/docs/cli/commands/apply/"
evidence = """
- `-auto-approve` - Skips interactive approval of plan before applying. This
- `-input=false` - Disables all of OpenTofu's interactive prompts. Note that
- `-compact-warnings` - Shows any warning messages in a compact form which
Activate destroy mode using the `-destroy` command line option.
- `-var-file=FILENAME` - Sets values for potentially many
"""
[[commands.subcommand.field]]
id = "auto_approve"
label = "Skip interactive approval"
type = "boolean"
option = ["-auto-approve"]
effect = "overwrite"
sources = ["docs"]
[[commands.subcommand.field]]
id = "no_input"
label = "Disable prompts"
type = "boolean"
option = ["-input=false"]
sources = ["docs"]
[[commands.subcommand.field]]
id = "compact_warnings"
label = "Compact warnings"
type = "boolean"
option = ["-compact-warnings"]
sources = ["docs"]
[[commands.subcommand.field]]
id = "var_file"
label = "Variables file"
type = "path"
option = ["-var-file"]
path = { kind = "file", role = "input" }
multiple = true
sources = ["docs"]
[[commands.subcommand.field]]
id = "planfile"
label = "Saved plan file"
description = "Leave empty to plan and apply the current configuration."
type = "path"
position = 0
path = { kind = "file", role = "input" }
sources = ["docs"]
[[commands.subcommand.task]]
id = "apply"
label = "Apply configuration"
fields = ["var_file", "compact_warnings"]
required = []
[[commands.subcommand.task]]
id = "apply-plan"
label = "Apply saved plan"
fields = ["planfile", "compact_warnings"]
required = ["planfile"]
[[commands.subcommand.group]]
id = "basic"
label = "Basic"
fields = ["planfile", "var_file", "auto_approve"]
[[commands.subcommand.group]]
id = "advanced"
label = "Advanced"
fields = ["no_input", "compact_warnings"]