Skip to content

Conversation

@adamziel
Copy link
Collaborator

@adamziel adamziel commented Nov 21, 2025

Motivation for the change, related issues

Running wp-playground --help previously displayed all CLI flags in one long list, making it difficult to tell which flags are relevant to which command. This PR scopes flags to their relevant commands so that running wp-playground server --help shows only the flags relevant to the server command.

Implementation details

Refactors the CLI option declarations from a long chain of .option() calls to object-based option groups:

  • sharedOptions: Options available to all commands (php, wp, mount, blueprint, etc.)
  • serverOnlyOptions: Options specific to the server command (port, multi-worker, devtools)
  • buildSnapshotOnlyOptions: Options specific to the build-snapshot command (outfile)

A commandWithOptions() helper function applies the appropriate options to each command, combining shared options with command-specific ones.

Testing Instructions

Run wp-playground --help to see the cleaner top-level help, then run wp-playground server --help or wp-playground build-snapshot --help to verify command-specific options are displayed correctly.

@adamziel adamziel force-pushed the move-flags-docs-to-relevant-commands branch from c31bee7 to ecde246 Compare November 21, 2025 23:08
@adamziel adamziel changed the title Update the cli documentation format for commands [CLI] Define CLI --flags for each command individually Nov 21, 2025
@adamziel adamziel force-pushed the move-flags-docs-to-relevant-commands branch from 0699caf to 3f1c0a3 Compare December 12, 2025 20:05
The file-locking test suite was using the default port 9400, which could
conflict with other tests running in parallel. Added explicit port 9600
to avoid EADDRINUSE errors on Windows CI.
All tests in run-cli.spec.ts now use port 9500 via suiteCliArgs to avoid
port conflicts when tests run in parallel or cleanup is slow on Windows.
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.

2 participants