WP-CLI can read default options from a few configuration file types (when present):
-
wp-cli.local.yml
file inside the current working directory (or upwards). -
wp-cli.yml
file inside the current working directory (or upwards). -
~/.wp-cli/config.yml
file (path can be changed by setting theWP_CLI_CONFIG_PATH
environment variable).
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.