Support for tab completion in `terraform console`
Current Terraform Version
0.14.3
...
Use-cases
When working in terraform console traversing a complex data structure can be eased by being able to tab complete keywords and known variables/properties, etc.
Attempted Solutions
Proposal
Add tab completion.
References
Hi @dustindortch! Thanks for sharing this use-case.
I want to be transparent with you that the terraform console command is not a focus for us right now and implementing what you've requested here would likely amount to a significant rewrite of its UI layer, because the current implementation is just a straightforward readline-like without any hooks for implementing features like tab completion. While it would be very nice to have tab completion in terraform console, I expect we wouldn't be able to prioritize it in the near future, both because of the direct implementation effort and because switching to a new input implementation for the console would risk creating unrelated regressions.
With that said, a while back I was experimenting with an interactive prompt for HCL-based expressions (which is what Terraform expressions are too), in my own repository hclcalc. It's not production-ready by any means, but it is perhaps a proof-of-concept of a future implementation of terraform console that has autocomplete behavior, at least for simple cases. For more complex situations we'd probably end up needing to borrow behaviors from the Terraform language server, which would be much more involved.
Any update on this?
for now, It can be done via https://github.com/paololazzari/terraform-repl