## zowe › zos-console › issue › command

Issue a z/OS console command and print command responses (known as "solicited command responses").

In general, when issuing a z/OS console command, z/OS applications route responses to the originating console. The command response messages are referred to as "solicited command responses" (i.e. direct responses to the command issued). When issuing a z/OS console command using Zowe CLI, collection of all solicited command responses is attempted by default. However, there is no z/OS mechanism that indicates the total number of response messages that may be produced from a given command. Therefore, the Zowe CLI console APIs return a "solicited response key" that can be used to "follow-up" and collect any additional solicited command responses.

Zowe CLI will issue "follow-up" API requests by default to collect any additional outstanding solicited command responses until a request returns no additional responses. At that time, Zowe CLI will attempt a final collection attempt. If no messages are present, the command is complete. If additional messages are present, the process is repeated. However, this does not guarantee that all messages produced in direct response (i.e. solicited) have been collected. The z/OS application may produce additional messages in direct response to your command at some point in the future. You can manually collect additional responses using the "command response key" OR specify additional processing options to, for example, delay collection attempts by a specified interval.

#### Usage

zowe zos-console issue command <commandtext> [options]

#### Positional Arguments

- `commandtext` (string)

  - The z/OS console command to issue.

#### Options

- `--console-name` | `--cn` | `-c` (string)

  - The name of the z/OS extended MCS console to direct the command. You must have the required authority to access the console specified. You may also specify an arbitrary name, if your installation allows dynamic creation of consoles with arbitrary names.

    Allowed values: ^[a-zA-Z0-9]+$

- `--include-details` | `--id` | `-i` (boolean)

  - Include additional details at the end of the Zowe CLI command response, such as the "command response key" and the z/OSMF command response URL.

- `--key-only` | `--ko` | `-k` (boolean)

  - Displays only the "command response key" returned from the z/OSMF console API. You can collect additional messages using the command key with 'zowe zos-console collect sync-responses <key>'. Note that when using this option, you will not be presented with the "first set" of command response messages (if present in the API response). However, you can view them by using the --response-format-json option.

- `--return-first` | `--rf` | `-r` (boolean)

  - Indicates that Zowe CLI should return immediately with the response message set returned in the first z/OSMF API request (even if no responses are present). Using this option may result in partial or no response, but quicker Zowe CLI command response time. The z/OSMF console API has an implicit wait when collecting the first set of console command responses, i.e you will normally receive at least one set of response messages.

- `--solicited-keyword` | `--sk` | `-s` (string)

  - For solicited responses (direct command responses) the response is considered complete if the keyword specified is present. If the keyword is detected, the command will immediately return, meaning the full command response may not be provided. The key only applies to the first request issued, follow up requests do not support searching for the keyword.

- `--sysplex-system` | `--ss` | `--sys` (string)

  - Specifies the z/OS system (LPAR) in the current SYSPLEX (where your target z/OSMF resides) to route the z/OS console command.

- `--wait-to-collect` | `--wtc` | `-w` (number)

  - Indicates that Zowe CLI wait at least the specified number of seconds before attempting to collect additional solicited response messages. If additional messages are collected on "follow-up" requests, the timer is reset until an attempt is made that results in no additional response messages.

- `--follow-up-attempts` | `--fua` | `-a` (number)

  - Number of request attempts if no response returned.

    Default value: 1

#### Zosmf Connection Options

- `--host` | `-H` (string)

  - The z/OSMF server host name.

- `--port` | `-P` (number)

  - The z/OSMF server port.

    Default value: 443

- `--user` | `-u` (string)

  - Mainframe (z/OSMF) user name, which can be the same as your TSO login.

- `--password` | `--pass` | `--pw` (string)

  - Mainframe (z/OSMF) password, which can be the same as your TSO password.

- `--reject-unauthorized` | `--ru` (boolean)

  - Reject self-signed certificates.

    Default value: true

- `--base-path` | `--bp` (string)

  - The base path for your API mediation layer instance. Specify this option to prepend the base path to all z/OSMF resources when making REST requests. Do not specify this option if you are not using an API mediation layer.

- `--protocol` (string)

  - The protocol used (HTTP or HTTPS)

    Default value: https
    Allowed values: http, https

- `--cert-file` (local file path)

  - The file path to a certificate file to use for authentication

- `--cert-key-file` (local file path)

  - The file path to a certificate key file to use for authentication

#### Profile Options

- `--zosmf-profile` | `--zosmf-p` (string)

  - The name of a (zosmf) profile to load for this command execution.

- `--base-profile` | `--base-p` (string)

  - The name of a (base) profile to load for this command execution.

#### Base Connection Options

- `--token-type` | `--tt` (string)

  - The type of token to get and use for the API. Omit this option to use the default token type, which is provided by 'zowe auth login'.

- `--token-value` | `--tv` (string)

  - The value of the token to pass to the API.

#### Examples

- Issue a z/OS console command to display the IPL information for the system:

  - `zowe zos-console issue command "D IPLINFO"`

- Issue a z/OS console command to display the local and coordinated universal time and date:

  - `zowe zos-console issue command "D T"`

- Issue a Db2 command to display information about the status and configuration of DDF:

  - `zowe zos-console issue command "\-DB1G DISPLAY DDF"`