So, you’ve been happily using Laravel Herd because, hey, who wants the hassle of dealing with Homebrew PHP dependencies, right? But suddenly, you’re stuck needing to install WP-CLI. Don’t worry; I got you. We’re going to install WP-CLI directly into the Laravel Herd bin directory. No Brew, no fuss. Just the good stuff.
Why Skip Homebrew?
Installing WP-CLI via Homebrew means dealing with additional PHP installations, and who needs extra bloat? Let’s keep things lean, clean, and simple.
And, since we are using Laravel Herd, composer and php are already served from here, not from Homebrew directory.
Here’s how you do it:
1. Grab WP-CLI:
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
2. Make it executable:
chmod +x wp-cli.phar
2. Move WP-CLI to Laravel Herd’s bin
directory:
mv wp-cli.phar ~/Library/Application\ Support/Herd/bin/wp
3. Confirm installation:
wp --info
You’ll see something like:
WP-CLI version: X.Y.Z
Test it out
Navigate into your WordPress project and run:
wp core version
If it spits out your WordPress version, congratulations! You’re all set!
No more Homebrew PHP clutter. Just a smooth, hassle-free WP-CLI experience neatly tucked into Laravel Herd’s bin directory. Easy life, happy coding!