Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 11, 2025

The set command was used in examples (wp post meta set 123 _wp_page_template about.php) but not documented as a subcommand. Per agent instructions, WP-CLI now includes an optional alias field in command definitions that needs to be surfaced in documentation.

Changes

  • Template: Modified subcmd-list.mustache to display alias notation when present using Mustache conditional syntax {{#alias}}**Alias:** {{alias}}{{/alias}}

  • Generator: Extended gen_cmd_pages() in bin/command.php to automatically create alias documentation pages. When a command has an alias field, generates a separate page at the alias path with a backlink to the main command.

Result

When wp post meta update has alias: 'set' in its command definition:

  • commands/post/meta/update.md displays: Alias: set
  • commands/post/meta/set.md is generated with note: "This is an alias for wp post meta update"

Both commands are now discoverable in documentation, matching their runtime availability.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/Behat/Behat/zipball/51bdf81639a14645c5d2c06926f4aa37d204921b
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/Behat/Gherkin/zipball/e26037937dfd48528746764dd870bc5d0836665f
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/c216317e96c8b3f5932808f9b0f1f7a14e3bbf55
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/0ca86845ce43291e8f5692c7356fccf3bcf02bf4
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/845eb62303d2ca9b289ef216356568ccc075ffd1
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/e0f0e5a3dc819a4a0f8d679a0f2453d941976e18
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/134921bfca9b02d8f374c48381451da1d98402f9
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/composer/semver/zipball/198166618906cb2de69b95d7d47e5fa8aa1b2b95
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/nikic/PHP-Parser/zipball/dca41cd15c2ac9d055ad70dbfd011130757d1f82
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/php-parallel-lint/PHP-Console-Color/zipball/7adfefd530aa2d7570ba87100a99e2483a543b88
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/php-parallel-lint/PHP-Console-Highlighter/zipball/5b4803384d3303cf8e84141039ef56c8a123138d
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/php-parallel-lint/PHP-Parallel-Lint/zipball/6db563514f27e19595a19f45a4bf757b6401194e
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/5171cb6650e6c583a96943fd6ea0dfa3e1089a8a
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/phpstan/extension-installer/zipball/85e90b3942d06b2326fba0403ec24fe912372936
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/f94d246cc143ec5a23da868f8f7e1393b50eaa82
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/72a6721c9b64b3e4c9db55abbc38f790b318267e
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/b564ca479e7e735f750aaac4935af965572a7845
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/phpstan/phpstan/zipball/2770dcdf5078d0b0d53f94317e06affe88419aa8
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/sebastianbergmann/environment/zipball/24a711b5c916efc6d6e62aa65aa2ec98fef77f68
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/97ffee3bcfb5805568d6af7f0f893678fc076d2f
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6dc2e076d09960efbb0c1272aa9bc156fc80955e
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/sebastianbergmann/version/zipball/3e6ccf7657d4f0a59200564b08cead899313b53c
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/swissspidy/phpstan-no-private/zipball/f7a1890e350c8d8bf26370426a971d7490ae4245
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/symfony/console/zipball/6d9f0fbf2ec2e9785880096e3abd0ca0c88b506e
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/symfony/dependency-injection/zipball/baf614f7c15b30ba6762d4b1ddabdf83dbf0d29b
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/59eb412e93815df44f05f342958efa9f46b1e586
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/symfony/event-dispatcher/zipball/9dddcddff1ef974ad87b3708e4b442dc38b2261d
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/symfony/polyfill-php73/zipball/0f68c03565dcaaf25a890667542e8bd75fe7e5bb
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/symfony/service-contracts/zipball/45112560a3ba2d715666a509a0bc9521d10b6c43
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/symfony/translation-contracts/zipball/65a8bc82080447fae78373aa10f8d13b38338977
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/symfony/translation/zipball/2d01ca0da3f092f91eeedb46f24aa30d2fca8f68
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/symfony/var-exporter/zipball/03a60f169c79a28513a78c967316fbc8bf17816f
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/symfony/yaml/zipball/24dd4de28d2e3988b311751ac49e684d783e2345
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/theseer/tokenizer/zipball/7989e43bf381af0eac72e4f0ca5bcbfa81658be4
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/wp-cli/php-cli-tools/zipball/f12b650d3738e471baed6dd47982d53c5c0ab1c3
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/wp-cli/spyc/zipball/6aa0b4da69ce9e9a2c8402dab8d43cf32c581cc7
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)
  • https://api.github.com/repos/wp-cli/wp-cli-tests/zipball/ca81720aec0e93fde5ec6e3ca4d5ede65108b718
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QIjqJX /usr/bin/composer install --no-interaction ndor/bin/grep alias d nfig/composer/ve-v grep -l alias e/reset.md ep alias he/replace.md /opt/pipx_bin/grep grep (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Add set command to wp post meta documentation</issue_title>
<issue_description>The help docs show an example to set meta data for a post:
wp post meta set 123 _wp_page_template about.php

However, the set command is not included in the list of sub-commands for the wp post meta command.

Looking at the success message in the examples, it might be that set is an alias for update? If this is the case, it should be noted as such in the docs.

Reference: https://developer.wordpress.org/cli/commands/post/meta/</issue_description>

<agent_instructions>There's now an optional alias field if a command has an alias. If it's there, we should mention the alias in the documentation</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits December 11, 2025 14:55
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Copilot AI changed the title [WIP] Add set command to wp post meta documentation Add alias field support to command documentation generation Dec 11, 2025
Copilot AI requested a review from swissspidy December 11, 2025 15:05
@swissspidy
Copy link
Member

The workflow is currently failing because of an autoloader issue.

Specifically, WP_CLI_PACKAGES_DIR=bin/packages WP_CLI_CONFIG_PATH=/dev/null wp handbook gen-behat-docs fails, which errors with Uncaught Error: Interface "Behat\Behat\Context\SnippetAcceptingContext" not found in phar:///path/to/bin/wp/vendor/wp-cli/wp-cli-tests/src/Context/FeatureContext.php:36

So strangely, the wp-cli/wp-cli-tests package is in the bundled Phar, but of course behat/behat isn't, hence the class isn't found. wp-cli/wp-cli-bundle#823 would fix this.

But of course, ideally this would try to autoload the class from this package's vendor folder, not the Phar.

The issue seems to be with the wp-cli.yml.

If I remove it and run vendor/bin/wp handbook gen-behat-docs, then the command works.

^ @schlessera in case you have any ideas.

@schlessera
Copy link
Member

schlessera commented Dec 12, 2025

@swissspidy When you run anything with wp ..., it will use the Phar (and hence use the Phar's autoloader), and then the wp-cli.yml file will point it to the command to include with everything the Phar already has.

To make this work more reliably, we'd need to ensure that all dependencies are correctly declared here in the Composer file, and the run the command via vendor/bin/wp instead, which will then start with the autoloader in this repository (completely ignoring any Phar's, installed or not).

UPDATE: Oh, sorry, I did not notice that you already had the vendor/bin/wp in the command at the end. Let me check again what we could do here.

@schlessera
Copy link
Member

Not sure I understand the problem here correctly.

  • what workflow is currently failing?
  • did you try switching from wp to vendor/bin/wp without deleting the wp-cli.yml file?

@swissspidy
Copy link
Member

what workflow is currently failing?

In #590 and #606 I added a new GitHub Actions workflow that regenerates the handbook for us. It follows the README:

  1. Install nightly Phar
  2. Run bin/install_packages.sh
  3. Run WP_CLI_PACKAGES_DIR=bin/packages WP_CLI_CONFIG_PATH=/dev/null wp handbook gen-all

But it doesn't work, giving this error instead. Even when I do this locally. Specifically it's the handbook gen-behat-docs command that doesn't work.

did you try switching from wp to vendor/bin/wp without deleting the wp-cli.yml file?

Doesn't work, because then the command is loaded twice.

What I've tried:

  1. WP_CLI_PACKAGES_DIR=bin/packages WP_CLI_CONFIG_PATH=/dev/null wp handbook gen-behat-docs
    Doesn't work.
    Fatal error: Uncaught Error: Interface "Behat\Behat\Context\SnippetAcceptingContext" not found in phar:/...
  2. WP_CLI_PACKAGES_DIR=bin/packages WP_CLI_CONFIG_PATH=/dev/null vendor/bin/wp handbook gen-behat-docs
    Doesn't work.
    Fatal error: Cannot redeclare class WP_CLI\Handbook\Command .. (because it's once loaded via composer and once via wp-cli.yml)
  3. Delete wp-cli.yml and run vendor/bin/wp handbook gen-behat-docs
    Works.
  4. Delete wp-cli.yml and run wp handbook gen-behat-docs
    Doesn't work because the command isn't found (makes sense)

@swissspidy
Copy link
Member

wp-cli/wp-cli-tests#292 should fix some of the issues I've encountered here. Let's see...

@swissspidy swissspidy marked this pull request as ready for review December 17, 2025 20:56
@swissspidy swissspidy requested a review from a team as a code owner December 17, 2025 20:56
@swissspidy swissspidy merged commit 2c0b69a into main Dec 17, 2025
6 checks passed
@swissspidy swissspidy deleted the copilot/add-set-command-to-docs branch December 17, 2025 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add set command to wp post meta documentation

3 participants