Configuring CLI autocomplete

The CDP CLI includes a command-completion feature that enables you to use the Tab key to complete a partially entered command. Because the feature is not automatically installed, you must configure it manually.

  1. Locate the CLI completer.
    which cdp_completer
  2. Add the CLI completer folder to your path:
    1. Find the profile script for the shell profile script in your user folder.
      ~/.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 and press the Tab key to display the available options for autocomplete.