How Can I setup WP CLI on Windows development machine running AMPPS?

I want to setup WP CLI. On the home page it says that it needs a UNIX like operating system.

I am running windows 7 for development but I could probably setup a virtual Ubuntu box or something. Would I run that alongside my existing ampps setup or would I need to setup a new local server inside the inux box or how would it work. And are there other options. I have seem that running it with composer seems to be an option, in fact as far as I can tell it’s the only mention of windows on the website. Are there any tried and tested setups that would work for windows users.

2 Answers
2

Installing wp-cli through Composer is the way to go. For instance:

  1. $ cd C:\
  2. $ composer create-project wp-cli/wp-cli --no-dev
  3. Copy the path to the bin directory inside the wp-cli directory (something along the lines of C:\wp-cli\bin)
  4. Add copied path to the Windows Path variable (tutorial)

Exit all CMD’s (or git bash) and reopen them. Now go to one of your WordPress installs and type wp core version. You should get the WP version

Leave a Comment