Implements

  • ICliExecutionContext

Constructors

Properties

clipboard: ICliClipboard

The clipboard to use for copying/pasting

contextProcessor?: ICliCommandProcessor
cursorPosition: number = 0

The cursor position within the current line.

logger: ICliLogger

The logger to use for logging

onAbort: Subject<void> = ...

A subject that emits when the command is aborted

options?: CliOptions

The options for the CLI

process: ICliExecutionProcess

The process to use for exiting the CLI

progressBar: ICliPercentageProgressBar

The progress bar to use for showing progress

promptLength: number = 0

The number of visible characters the prompt occupies on the current line.

services: ICliServiceProvider

The services to use for the CLI context

spinner: ICliSpinner

The spinner to use for showing/hiding the loader

state: ICliStateStore

The state store to use for storing state

terminal: Terminal
textAnimator: ICliTextAnimator

The text animator to use for showing/hiding text

userSession?: ICliUserSession

The current user session

writer: ICliTerminalWriter

The writer to use for writing to the terminal

Accessors

Methods

  • Clears the current terminal line, including content that wraps across multiple rows. Uses promptLength + currentLine.length to determine how many rows to clear.

    Returns void

  • Refreshes the display of the current line (clears and redraws prompt + input).

    Parameters

    • OptionalpreviousContentLength: number

    Returns void

  • Set the current processor as the context processor, i.e. the processor that will handle the command

    Parameters

    • processor: undefined | ICliCommandProcessor

      The processor to set

    • Optionalsilent: boolean

      Indicates if the setting should be silent, i.e. not write to the terminal

    Returns void

  • Prints the prompt to the terminal.

    Parameters

    • Optionaloptions: { keepCurrentLine?: boolean; newLine?: boolean; reset?: boolean }

    Returns void