Skip to content

Extended CLI commands no longer appear in -h or --help output #10681

Closed
@sserrata

Description

@sserrata

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

Description

Using extendCli to extend the docusaurus CLI with new commands no longer includes those commands, i.e. usage, description, arguments, options, when executing docusaurus --help or docusaurus -h.

However, the extended commands do appear in the console output after attempting to call an unknown command.

I verified that extended command usage does appear in prior docusaurus release, e.g. v2.4.3 but have not tested releases in between that and the current release.

Reproducible demo

https://codesandbox.io/p/devbox/elegant-water-docusaurus?privacy=public

Steps to reproduce

  1. Bootstrap a fresh docusaurus site
  2. Create the example plugin referenced in the extendCli docs.
  3. Update docusaurus.config.js to include the new plugin.
  4. Execute yarn docusaurus -h and observe the extended command is not present in help output.
  5. Execute yarn docusaurus foo and observe the extended command in the output.

Expected behavior

When executing yarn docusaurus -h I expect to see my extended command usage, description, options, etc., in the output.

Actual behavior

Running yarn docusaurus -h not not include the usage for my extended command. However, my extended command does appear when I attempt to pass an invalid command argument.

Your environment

Self-service

  • I'd be willing to fix this bug myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn error in the Docusaurus core causing instability or issues with its execution

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions