Interface describing the syntax and behavior definition of a command or group of commands

### Hierarchy

- ICommandDefinition

### Indexable

[key: string]: any

Index signature

## Index

### Properties

- aliases
- chainedHandlers
- children
- customize
- deprecatedReplacement
- description
- enableStdin
- examples
- experimental
- handler
- mustSpecifyOne
- name
- onlyOneOf
- options
- outputFormatOptions
- passOn
- positionals
- profile
- stdinOptionDescription
- summary
- type

## Properties

### Optional aliases

aliases: string[]

- Defined in @zowe/imperative/src/cmd/src/doc/ICommandDefinition.ts:70

Aliases - any number of single or more character aliases can be specified.

memberof

  ICommandDefinition

### Optional chainedHandlers

chainedHandlers: IChainedHandlerEntry[]

- Defined in @zowe/imperative/src/cmd/src/doc/ICommandDefinition.ts:119

Build this command from multiple handlers chained together, remapping the response to arguments for future handlers in the command.

Limitations of chained handlers include:

- The syntax of the command for each handler is not validated, since the full definition is not provided
- You can only map arguments from the "data" field of the command response, so whatever you need to pass to a future handler in the chain must be passed to response.data.setObj

memberof

  ICommandDefinition

### Optional children

children: ICommandDefinition[]

- Defined in @zowe/imperative/src/cmd/src/doc/ICommandDefinition.ts:126

The Children for this command - used when the type is provider or group. Use the children to build complex nested syntaxes - however Zowe modules must follow the prescribed command syntax structure for Zowe.

memberof

  ICommandDefinition

### Optional customize

customize: any

- Defined in @zowe/imperative/src/cmd/src/doc/ICommandDefinition.ts:163

The command handlers are passed the definition document for the command. You can place any additional "custom" definition information here.

memberof

  ICommandDefinition

### Optional deprecatedReplacement

deprecatedReplacement: string

- Defined in @zowe/imperative/src/cmd/src/doc/ICommandDefinition.ts:93

If this property exists, the command is deprecated. The property value is a string that identifies the replacement command. It is used in a deprecation message similar to the following: This command is deprecated. Recommended replacement: value_of_deprecatedReplacement_goes_here

memberof

  ICommandDefinition

### description

description: string

- Defined in @zowe/imperative/src/cmd/src/doc/ICommandDefinition.ts:46

The description - keep group descriptions "small" and include lengthier descriptions for "commands".

memberof

  ICommandDefinition

### Optional enableStdin

enableStdin: boolean

- Defined in @zowe/imperative/src/cmd/src/doc/ICommandDefinition.ts:76

If true, stdin will automatically be read before the handler of this command is invoked.

memberof

  ICommandDefinition

### Optional examples

examples: ICommandExampleDefinition[]

- Defined in @zowe/imperative/src/cmd/src/doc/ICommandDefinition.ts:99

The set of examples displayed in the help for this command.

memberof

  ICommandDefinition

### Optional experimental

experimental: boolean

- Defined in @zowe/imperative/src/cmd/src/doc/ICommandDefinition.ts:172

Is this command experimental? If you set this to true, the command will be marked with help text indicating that it is experimental. If this command is of type "group" all descendant commands will be marked experimental as well.

memberof

  ICommandDefinition

### Optional handler

handler: string

- Defined in @zowe/imperative/src/cmd/src/doc/ICommandDefinition.ts:107

The handler for this command - this is a string literal that is used on the "require" statement to load the command handler - The handler itself must implement ICommandHandler. A string is used over an actual instance because we do not want the handler (and its required dependencies) to be loaded before it is issued.

memberof

  ICommandDefinition

### Optional mustSpecifyOne

mustSpecifyOne: string[]

- Defined in @zowe/imperative/src/cmd/src/doc/ICommandDefinition.ts:144

Must specify one indicates that you must specify one of the options listed.

memberof

  ICommandDefinition

### name

name: string

- Defined in @zowe/imperative/src/cmd/src/doc/ICommandDefinition.ts:40

The command or group name

memberof

  ICommandDefinition

### Optional onlyOneOf

onlyOneOf: string[]

- Defined in @zowe/imperative/src/cmd/src/doc/ICommandDefinition.ts:150

Only one of the listed options can be specified

memberof

  ICommandDefinition

### Optional options

options: ICommandOptionDefinition[]

- Defined in @zowe/imperative/src/cmd/src/doc/ICommandDefinition.ts:132

The options to be exposed on the command.

memberof

  ICommandDefinition

### Optional outputFormatOptions

outputFormatOptions: boolean

- Defined in @zowe/imperative/src/cmd/src/doc/ICommandDefinition.ts:206

Enable output format options (e.g. "--response-format-type"). The output format options are applied to data that is presented to the handler response format APIs (see IHandlerResponseApi, "format" property). The intent of of the output format options:

1. Simplify the code in a command handler. A "common" use-case for handler output is printing tables (or lists) of JSON objects/data OR a single JSON response object.

2. Passing the data described in (1) to the handler response format API and enabling the format options gives the user full control over the output format. They can choose to output an array of JSON objects as a table OR a list of prettified objects. The use can also choose to include table headers and filter fields. The user can also reduce the output of a table to a single column (or a JSON object to a single property) eliminating the need to manually code options such as "--only-print-this-one-field"

See the "ICommandOutputFormat" JSDoc for details on the format types.

The options enabled:

--response-format-type [table|list|object|string]

Allows the user to control the output format of the data. See the "ICommandOutputFormat" interface for details.

--response-format-filter [array of fields]

Allows the user to include only the fields specified in the filter array.

--response-format-header [boolean]

Allows the user to optionally include the header with a table.

memberof

  ICommandDefinition

### Optional passOn

passOn: ICommandDefinitionPassOn[]

- Defined in @zowe/imperative/src/cmd/src/doc/ICommandDefinition.ts:64

Pass on attributes of the current definition node to children

memberof

  ICommandDefinition

### Optional positionals

positionals: ICommandPositionalDefinition[]

- Defined in @zowe/imperative/src/cmd/src/doc/ICommandDefinition.ts:138

The positional arguments to be exposed on the command.

memberof

  ICommandDefinition

### Optional profile

profile: ICommandProfile

- Defined in @zowe/imperative/src/cmd/src/doc/ICommandDefinition.ts:156

Auto-loading of profile specifications - see the interface definition for more details.

memberof

  ICommandDefinition

### Optional stdinOptionDescription

stdinOptionDescription: string

- Defined in @zowe/imperative/src/cmd/src/doc/ICommandDefinition.ts:82

The description for the stdin option - used if enableStdin is true

memberof

  ICommandDefinition

### Optional summary

summary: string

- Defined in @zowe/imperative/src/cmd/src/doc/ICommandDefinition.ts:52

A shorter (~one line) description of your command

memberof

  ICommandDefinition

### type

type: ICommandNodeType

- Defined in @zowe/imperative/src/cmd/src/doc/ICommandDefinition.ts:58

This documents segment type - either "group" or "command". See the type definition for more detail.

memberof

  ICommandDefinition

Generated using TypeDoc