I need to spin up installations for development, so I came up with this.
It requires some other setup, like /etc/hosts, and /etc/nginx, and installing some certificates.
All the relevant files, including this script are in wc/installer.
#! /bin/bash
cd /home/johnk/wc
cp installer/composer.json .
test \! -f wp-config-sample.php && wp core download
test \! -f wp-config.php && wp config create --dbname=wc --dbuser=root --dbpass=new_password
wp core install --url=https://wc.lo --title=wc --admin_user=admin --admin_email=landofziploc@gmail.com
wp plugin install woocommerce --activate
composer update
wp user reset-password admin --skip-email --show-password > installer/last_password
cat installer/last_password