Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 5, 2025

Commands can define aliases via @alias tags in docblocks (e.g., @alias ls for a list command), but wp cli cmd-dump was not exposing this information. This is needed for handbook documentation generation and package scaffolding.

Changes

  • Modified command_to_array() in CLI_Command: Check get_alias() and include in output when present
  • Added test scenario in cli.feature: Verifies alias appears in JSON output for commands that define one

Example

Before:

{
  "name": "user-list",
  "description": "List users"
}

After:

{
  "name": "user-list",
  "description": "List users",
  "alias": "user-ls"
}

Closes prerequisite for handbook generation.

Original prompt

This section details on the original issue you should resolve

<issue_title>cmd-dump: include command alias</issue_title>
<issue_description>Prerequisite for wp-cli/handbook#588

If a command has an alias (@alias xyz in docblock, retrievable via get_alias()), it should be included in the output of the wp cli cmd-dump command. See command_to_array() method.

This way, we can mention the alias when generating handbook documentation or scaffolding the package readme.</issue_description>

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


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Include command alias in cmd-dump output Add command alias to cmd-dump output Nov 5, 2025
Copilot AI requested a review from swissspidy November 5, 2025 14:23
@codecov
Copy link

codecov bot commented Nov 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@swissspidy swissspidy marked this pull request as ready for review November 5, 2025 14:32
@swissspidy swissspidy requested a review from a team as a code owner November 5, 2025 14:32
@swissspidy swissspidy merged commit ebbc66a into main Dec 11, 2025
55 checks passed
@swissspidy swissspidy deleted the copilot/add-command-alias-to-dump branch December 11, 2025 14:48
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.

cmd-dump: include command alias

2 participants