DEV Community

Ngobrolin IT
Ngobrolin IT

Posted on

Tutorial Install WP CLI di Mac OS

Haloo dev 👋

Di tutorial kali ini aku akan share tutorial menginstall WP CLI di Mac OS. Nah sebelumnya aku pernah share juga tentang install WP CLI di Windows 11. Buat pengguna Windows bisa ikuti tutorial tersebut.

Sebenarnya WP CLI kurang optimal jika dijalankan di sistem operasi Windows, karena WP CLI akan berjalan secara optimal di lingkungan UNIX seperti Mac OS ataupun Linux. Kalian bisa lihat kebutuhan minimal untuk WP CLI di website WP CLI.

Install Menggunakan Homebrew

Untuk menginstall WP CLI di Mac OS, aku sarankan install melalui homebrew. Nah yang belum tau apa itu homebrew kalian bisa baca dan ikuti Tutorial Install Homebrew di Mac OS supaya kalian tahu fungsi dan tujuan homebrew dan bagaimana cara installnya.

Nah jika Mac OS kalian sudah terinstall homebrew jalankan perintah berikut untuk install

brew install wp-cli
Enter fullscreen mode Exit fullscreen mode

Nah setelah selesai kalian bisa coba check dengan perintah berikut

wp --info
Enter fullscreen mode Exit fullscreen mode

Install Manual

Pertama download terlebih dahulu file wp-cli.phar menggunakan perintah curl atau wget

curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
Enter fullscreen mode Exit fullscreen mode

Kemudian check file wp-cli.phar ini apakah bisa berjalan dengan baik

php wp-cli.phar --info
Enter fullscreen mode Exit fullscreen mode

Supaya wp-cli.phar ini bisa diakses menggunakan perintah wp, pindahkan file tersebut ke direktori /usr/local/bin/wp

chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp
Enter fullscreen mode Exit fullscreen mode

Nah setelah selesai kalian bisa coba check dengan perintah berikut

wp --info
Enter fullscreen mode Exit fullscreen mode

Untuk list perintah-perintah yang ada di WP CLI bisa kalian baca di sini

Selamat mencoba..

Do your career a favor. Join DEV. (The website you're on right now)

It takes one minute and it's free.

Get started

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay