2

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.

  • Try installing msysgit or git bash, and install it (and run it) from there. Most features should work on a Windows machine – Dan Ștefancu Jan 20 '15 at 21:07
  • Thanks ... I ended up going with vagrant, which might be a bit overkill but I can appreciate what you're suggesting ... might try it if vagrant gets the better of me ... not exactly windows friendly any of this stuff – byronyasgur Jan 21 '15 at 0:56
4

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

1

It is possible to install Composer and then install wp-cli . Under Alternative-Install-Methods it says to use wp-cli/bin/wp.bat, although I didn't like typing that path.

After installing in the manner mentioned, I created a wp.bat in my WordPress root along side wp.phar with the following contents:

@ECHO OFF
php "wp-cli/php/boot-fs.php" %*

Seems to work for what little I use it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.