group
Generated reference page for the group function export.
- Import:
@kjanat/dreamcli - Export kind: function
- Declared in:
src/core/schema/command.ts - Source link:
packages/dreamcli/src/core/schema/command.ts:1461
Signatures
ts
function group(name: string): CommandBuilder;| Parameter | Type | Description |
|---|---|---|
name | string | The 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);Related Examples
- Multi-command CLI with nested command groups (git-like). -
examples/standalone/multi-command.ts