command
Launch or update the extension command.
Functions
command.updateDetail
updateDetail(options: UpdateDetailOptions): Promise<void>;
Update the details of the current command.
Example
command.launch
command.launch<T = unknown>(options: LaunchOptions): Promise<LaunchResult<T> | null>;
Launch another command of the extension. It will return an error if the command is disabled or does not exist.
Example
Types
command.UpdateDetailOptions
Options for the command.updateDetail
method.
Property | Type | Description |
---|---|---|
subtitle | ?(string | null) | The command’s subtitle |
command.LaunchOptions
Options for the command.launch
method.
Property | Type | Description |
---|---|---|
name | string | Name of the command defined in the extension manifest |
waitUntilFinished | ?boolean | Whether to wait for the command to finish running. default to true This option not working for the command that has a view |
args | ?Record<string, unknown> | The command arguments as defined in the extension manifest |
captureAllScriptMessages | ?boolean | By default the script type command only return the last stdout message when the waitUntilFinished is true . Set this option to true to capture all the messages. |
command.LaunchResult
Result when the launched command is finished running.
Property | Type | Description |
---|---|---|
success | boolean | Whether the command is successfully running |
result | unknown | The output of the command when it’s successfully running |
errorMessage | string | Error message when the command fails to run or throws an error while running |