Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IHandlerParameters

The handler parameters are passed to the instantiated command handler and populated by the command processor. The parameters supply everything a command handler needs to operate: arguments, response object, profiles, the command definition document, and more.

Handlers should NEVER perform their own console/stdout/stderr invocations. The response object is provided for all messaging and logging capabilities.

export
interface

IHandlerParameters

Hierarchy

  • IHandlerParameters

Index

Properties

arguments

The arguments specified by the user on the command line (in the Yargs object format).

memberof

IHandlerParameters

definition

definition: ICommandDefinition

The command definition node that defines the command being issued.

memberof

IHandlerParameters

fullDefinition

fullDefinition: ICommandDefinition

The full command definition tree that includes the command being issued.

memberof

IHandlerParameters

Optional isChained

isChained: boolean

Has your command been invoked from a chained handler? (see ICommandDefinition.chainedHandlers) You can use this to influence the behavior of your command (e.g. not printing certain messages from within a chained command)

positionals

positionals: string[]

The positional options specified by the user on the command line.

memberof

IHandlerParameters

profiles

profiles: CommandProfiles

The set of profiles loaded for this command handler - the map is built with the key being the type and it returns the set of profiles loaded of that type. Multiple profiles can be loaded of the same type - depending on the request and the 0th entry is the first loaded.

deprecated

This API only loads v1 profiles. To load v2 profiles, use ImperativeConfig.instance.config.api.profiles.

memberof

IHandlerParameters

response

The response object used to issue messages and build responses to the command. No command should be writing to console/stdout/stderr directly. The response object provides the capability of collecting responses for the JSON response format (among other capabilities). A handler can choose to log differently, however a logger is also provided on the command response object.

memberof

IHandlerParameters

stdin

stdin: stream.Readable

The input stream that can be used by the command being issued.

memberof

IHandlerParameters

Generated using TypeDoc