To use OpenTofu, a community fork of Terraform, you need to set the environment variable TFMIGRATE_EXEC_PATH to tofu
To support OpenTofu, I've relaxed a regular expression so that the output of the tofu version command can be parsed at least. Also, to use the tofu command for testing, read environment variables at the time of initializing the TerraformCLI instance.
This fix optimistically assumes that Terraform and OpenTofu features and version numbers are compatible, but the implementations will diverge and eventually become incorrect as time goes on. I think some abstractions, such as capability, will be needed before adding new features depending on Terraform 1.6+.
OpenTofu has yet to be released as stable, but an alpha version is available. I've added it to the test matrix.
Part of #162
To use OpenTofu, a community fork of Terraform, you need to set the environment variable
TFMIGRATE_EXEC_PATH
totofu
To support OpenTofu, I've relaxed a regular expression so that the output of the
tofu version
command can be parsed at least. Also, to use thetofu
command for testing, read environment variables at the time of initializing the TerraformCLI instance.This fix optimistically assumes that Terraform and OpenTofu features and version numbers are compatible, but the implementations will diverge and eventually become incorrect as time goes on. I think some abstractions, such as capability, will be needed before adding new features depending on Terraform 1.6+.
OpenTofu has yet to be released as stable, but an alpha version is available. I've added it to the test matrix.