Statamic comes with a useful CLI tool called please. Using please, you can do all sorts of things, from deleting content to adding new users, clearing the cache to generating assets using presets.
However by default, Statamic's please can only be triggered by calling
php please. It's a minor thing, but the whole idea of it being called please is a bit annoying if you need to prepend php to the command.
php please clear:site doesn't exactly have the same ring to it as
please clear:site, does it?
Luckily, removing the need to add php before please is easy.
Open your terminal and open your bash profile with a text editor. (I'll be using nano for this tutorial).
Go to a new line and type:
alias please="php please"
Press Ctrl+O to save and then Ctrl+X to exit.
Navigate to a Statamic site and enter
please. It should bring up the options available with the please cli tool.
Of course, this is really flexible. As the guys over at Statamic pointed out over on Twitter, you could easily set it to
Or even “plz”! Save those precious characters while you’re at it!— Statamic (@statamic) 18 May 2018
Now excuse me while I go and alias
exit to work with
How to create an alias in Mac
How to create an alias in Linux