https://make.wordpress.org/cli/handbook/config/#config-files is pretty good, but I'd like to have some more logic in my configuration. Is there a standard way for this?

For drush I have .drush/aliases.drushrc.php, which includes scripts from various Drupal repositories, which in turn contain the logic to handle various sites and variations (production, development). I'd like to have something similar for wp-cli, and YAML doesn't provide me with the right tools for what I want.

1 Answer 1


The WP CLI aliases are mostly for context. WP CLI uses Drush as a source of inspiration, but Drush has a much more robust implementation of aliases.

If it were me, I would include other scripts and complex logic as a custom command.

WP_CLI::add_command( 'core foo', 'Foo_Command' );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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