Download WP-CLI
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
Test to see if it works correctly
php wp-cli.phar --info
Add extra permissions
chmod +x wp-cli.phar
Create a directory for tools like these
mkdir ~/tools/
Move wp-cli.phar to tools
mv wp-cli.phar ~/tools/
Edit your ~/.bash_profile
nano ~/.bash_profile
Add the following line
alias wp="php ~/tools/wp-cli.phar"
Reload your profile
source ~/.bash_profile
Test if it works with the alias
wp --info