[wp-trac] [WordPress Trac] #63564: Dev environment should incorporate enhancements from wp-env for speed and non-interactive usage

WordPress Trac noreply at wordpress.org
Fri Jun 13 23:22:59 UTC 2025


#63564: Dev environment should incorporate enhancements from wp-env for speed and
non-interactive usage
-----------------------------------+--------------------------
 Reporter:  westonruter            |       Owner:  westonruter
     Type:  defect (bug)           |      Status:  reopened
 Priority:  normal                 |   Milestone:  6.8.2
Component:  Build/Test Tools       |     Version:
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch fixed-major  |     Focuses:
-----------------------------------+--------------------------

Comment (by westonruter):

 With this change, if you previously invoked `npm run env:cli` with a `wp`
 then this must be omitted now.

 However, I just realized that actually it was supposed to work without an
 explicit `wp`, for example `npm run env:cli pwd` previously would print
 out `/var/www` and doesn't get routed to WP-CLI, whereas now this results
 in a WP-CLI error:

 > Error: 'pwd' is not a registered wp command. See 'wp help' for available
 commands.

 See [https://github.com/WordPress/wordpress-
 develop/pull/8969/files#r2145430758 comment] from @jorbin:

 > Since this is technically a breaking change, I searched github for `npm
 run env:cli wp` and there is [https://github.com/Antonin06/wc-
 bretagne-2024/blob/main/.github/workflows/tests-php.yml#L75 only one
 reference] which seems to be from a fork of a demo rather than actual
 production code, but it still might be worth a PR there after this lands
 and a quick note in the core room so folks are aware. I don't think it
 needs a dev note though since this isn't a public API.

 So it seems in practice that this command is always used for WP-CLI. See
 also
 [https://github.com/search?q=%2Fnpm+run+env%3Acli%28+--%29%3F+%5B%5Ew%3C-%5D%2F&type=code
 another GitHub search].

 If we want to restore the ability to run arbitrary commands, perhaps this
 should be introduced as a separate command instead of overloading
 `env:cli`. As it stands right now, the this [https://github.com/WordPress
 /wpdev-docker-
 images/blob/becc6740684d6ff6414d6539df040633b5ac5794/entrypoint
 /entrypoint-cli.sh#L6-L17 overloading] could cause ambiguity, when you
 expect to run a system command but actually there is a WP-CLI command
 registered with the same name.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/63564#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list