Skip to content

Should node support subcommands? #53483

Open
@MoLow

Description

@MoLow

What is the problem this feature will solve?

currently, node's cli interface is pretty simple and lean,
it mainly accepts flags that start with two dashes, or sometimes a single dash for some aliases.
additionally, many flags depend on each other or imply using another flag.

now that more and more flags are added to node, (and each new flag is heavily considered before adding to avoid options bloat), I propose we support a more complex cli interface with sub-commands.
this issue has come up before when adding node --run, and to avoid blocking that - the discussion was postponed, so I went ahead and opened this issue.

If I recall, the main concern was node run or node test is a breaking change since it today runs node run.js or node test.js accordingly - that can be addressed with releasing this gradually as semver-major with a deprecation warning for a few versions prior to the actual change

some groups/clusters of commands that might fit using sub commands:

  • node --run
  • node --watch, --watch-path
  • node --test
  • node --build-snapshot

What is the feature you are proposing to solve the problem?

N/A

What alternatives have you considered?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    cliIssues and PRs related to the Node.js command line interface.feature requestIssues that request new features to be added to Node.js.

    Type

    No type

    Projects

    Status

    Triaged

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions