You should be able to define aliases in wp-cli.yml like this:
@subsite
path: subsite-path
And then you should be able to call:
wp @subsite option get home
Or whatever, have it work. Thing is, WP-CLI requires that the @subsite alias part be the absolute first argument. And Local has this in .bashrc:
alias wp=“wp --allow-root”
So when you type:
wp @subsite option get home
It is actually running:
wp --allow-root @subsite option get home
It’s a regular old battle of the aliases.
This works:
/usr/local/bin/wp @subsite --allow-root option get home
But that’s tedious. Could the alias in .bashrc be re-worked into a function that senses if the first argument starts with “@” and in that case inserts --allow-root AFTER that?