Keyboard shortcut/aliases for the WP CLI, Git, Grunt & PHPCS commands for windows

In development, We spend a lot of time on the command line. We type a lot of commands on regularly.

I have created a shortcut for the most of the commands which I use on a daily basis some of them are below:


Command Keyboard Shortcut/Aliases
wp theme list wpthl
wp plugin list wppll

Check all the available WP CLI commands etc. (all WP CLI commands list)

Example 1. Using shortcut wpthl instead of wp theme list

Example 2. Using shortcut wppll instead of wp plugin list

Some more commands with keyboard shortcuts/aliases are below:


Command Keyboard Shortcut/Aliases
grunt release grr
grunt minify grm


Command Keyboard Shortcut/Aliases
phpcs pb
phpcbf pbf


Command Keyboard Shortcut/Aliases
git add . gaa
git commit –message gcm
git checkout gco
git pull origin gpu
git push origin gpp
git status gs

To create keyboard shortcuts using aliases is very simple. We can create any command shortcut/aliases.

Follow below simple steps:

  1. Open the file .bashrc which is found in location  C:\Users\USERNAME\.bashrc and
  2. Add below sample commands of Git & Grunt.

I found the article Terminal/Bash Command-Line Shortcuts with Aliases written by @jonsuh to create keyboard shortcuts for the Terminal/Git Bash.

I have added some more commands of Grunt, WP CLI & PHPCS on my local environment.

Update PHP Codesniffer (PHPCS), WordPress Coding Standards (WPCS), PHP Compatibility (WIMG)

Update PHP Codesniffer (PHPCS), WordPress Coding Standards (WPCS), PHP Compatibility (WIMG)

Copy below individual or all command(s) to get latest update.

composer global require squizlabs/php_codesniffer
composer global require wp-coding-standards/wpcs
composer global require phpcompatibility/php-compatibility
composer global require dealerdirect/phpcodesniffer-composer-installer

Update: 26 – March 2019

Getting notice Package wimg/php-compatibility is abandoned, you should avoid using it. Use phpcompatibility/php-compatibility instead. while updating the plugin.

To fix this issue:

Used composer global require phpcompatibility/php-compatibility

Instead of composer global require wimg/php-compatibility


λ composer global require phpcompatibility/php-compatibility                                                                                                      
Changed current directory to C:/Users/MaheshW/AppData/Roaming/Composer                                                                                            
Using version ^9.1 for phpcompatibility/php-compatibility                                                                                                         
./composer.json has been updated                                                                                                                                  
Loading composer repositories with package information                                                                                                            
Updating dependencies (including require-dev)                                                                                                                     
Package operations: 1 install, 0 updates, 0 removals                                                                                                              
  - Installing phpcompatibility/php-compatibility (9.1.1): Downloading (100%)                                                                                     
phpcompatibility/php-compatibility suggests installing roave/security-advisories (dev-master || Helps prevent installing dependencies with known security issues.)
Package wimg/php-compatibility is abandoned, you should avoid using it. Use phpcompatibility/php-compatibility instead.