wp-cli / ideas

💡 Ideas and feature requests are collected here
40 stars 1 forks source link

Add usage of environment variables in aliases #165

Open Amund opened 2 years ago

Amund commented 2 years ago

Since Drush 9, we can use environment variables in aliases definitions, which is a great feature to centralize datas in .env file.

In short, ${env.PROJECT_SSH_USER} is replaced by PROJECT_SSH_USER environment value, as described in https://www.drush.org/latest/site-aliases/#environment-variables

There are other related features (eg. env-vars), but I think this interpolation could be a nice addition to wp-cli aliases in a first place.

danielbachhuber commented 1 year ago

Sounds great! Would love to see a pull request for this. We can follow Drush's implementation.

danielbachhuber commented 1 year ago

Related https://github.com/wp-cli/wp-cli/issues/5566