CommandDefinition
Type Alias: CommandDefinition
CommandDefinition =
object
Defined in: definition.ts:402
Definition of a CLI command declared via the @Command decorator on a service method.
Written into webda.module.json under moddas[serviceName].commands or
beans[serviceName].commands by the CommandsMetadata compiler plugin.
Example
{
"description": "Start the HTTP server",
"method": "serve",
"args": {
"bind": { "type": "string", "default": "127.0.0.1", "alias": "b" },
"port": { "type": "number", "default": 18080, "alias": "p" }
}
}
Properties
args
args:
object
Defined in: definition.ts:417
Map of argument name to its definition. Keys are method parameter names,
which become --flag names in the CLI.
Index Signature
[name: string]: CommandArgDefinition
description
description:
string
Defined in: definition.ts:407
Human-readable description of the command, displayed in CLI help output.
Extracted from the description option in @Command("name", { description: "..." }).
method
method:
string
Defined in: definition.ts:412
Name of the method on the service class that handles this command.
The shell calls service[method](...args) when the command is invoked.
phase?
optionalphase?:"application"|"resolved"|"initialized"
Defined in: definition.ts:431
Lifecycle phase at which this command runs.
"initialized"(default when omitted): afterCore.init()."resolved": afterCore.resolve()only. No service.init() called. Used for build-time hooks (e.g.@BuildCommand)."application": with the loaded application only, no Core. The method is static.
requires?
optionalrequires?:string[]
Defined in: definition.ts:423
Capabilities required by this command. The CLI resolves these against the capabilities map and auto-injects missing services before booting Core.