Skip to main content

CommandOptions

@webda/core


Interface: CommandOptions

Defined in: packages/core/src/services/command.ts:12

Options for the

Command​

decorator

Example​

@Command("serve", { description: "Start the HTTP server" })
async serve(port: number = 18080): Promise<void> { ... }

Properties​

description​

description: string

Defined in: packages/core/src/services/command.ts:17

Human-readable description of the command, displayed in --help output and shell tab completion


phase?​

optional phase?: "resolved" | "initialized"

Defined in: packages/core/src/services/command.ts:31

Lifecycle phase at which this command runs.

  • "initialized" (default): runs after Core.init() — full runtime including service.init() (DB, network).
  • "resolved": runs after Core.resolve() only — services are constructed and resolve()d but init() is skipped. Use for build-time codegen hooks that shouldn't touch the network.

requires?​

optional requires?: string[]

Defined in: packages/core/src/services/command.ts:24

Capabilities required by this command. Each string names a capability that must be provided by a configured service. If not configured, the CLI auto-injects the default provider from the capabilities map in webda.module.json.