Skip to content

Latest commit

 

History

History
54 lines (46 loc) · 1.58 KB

File metadata and controls

54 lines (46 loc) · 1.58 KB

Enabling shell auto-completion

hostinger has auto-complete support. This makes it easier to use the CLI and improves user experience by completing command names by clicking TAB key. For example if you type hostinger vps dat<TAB> with auto-completion enabled, shell will automatically append rest of the command: hostinger vps data-centers.

Auto-completion can be generated for multiple shells. The currently supported shells are:

  • Bash
  • Zsh
  • fish
  • PowerShell

After adding shell auto-completion, remember to refresh your shell profile by logging out from the shell and log back in.

Bash

Linux:

hostinger completion bash > /etc/bash_completion.d/hostinger

macOS:

hostinger completion bash > /usr/local/etc/bash_completion.d/hostinger

Zsh

If shell completion is not already enabled in your environment, you will need to enable it. You can execute the following once:

echo "autoload -U compinit; compinit" >> ~/.zshrc

To load completions for each session, execute once:

hostinger completion zsh > "${fpath[1]}/_hostinger"

You will need to start a new shell for this setup to take effect.

Fish

hostinger completion fish | source

To load completions for each session, execute once:

hostinger completion fish > ~/.config/fish/completions/hostinger.fish

PowerShell

hostinger completion powershell | Out-String | Invoke-Expression

To load completions for every new session, run:

hostinger completion powershell > hostinger.ps1

and source this file from your PowerShell profile.