WP-CLI » Setup tab completions for WP-CLI

Setup tab completions for WP-CLI

Tab completion is a useful time-saving feature of command line interfaces. To enable tab completion for WP-CLI We need to edit the ~/.bash_profile file.

Step 1. In your home directory download WP-CLI tab completion file

curl -O https://raw.githubusercontent.com/wp-cli/wp-cli/master/utils/wp-completion.bash || wget https://raw.githubusercontent.com/wp-cli/wp-cli/master/utils/wp-completion.bash

Step 2. Edit your ~/.bash_profile

nano ~/.bash_profile

and add the following line: source ~/wp-completion.bash

image 38 - Setup tab completions for WP-CLI

Save and exit.

Step 3. Source the profile file by running

source ~/.bash_profile

That’s it, now at the terminal just type wp and hit Tab twice to see all tab completions.

image 39 - Setup tab completions for WP-CLI
See also  Install WP-CLI on cPanel shared hosting

Was this post helpful?

Leave a Comment

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.