Pachctl Auto-completion

HPE Machine Learning Data Management auto-completion allows you to automatically finish partially typed commands by pressing TAB.

Before You Start

  • You must already have PachCTL installed

How to Install Auto-Completion

  1. Verify that bash-completion is installed on your machine. For example, if you have installed bash completion by using Homebrew, type:

    brew info bash-completion

    This command returns information about the directory in which bash-completion and bash completion scripts are installed. For example, /usr/local/etc/bash_completion.d/. You need to specify the path to bash_completion.d as the path to which install pachctl autocompletion. Also, the output of the info command might have a suggestion to include the path to bash-completion into your ~/.bash_profile file.

  2. Install pachctl autocompletion:

    pachctl completion bash --install --path <path/to/bash-completion>

    For example, if you specify the path to bash-completion as /usr/local/etc/bash_completion.d/pachctl, your system response looks like this:

    System response:

    Bash completions installed in /usr/local/etc/bash_completion.d/pachctl, you must restart bash to enable completions.
  3. Restart your terminal. pachctl autocomplete should now be enabled in your system.

  1. Install zsh-completions:

    brew install zsh-completions
  2. Install pachctl autocompletion:

    You’ll need to install this in the same directory your zsh-completions are installed in. You can run the following to find the correct path:

    echo $fpath
    pachctl completion bash --install --path /opt/homebrew/share/zsh-completions/_pachctl
  3. Restart your terminal; pachctl autocomplete should now be enabled in your system.

    If you run into warnings in your terminal related to zsh compinit: insecure directories, you can run the following to fix it:

    chmod go-w /opt/homebrew/share

Testing

You can perform the following tests to verify that pachctl autocompletion is working:

  1. Open a new terminal.

  2. Input the following:

    pachctl v
  3. Hit TAB. You should see the following output:

    validate  -- Validate the specification of a Pachyderm resource.
    version   -- Print Pachyderm version information.