-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cli: auto completion of command arguments #28788
Comments
Hi @mbouamama, Terraform has the ability to autocomplete the commands available, and can add the basic shell configuration documented here: https://www.terraform.io/docs/cli/commands/index.html#shell-tab-completion Terraform however cannot autocomplete the possible arguments to commands as you have shown in the second example, so we can leave this open for a possible future enhancement. |
Oh sorry next time i will check documentation before opened an issue. |
Hi @mbouamama, We have previously experimented with implementing completion for arguments to Terraform's subcommands, and the For that reason, I don't expect that we would accept PRs to add new completion features at the moment, but as @jbardin said we'll use this issue to represent the request for more completion, which we'll consider along with all of the other feature requests in future releases. Completing a new design for how Terraform represents and processes its own arguments is a prerequisite for any more work on this particular issue, though. |
@apparentlymart I've just submit a PR to add the supports for auto-completing the resource addresses for a couple of commands in #29828, right before seeing this issue 😅 I'd admit that the PR has some duplication of the code from the implementation of |
@apparentlymart Apologies for bumping old issue, though has there been any update on this? Or any roadmap/plans on implementation? Thanks. |
@yermulnik This is not currently on the roadmap. Please do use the 👍 reaction on the original description to help promote this issue in the future. |
It'd be great if completion generation a la kubectl could be added, where if we run: kubectl completion <shell_name> it generates a native completion script for the provided shell and we can put it in the appropriate directory. |
Hi @jbardin |
Output shell completion code for the specified shell (bash or zsh). The shell code must be evaluated to provide
interactive completion of terraform commands. This can be done by sourcing it from the .bash_profile.
Current Terraform Version
Terraform Version
:Terraform v0.14.10
Use-case
Like kubectl completion bash or helm completion, completion code for the specified shell when you press tab shell propose you all possibility.
Example:
Attempted Solutions
Proposal
References
The text was updated successfully, but these errors were encountered: