From d83633f0f9f79956807f6f452768e03cb7075726 Mon Sep 17 00:00:00 2001 From: Kamran Abdul Aziz Date: Fri, 27 Nov 2026 17:08:47 +0530 Subject: [PATCH] Explain that only one project config file is read The Config files section lists wp-cli.local.yml and wp-cli.yml as if both are read. WP-CLI uses only the first of them it finds, so in a folder with both, wp-cli.yml is ignored unless wp-cli.local.yml inherits it. --- references/config.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/references/config.md b/references/config.md index aab3b1b8..600e3481 100644 --- a/references/config.md +++ b/references/config.md @@ -271,6 +271,15 @@ WP-CLI can automatically discover and read options from a few configuration file 1. `wp-cli.yml` file inside the current working directory (or upwards). 1. `~/.wp-cli/config.yml` file (path can be changed by setting the `WP_CLI_CONFIG_PATH` environment variable). +WP-CLI reads only one project config file: starting in the current working directory and moving upwards, it uses the first `wp-cli.local.yml` or `wp-cli.yml` it finds. In a folder that has both, `wp-cli.local.yml` is used and `wp-cli.yml` is ignored. To use both, inherit `wp-cli.yml` from `wp-cli.local.yml`: + +``` +_: + inherit: wp-cli.yml +``` + +The global config file is still read as well. + Besides the global parameters described above, configuration files can also contain defaults for any subcommand, as well as aliases to one or more WordPress installs. Here's an annotated example `wp-cli.yml` file: