WP CLI install list of plugins from YML file wp-cli.local.yml

First off a bit of background information. We want to keep our git repo as clean as possible and only include code that we write therefore when using wordpress we exclude all wordpress core code and any plugins not written by ourselves such as contact form 7.

However this poses a problem when a developer checks out the repo and there is very bare repo usually just consisting of the theme.

Read More

Therefore I want to use WP-CLI and within the repo to also contain a wp-cli.local.yml file with all of the wordpress configuration data so after a developer has checked out the repo they can simply run:

wp core download
wp core config
wp core install

This works perfectly so far but next I am attempting to install a list of plugins specified in the wp-cli.local.yml file by simply running

wp plugin install

However this does not look at the yml file and simply asks to specify the plugin. Upon reading the docs it seems as though this isn’t possible but wanted to check with fellow developers to see if this is indeed the case.

Here is an example of my wp-cli.local.yml file

path: public_html/
url: http://example.dev
user: admin
core skip-plugins:
- hello
core skip-themes:
- twentyfifteen
- twentyfourteen
- twentythirteen
core download:
locale: en_GB
core config:
dbname: example
dbuser: root
dbpass:
extra-php: |
define( 'WP_DEBUG', true );
define( 'WP_POST_REVISIONS', 10 );
core install:
title: Example
admin_user: admin
admin_password: admin
admin_email: admin@example.dev
plugin install:
- wordpress-seo
- wp-scss
- wp-sync-db

I understand what I am after is similar to yeoman generator but would like to use just one system to save complicated installations.

Related posts

Leave a Reply

1 comment