Configuring CLI autocomplete

To configure CLI autocompletion, you must have two pieces of information: the name of the shell you're using and the location of the cdp_completer script.

The CDP CLI includes a command-completion feature that enables you to use the Tab key to complete a partially entered command. This feature isn't automatically installed, so you need to configure it manually. When you partially enter a command, parameter, or option, the command-completion feature either automatically completes your command or displays a suggested list of commands. To prompt command completion, you partially enter a command and press Tab.
  1. Locate the CLI completer.
    which cdp_completer
  2. Add the completer's folder to your path:
    1. Find your shell's profile script in your user folder.
      For example:
      ~/.bash_profile
    2. Add the following command to your bash_profiler, replacing /usr/local/bin/cdp_completer with the actual location discovered in the previous sub-step:
      complete -C /usr/local/bin/cdp_completer cdp
    3. Reload the profile into the current session to put the changes into effect. Replace .bash_profile with the name of the shell script you discovered in the first sub-step:
      $ source ~/.bash_profile
  3. Enter cdp <TAB> to display the available options for autocomplete.