Skip to content

group

Generated reference page for the group function export.

Signatures

ts
function group(name: string): CommandBuilder;
ParameterTypeDescription
namestringThe group name used for dispatch (e.g. 'db').

Members

Members

group

Create a command builder intended for use as a command group.

Semantically identical to command() — a group is simply a command that has subcommands registered via .command(). The separate factory communicates intent: groups organise subcommands, leaf commands have actions.

A group may also have its own .action() (e.g. git remote lists remotes when invoked without a subcommand, but dispatches to git remote add, etc.).

ts
(name: string): CommandBuilder;

Examples

ts
const db = group('db')
  .description('Database operations')
  .command(migrateCmd)
  .command(seedCmd);

See Also

Released under the MIT License.