Search code examples
windowsterraformwindows-10chocolatey

Error executing CLI: Did not find any shells to install


When I try to install terraform with chocolatey, in the step $ terraform -install-autocomplete throw an error

$ terraform -install-autocomplete
Error executing CLI: Did not find any shells to install

Solution

  • Terraform supports autocompletion only for the Unix shells bash, zsh, and fish.

    The command you ran tries to determine which shells you use on your system by searching for the typical configuration files for each shell:

    • For bash, any of the following files exist: $HOME/.bashrc, $HOME/.bash_profile, $HOME/.bash_login or $HOME/.profile.
    • For zsh, this file exists: $HOME/.zshrc.
    • For fish, either of the following directories exist: $XDG_CONFIG_HOME/fish, $HOME/.config/fish.

    The error you saw here suggests that none of these files exists, which means that either you are not using one of the supported shells or you are using one but don't have an explicit configuration file for it in your home directory.

    If you are not using one of the supported shells then you can just skip this step because Terraform's autocomplete features aren't available for you. You don't actually need autocomplete to run Terraform.

    If you are using one of these shells, then make sure that the appropriate condition I mentioned above is true. If you need to create one of the files mentioned, it should be fine to create it just as an empty file and then Terraform's "install autocomplete" step will generate some additional configuration to enable autocomplete.