Skip to content

interpret also tofu as terraform#2919

Merged
romkatv merged 1 commit intoromkatv:masterfrom
orgads:tf
Jan 28, 2026
Merged

interpret also tofu as terraform#2919
romkatv merged 1 commit intoromkatv:masterfrom
orgads:tf

Conversation

@orgads
Copy link
Copy Markdown
Contributor

@orgads orgads commented Jan 28, 2026

No description provided.

@romkatv
Copy link
Copy Markdown
Owner

romkatv commented Jan 28, 2026

What are tf and tofu? Is their behavior affected by the content of ~/.aws/config?

@orgads
Copy link
Copy Markdown
Contributor Author

orgads commented Jan 28, 2026

tf is a widely used alias for terraform, see for example here and here. It is also mentioned in rainbow script in POWERLEVEL9K_TERRAFORM_VERSION_SHOW_ON_COMMAND.
tofu is the command for OpenTofu, which is Terraform fork (MPL license).

When running Terraform, it is useful to know what is the active Azure/AWS/GCP environment.

@romkatv
Copy link
Copy Markdown
Owner

romkatv commented Jan 28, 2026

Aliases should work out of the box because powerlevel10k can see through them. So, if you define alias tf=terraform and then type tf, the effect should be the same as if you typed terraform.

Adding tofu is a good idea.

@orgads
Copy link
Copy Markdown
Contributor Author

orgads commented Jan 28, 2026

In my case tf is a wrapper script though :/

@romkatv
Copy link
Copy Markdown
Owner

romkatv commented Jan 28, 2026

The default values of parameter include popular tools, not private scripts. The latter can have arbitrary names and semantics, and are supported by your ability to modify your own ~/.p10k.zsh.

@orgads orgads changed the title interpret also tf and tofu as terraform interpret also tofu as terraform Jan 28, 2026
@orgads
Copy link
Copy Markdown
Contributor Author

orgads commented Jan 28, 2026

Done.

@romkatv romkatv merged commit 7178d3b into romkatv:master Jan 28, 2026
@romkatv
Copy link
Copy Markdown
Owner

romkatv commented Jan 28, 2026

Thanks!

@orgads orgads deleted the tf branch January 28, 2026 17:42
@Syphdias
Copy link
Copy Markdown
Contributor

In my case tf is a wrapper script though :/

You can alias to a function that overrides tofu. I did this for terrafrom. So this might work for you as long as you use command tofu in your wrapper script:

alias tf=tofu
function tofu() {
   command tofu -var-file ~/i/just/made/this/up/global.tfvars $@
}

But yes, just locally overriding is probably easier ;) Might still be useful for other applications

@orgads
Copy link
Copy Markdown
Contributor Author

orgads commented Jan 28, 2026

Thank you.

quantumnic pushed a commit to quantumnic/powerlevel10k that referenced this pull request Feb 23, 2026
- terraform_init: detect tofu when terraform is not available
- terraform_version: use tofu binary as fallback, parse 'OpenTofu v...' output
- terraform_version_init: detect tofu when terraform is not available
- Add test_terraform_tofu.zsh with 9 tests for pattern matching and version parsing

Cherry-picked config changes from upstream 7178d3b (tofu in SHOW_ON_COMMAND)
were already present in the fork.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants