WP-CLI can read default options from a few configuration file types (when present):
wp-cli.local.ymlfile inside the current working directory (or upwards).
wp-cli.ymlfile inside the current working directory (or upwards).
~/.wp-cli/config.ymlfile (path can be changed by setting the
To always require a specific file when running WP-CLI, you can include a require statement in one of the aforementioned configuration files like so:
require: - path/to/file.php
Learn more about WP-CLI’s config system on the WP-CLI website.