Class TigerTui
Facade for TigerCli's semi-interactive prompts, message boxes, folder picker, custom dialog
hosting, and activity/progress dialogs.
public static class TigerTui
- Inheritance
-
TigerTui
- Inherited Members
Remarks
Default overloads run on the standard console-backed semi-interactive shell. Shell-injected
overloads take an ICliAppShell first so tests and custom hosts can provide their
own terminal boundary, culture, viewport, interaction mode, timeout behavior, and cancellation
policy.
Most prompt families have simple adapters (for example SelectIndexAsync or
InputAsync) and rich *ResultAsync siblings. The simple adapters collapse cancel,
timeout, token cancellation, and interaction-not-allowed outcomes to null or another
simple return shape. The rich variants return TigerTuiResult<T> so callers can
inspect the exact DialogResultKind.
Process/system cancellation (SystemCancel) is never silently collapsed by the simple adapters: they throw TigerCliSystemCancellationException. Rich result APIs surface SystemCancel as a normal result kind. Activity APIs return ActivityResult<T> instead of the prompt result shape and run headlessly in non-interactive mode because an activity is work-with-presentation, not a prompt.
Properties
DefaultShell
The default semi-interactive shell — the real console-backed ICliAppShell that the
built-in
TigerTui.* prompts run on. Advanced callers can use it to host their own custom
controls/dialogs through the same modal loop the framework uses. ICliAppShell is the
public shell contract; the concrete implementation behind this property is an internal detail.public static ICliAppShell DefaultShell { get; }
Property Value
Methods
ConfirmAsync(ICliAppShell, string, bool?, TimeSpan?, CancellationToken)
Asks a yes-or-no question.
public static Task<bool?> ConfirmAsync(ICliAppShell shell, string title, bool? preselect = null, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
shellICliAppShell- The shell that hosts the confirmation prompt.
titlestring- The question to display.
preselectbool?trueto select Yes initially,falsefor No, ornullfor the default.timeoutTimeSpan?- The optional maximum time to wait for a response.
ctCancellationToken- A token that cancels the prompt.
Returns
- Task<bool?>
truefor Yes,falsefor No or dialog cancellation, ornullfor another unsuccessful outcome. Interactive and semi-interactive shells render the prompt; non-interactive shells do not read input and returnnull.
ConfirmAsync(string, bool?, TimeSpan?, CancellationToken)
Asks a yes-or-no question.
public static Task<bool?> ConfirmAsync(string title, bool? preselect = null, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
titlestring- The question to display.
preselectbool?trueto select Yes initially,falsefor No, ornullfor the default.timeoutTimeSpan?- The optional maximum time to wait for a response.
ctCancellationToken- A token that cancels the prompt.
Returns
- Task<bool?>
truefor Yes,falsefor No or dialog cancellation, ornullfor another unsuccessful outcome. Interactive and semi-interactive shells render the prompt; non-interactive shells do not read input and returnnull.
ConfirmResultAsync(ICliAppShell, string, bool?, TimeSpan?, CancellationToken)
Asks a yes-or-no question and preserves the exact dialog result.
public static Task<TigerTuiResult<bool>> ConfirmResultAsync(ICliAppShell shell, string title, bool? preselect = null, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
shellICliAppShell- The shell that hosts the confirmation prompt.
titlestring- The question to display.
preselectbool?trueto select Yes initially,falsefor No, ornullfor the default.timeoutTimeSpan?- The optional maximum time to wait for a response.
ctCancellationToken- A token that cancels the prompt.
Returns
- Task<TigerTuiResult<bool>>
- A result containing the answer for Yes or No and the exact outcome. Interactive and semi-interactive shells render the prompt; non-interactive shells do not read input and return InteractionNotAllowed.
ConfirmResultAsync(string, bool?, TimeSpan?, CancellationToken)
Asks a yes-or-no question and preserves the exact dialog result.
public static Task<TigerTuiResult<bool>> ConfirmResultAsync(string title, bool? preselect = null, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
titlestring- The question to display.
preselectbool?trueto select Yes initially,falsefor No, ornullfor the default.timeoutTimeSpan?- The optional maximum time to wait for a response.
ctCancellationToken- A token that cancels the prompt.
Returns
- Task<TigerTuiResult<bool>>
- A result containing the answer for Yes or No and the exact outcome. Interactive and semi-interactive shells render the prompt; non-interactive shells do not read input and return InteractionNotAllowed.
ErrorAsync(ICliAppShell, string, MessageBoxButtons, string?, TimeSpan?, CancellationToken)
Shell-injected variant of ErrorAsync(string, MessageBoxButtons, string?, TimeSpan?, CancellationToken).
public static Task<DialogResultKind> ErrorAsync(ICliAppShell shell, string message, MessageBoxButtons buttons = MessageBoxButtons.Ok, string? title = null, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
shellICliAppShellmessagestringbuttonsMessageBoxButtonstitlestringtimeoutTimeSpan?ctCancellationToken
Returns
ErrorAsync(string, MessageBoxButtons, string?, TimeSpan?, CancellationToken)
Convenience wrapper over MessageBoxAsync(string, MessageBoxButtons, MessageBoxKind, string?, TimeSpan?, CancellationToken)
that shows the message on the error surface (Error).
public static Task<DialogResultKind> ErrorAsync(string message, MessageBoxButtons buttons = MessageBoxButtons.Ok, string? title = null, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
messagestringbuttonsMessageBoxButtonstitlestringtimeoutTimeSpan?ctCancellationToken
Returns
InputAsync(ICliAppShell, string, string?, TimeSpan?, CancellationToken, int?, Func<string, string?>?)
Prompts for a line of visible text.
public static Task<string?> InputAsync(ICliAppShell shell, string label, string? initialValue = null, TimeSpan? timeout = null, CancellationToken ct = default, int? width = null, Func<string, string?>? validator = null)
Parameters
shellICliAppShell- The shell that hosts the input prompt.
labelstring- The label displayed with the input.
initialValuestring- The initial input value.
timeoutTimeSpan?- The optional maximum time to wait for a response.
ctCancellationToken- A token that cancels the prompt.
widthint?- The optional input width in cells.
validatorFunc<string, string>- An optional function that returns a validation message, or
nullfor valid input.
Returns
- Task<string>
- The entered text, or
nullwhen the prompt does not complete successfully. Interactive and semi-interactive shells render the prompt; non-interactive shells do not read input and returnnull.
InputAsync(string, string?, TimeSpan?, CancellationToken, int?, Func<string, string?>?)
Prompts for a line of visible text.
public static Task<string?> InputAsync(string label, string? initialValue = null, TimeSpan? timeout = null, CancellationToken ct = default, int? width = null, Func<string, string?>? validator = null)
Parameters
labelstring- The label displayed with the input.
initialValuestring- The initial input value.
timeoutTimeSpan?- The optional maximum time to wait for a response.
ctCancellationToken- A token that cancels the prompt.
widthint?- The optional input width in cells.
validatorFunc<string, string>- An optional function that returns a validation message, or
nullfor valid input.
Returns
- Task<string>
- The entered text, or
nullwhen the prompt does not complete successfully. Interactive and semi-interactive shells render the prompt; non-interactive shells do not read input and returnnull.
InputResultAsync(ICliAppShell, string, string?, TimeSpan?, CancellationToken, int?, Func<string, string?>?)
Prompts for a line of visible text and preserves the exact dialog result.
public static Task<TigerTuiResult<string>> InputResultAsync(ICliAppShell shell, string label, string? initialValue = null, TimeSpan? timeout = null, CancellationToken ct = default, int? width = null, Func<string, string?>? validator = null)
Parameters
shellICliAppShell- The shell that hosts the input prompt.
labelstring- The label displayed with the input.
initialValuestring- The initial input value.
timeoutTimeSpan?- The optional maximum time to wait for a response.
ctCancellationToken- A token that cancels the prompt.
widthint?- The optional input width in cells.
validatorFunc<string, string>- An optional function that returns a validation message, or
nullfor valid input.
Returns
- Task<TigerTuiResult<string>>
- A result containing the entered text and exact outcome. Interactive and semi-interactive shells render the prompt; non-interactive shells do not read input and return InteractionNotAllowed.
InputResultAsync(string, string?, TimeSpan?, CancellationToken, int?, Func<string, string?>?)
Prompts for a line of visible text and preserves the exact dialog result.
public static Task<TigerTuiResult<string>> InputResultAsync(string label, string? initialValue = null, TimeSpan? timeout = null, CancellationToken ct = default, int? width = null, Func<string, string?>? validator = null)
Parameters
labelstring- The label displayed with the input.
initialValuestring- The initial input value.
timeoutTimeSpan?- The optional maximum time to wait for a response.
ctCancellationToken- A token that cancels the prompt.
widthint?- The optional input width in cells.
validatorFunc<string, string>- An optional function that returns a validation message, or
nullfor valid input.
Returns
- Task<TigerTuiResult<string>>
- A result containing the entered text and exact outcome. Interactive and semi-interactive shells render the prompt; non-interactive shells do not read input and return InteractionNotAllowed.
MessageBoxAsync(ICliAppShell, string, MessageBoxButtons, MessageBoxKind, string?, TimeSpan?, CancellationToken)
Displays a message box and returns the action used to close it.
public static Task<DialogResultKind> MessageBoxAsync(ICliAppShell shell, string message, MessageBoxButtons buttons = MessageBoxButtons.Ok, MessageBoxKind kind = MessageBoxKind.Normal, string? title = null, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
shellICliAppShell- The shell that hosts the message box.
messagestring- The message to display.
buttonsMessageBoxButtons- The buttons to display.
kindMessageBoxKind- The semantic kind that selects the message-box surface.
titlestring- The optional dialog title.
timeoutTimeSpan?- The optional maximum time to wait for a response.
ctCancellationToken- A token that cancels the message box.
Returns
- Task<DialogResultKind>
- The dialog result. Interactive and semi-interactive shells render the message box; non-interactive shells do not read input and return InteractionNotAllowed.
MessageBoxAsync(string, MessageBoxButtons, MessageBoxKind, string?, TimeSpan?, CancellationToken)
Displays a message box and returns the action used to close it.
public static Task<DialogResultKind> MessageBoxAsync(string message, MessageBoxButtons buttons = MessageBoxButtons.Ok, MessageBoxKind kind = MessageBoxKind.Normal, string? title = null, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
messagestring- The message to display.
buttonsMessageBoxButtons- The buttons to display.
kindMessageBoxKind- The semantic kind that selects the message-box surface.
titlestring- The optional dialog title.
timeoutTimeSpan?- The optional maximum time to wait for a response.
ctCancellationToken- A token that cancels the message box.
Returns
- Task<DialogResultKind>
- The dialog result. Interactive and semi-interactive shells render the message box; non-interactive shells do not read input and return InteractionNotAllowed.
MultiColumnSelectIndexAsync(ICliAppShell, string, IReadOnlyList<SelectColumn>, IReadOnlyList<SelectRow>, int?, TimeSpan?, CancellationToken)
Shell-injected variant of MultiColumnSelectIndexAsync(string, IReadOnlyList<SelectColumn>, IReadOnlyList<SelectRow>, int?, TimeSpan?, CancellationToken).
public static Task<int?> MultiColumnSelectIndexAsync(ICliAppShell shell, string title, IReadOnlyList<SelectColumn> columns, IReadOnlyList<SelectRow> rows, int? preselectIndex = null, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
shellICliAppShelltitlestringcolumnsIReadOnlyList<SelectColumn>rowsIReadOnlyList<SelectRow>preselectIndexint?timeoutTimeSpan?ctCancellationToken
Returns
MultiColumnSelectIndexAsync(string, IReadOnlyList<SelectColumn>, IReadOnlyList<SelectRow>, int?, TimeSpan?, CancellationToken)
Presents a single-selection picker whose rows are structured, aligned multi-column data (see
SelectColumn/SelectRow/SelectCell) and returns the chosen
row index, or
null on cancel/timeout. Runs on the default semi-interactive shell.public static Task<int?> MultiColumnSelectIndexAsync(string title, IReadOnlyList<SelectColumn> columns, IReadOnlyList<SelectRow> rows, int? preselectIndex = null, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
titlestringcolumnsIReadOnlyList<SelectColumn>rowsIReadOnlyList<SelectRow>preselectIndexint?timeoutTimeSpan?ctCancellationToken
Returns
MultiColumnSelectIndexResultAsync(ICliAppShell, string, IReadOnlyList<SelectColumn>, IReadOnlyList<SelectRow>, int?, TimeSpan?, CancellationToken)
Shell-injected variant of MultiColumnSelectIndexResultAsync(string, IReadOnlyList<SelectColumn>, IReadOnlyList<SelectRow>, int?, TimeSpan?, CancellationToken).
public static Task<TigerTuiResult<int>> MultiColumnSelectIndexResultAsync(ICliAppShell shell, string title, IReadOnlyList<SelectColumn> columns, IReadOnlyList<SelectRow> rows, int? preselectIndex = null, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
shellICliAppShelltitlestringcolumnsIReadOnlyList<SelectColumn>rowsIReadOnlyList<SelectRow>preselectIndexint?timeoutTimeSpan?ctCancellationToken
Returns
MultiColumnSelectIndexResultAsync(string, IReadOnlyList<SelectColumn>, IReadOnlyList<SelectRow>, int?, TimeSpan?, CancellationToken)
Rich variant of MultiColumnSelectIndexAsync(string, IReadOnlyList<SelectColumn>, IReadOnlyList<SelectRow>, int?, TimeSpan?, CancellationToken)
that preserves the exact DialogResultKind instead of collapsing cancel/timeout to
null. Framework internals use this so they can branch on the kind (e.g. Escape vs. timeout).public static Task<TigerTuiResult<int>> MultiColumnSelectIndexResultAsync(string title, IReadOnlyList<SelectColumn> columns, IReadOnlyList<SelectRow> rows, int? preselectIndex = null, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
titlestringcolumnsIReadOnlyList<SelectColumn>rowsIReadOnlyList<SelectRow>preselectIndexint?timeoutTimeSpan?ctCancellationToken
Returns
MultiSelectAsync<T>(ICliAppShell, string, IReadOnlyList<T>, Func<T, string>, IReadOnlyCollection<T>?, IEqualityComparer<T>?, CliFormattingMode, TimeSpan?, CancellationToken)
Selects zero or more items using caller-provided labels.
public static Task<IReadOnlyList<T>?> MultiSelectAsync<T>(ICliAppShell shell, string title, IReadOnlyList<T> items, Func<T, string> labelSelector, IReadOnlyCollection<T>? preselected = null, IEqualityComparer<T>? comparer = null, CliFormattingMode itemsFormattingMode = CliFormattingMode.Raw, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
shellICliAppShell- The shell that hosts the prompt.
titlestring- The prompt title.
itemsIReadOnlyList<T>- The items available for selection.
labelSelectorFunc<T, string>- A function that produces the displayed label for each item.
preselectedIReadOnlyCollection<T>- The items selected initially.
comparerIEqualityComparer<T>- The comparer used to match preselected items.
itemsFormattingModeCliFormattingMode- How item labels are formatted.
timeoutTimeSpan?- The optional maximum time to wait for a response.
ctCancellationToken- A token that cancels the prompt.
Returns
- Task<IReadOnlyList<T>>
- The selected items, or
nullwhen the prompt does not complete successfully. Interactive and semi-interactive shells render the prompt; non-interactive shells do not read input and returnnull.
Type Parameters
T- The item type.
MultiSelectAsync<T>(string, IReadOnlyList<T>, Func<T, string>, IReadOnlyCollection<T>?, IEqualityComparer<T>?, CliFormattingMode, TimeSpan?, CancellationToken)
Selects zero or more items using caller-provided labels.
public static Task<IReadOnlyList<T>?> MultiSelectAsync<T>(string title, IReadOnlyList<T> items, Func<T, string> labelSelector, IReadOnlyCollection<T>? preselected = null, IEqualityComparer<T>? comparer = null, CliFormattingMode itemsFormattingMode = CliFormattingMode.Raw, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
titlestring- The prompt title.
itemsIReadOnlyList<T>- The items available for selection.
labelSelectorFunc<T, string>- A function that produces the displayed label for each item.
preselectedIReadOnlyCollection<T>- The items selected initially.
comparerIEqualityComparer<T>- The comparer used to match preselected items.
itemsFormattingModeCliFormattingMode- How item labels are formatted.
timeoutTimeSpan?- The optional maximum time to wait for a response.
ctCancellationToken- A token that cancels the prompt.
Returns
- Task<IReadOnlyList<T>>
- The selected items, or
nullwhen the prompt does not complete successfully. Interactive and semi-interactive shells render the prompt; non-interactive shells do not read input and returnnull.
Type Parameters
T- The item type.
MultiSelectFlagsAsync<TEnum>(ICliAppShell, string, TEnum, Func<TEnum, string>?, TimeSpan?, CancellationToken)
Selects zero or more single-bit members of a flags enum.
public static Task<TEnum?> MultiSelectFlagsAsync<TEnum>(ICliAppShell shell, string title, TEnum selected = default, Func<TEnum, string>? labelSelector = null, TimeSpan? timeout = null, CancellationToken ct = default) where TEnum : struct, Enum
Parameters
shellICliAppShell- The shell that hosts the prompt.
titlestring- The prompt title.
selectedTEnum- The flags selected initially.
labelSelectorFunc<TEnum, string>- An optional function that produces each flag label.
timeoutTimeSpan?- The optional maximum time to wait for a response.
ctCancellationToken- A token that cancels the prompt.
Returns
- Task<TEnum?>
- The selected flags, or
nullwhen the prompt does not complete successfully. Interactive and semi-interactive shells render the prompt; non-interactive shells do not read input and returnnull.
Type Parameters
TEnum- The flags enum type.
MultiSelectFlagsAsync<TEnum>(string, TEnum, Func<TEnum, string>?, TimeSpan?, CancellationToken)
Selects zero or more single-bit members of a flags enum.
public static Task<TEnum?> MultiSelectFlagsAsync<TEnum>(string title, TEnum selected = default, Func<TEnum, string>? labelSelector = null, TimeSpan? timeout = null, CancellationToken ct = default) where TEnum : struct, Enum
Parameters
titlestring- The prompt title.
selectedTEnum- The flags selected initially.
labelSelectorFunc<TEnum, string>- An optional function that produces each flag label.
timeoutTimeSpan?- The optional maximum time to wait for a response.
ctCancellationToken- A token that cancels the prompt.
Returns
- Task<TEnum?>
- The selected flags, or
nullwhen the prompt does not complete successfully. Interactive and semi-interactive shells render the prompt; non-interactive shells do not read input and returnnull.
Type Parameters
TEnum- The flags enum type.
MultiSelectFlagsResultAsync<TEnum>(ICliAppShell, string, TEnum, Func<TEnum, string>?, TimeSpan?, CancellationToken)
Selects flags and preserves the exact dialog result.
public static Task<TigerTuiResult<TEnum>> MultiSelectFlagsResultAsync<TEnum>(ICliAppShell shell, string title, TEnum selected = default, Func<TEnum, string>? labelSelector = null, TimeSpan? timeout = null, CancellationToken ct = default) where TEnum : struct, Enum
Parameters
shellICliAppShell- The shell that hosts the prompt.
titlestring- The prompt title.
selectedTEnum- The flags selected initially.
labelSelectorFunc<TEnum, string>- An optional function that produces each flag label.
timeoutTimeSpan?- The optional maximum time to wait for a response.
ctCancellationToken- A token that cancels the prompt.
Returns
- Task<TigerTuiResult<TEnum>>
- A result containing the selected flags and exact outcome. Interactive and semi-interactive shells render the prompt; non-interactive shells do not read input and return InteractionNotAllowed.
Type Parameters
TEnum- The flags enum type.
MultiSelectFlagsResultAsync<TEnum>(string, TEnum, Func<TEnum, string>?, TimeSpan?, CancellationToken)
Selects flags and preserves the exact dialog result.
public static Task<TigerTuiResult<TEnum>> MultiSelectFlagsResultAsync<TEnum>(string title, TEnum selected = default, Func<TEnum, string>? labelSelector = null, TimeSpan? timeout = null, CancellationToken ct = default) where TEnum : struct, Enum
Parameters
titlestring- The prompt title.
selectedTEnum- The flags selected initially.
labelSelectorFunc<TEnum, string>- An optional function that produces each flag label.
timeoutTimeSpan?- The optional maximum time to wait for a response.
ctCancellationToken- A token that cancels the prompt.
Returns
- Task<TigerTuiResult<TEnum>>
- A result containing the selected flags and exact outcome. Interactive and semi-interactive shells render the prompt; non-interactive shells do not read input and return InteractionNotAllowed.
Type Parameters
TEnum- The flags enum type.
MultiSelectIndexesAsync(ICliAppShell, string, IReadOnlyList<string>, IReadOnlyCollection<int>?, CliFormattingMode, TimeSpan?, CancellationToken)
Selects zero or more label indexes.
public static Task<int[]?> MultiSelectIndexesAsync(ICliAppShell shell, string title, IReadOnlyList<string> labels, IReadOnlyCollection<int>? preselectedIndexes = null, CliFormattingMode itemsFormattingMode = CliFormattingMode.Raw, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
shellICliAppShell- The shell that hosts the prompt.
titlestring- The prompt title.
labelsIReadOnlyList<string>- The labels available for selection.
preselectedIndexesIReadOnlyCollection<int>- The indexes selected initially.
itemsFormattingModeCliFormattingMode- How labels are formatted.
timeoutTimeSpan?- The optional maximum time to wait for a response.
ctCancellationToken- A token that cancels the prompt.
Returns
- Task<int[]>
- The selected indexes, or
nullwhen the prompt does not complete successfully. Interactive and semi-interactive shells render the prompt; non-interactive shells do not read input and returnnull.
MultiSelectIndexesAsync(string, IReadOnlyList<string>, IReadOnlyCollection<int>?, CliFormattingMode, TimeSpan?, CancellationToken)
Selects zero or more label indexes.
public static Task<int[]?> MultiSelectIndexesAsync(string title, IReadOnlyList<string> labels, IReadOnlyCollection<int>? preselectedIndexes = null, CliFormattingMode itemsFormattingMode = CliFormattingMode.Raw, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
titlestring- The prompt title.
labelsIReadOnlyList<string>- The labels available for selection.
preselectedIndexesIReadOnlyCollection<int>- The indexes selected initially.
itemsFormattingModeCliFormattingMode- How labels are formatted.
timeoutTimeSpan?- The optional maximum time to wait for a response.
ctCancellationToken- A token that cancels the prompt.
Returns
- Task<int[]>
- The selected indexes, or
nullwhen the prompt does not complete successfully. Interactive and semi-interactive shells render the prompt; non-interactive shells do not read input and returnnull.
MultiSelectIndexesResultAsync(ICliAppShell, string, IReadOnlyList<string>, IReadOnlyCollection<int>?, CliFormattingMode, TimeSpan?, CancellationToken)
Selects zero or more label indexes and preserves the exact dialog result.
public static Task<TigerTuiResult<int[]>> MultiSelectIndexesResultAsync(ICliAppShell shell, string title, IReadOnlyList<string> labels, IReadOnlyCollection<int>? preselectedIndexes = null, CliFormattingMode itemsFormattingMode = CliFormattingMode.Raw, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
shellICliAppShell- The shell that hosts the prompt.
titlestring- The prompt title.
labelsIReadOnlyList<string>- The labels available for selection.
preselectedIndexesIReadOnlyCollection<int>- The indexes selected initially.
itemsFormattingModeCliFormattingMode- How labels are formatted.
timeoutTimeSpan?- The optional maximum time to wait for a response.
ctCancellationToken- A token that cancels the prompt.
Returns
- Task<TigerTuiResult<int[]>>
- A result containing the selected indexes and exact outcome. Interactive and semi-interactive shells render the prompt; non-interactive shells do not read input and return InteractionNotAllowed.
MultiSelectIndexesResultAsync(string, IReadOnlyList<string>, IReadOnlyCollection<int>?, CliFormattingMode, TimeSpan?, CancellationToken)
Selects zero or more label indexes and preserves the exact dialog result.
public static Task<TigerTuiResult<int[]>> MultiSelectIndexesResultAsync(string title, IReadOnlyList<string> labels, IReadOnlyCollection<int>? preselectedIndexes = null, CliFormattingMode itemsFormattingMode = CliFormattingMode.Raw, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
titlestring- The prompt title.
labelsIReadOnlyList<string>- The labels available for selection.
preselectedIndexesIReadOnlyCollection<int>- The indexes selected initially.
itemsFormattingModeCliFormattingMode- How labels are formatted.
timeoutTimeSpan?- The optional maximum time to wait for a response.
ctCancellationToken- A token that cancels the prompt.
Returns
- Task<TigerTuiResult<int[]>>
- A result containing the selected indexes and exact outcome. Interactive and semi-interactive shells render the prompt; non-interactive shells do not read input and return InteractionNotAllowed.
RunActivityAsync(ICliAppShell, ActivityDialogSpec, Func<ActivityContext, CancellationToken, Task>, ActivityStopMode, ActivitySpinnerSpec?, TimeSpan?, CancellationToken)
Runs a value-less rich activity dialog (no title) against an explicit
shell.public static Task<ActivityResult<bool>> RunActivityAsync(ICliAppShell shell, ActivityDialogSpec spec, Func<ActivityContext, CancellationToken, Task> operation, ActivityStopMode stopMode = ActivityStopMode.Cancel, ActivitySpinnerSpec? spinner = null, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
shellICliAppShellspecActivityDialogSpecoperationFunc<ActivityContext, CancellationToken, Task>stopModeActivityStopModespinnerActivitySpinnerSpectimeoutTimeSpan?ctCancellationToken
Returns
RunActivityAsync(ICliAppShell, string?, ActivityDialogSpec, Func<ActivityContext, CancellationToken, Task>, ActivityStopMode, ActivitySpinnerSpec?, TimeSpan?, CancellationToken)
Runs a value-less rich activity dialog against an explicit
shell.public static Task<ActivityResult<bool>> RunActivityAsync(ICliAppShell shell, string? title, ActivityDialogSpec spec, Func<ActivityContext, CancellationToken, Task> operation, ActivityStopMode stopMode = ActivityStopMode.Cancel, ActivitySpinnerSpec? spinner = null, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
shellICliAppShelltitlestringspecActivityDialogSpecoperationFunc<ActivityContext, CancellationToken, Task>stopModeActivityStopModespinnerActivitySpinnerSpectimeoutTimeSpan?ctCancellationToken
Returns
RunActivityAsync(ICliAppShell, string, Func<ActivityContext, CancellationToken, Task>, ActivityStopMode, ActivitySpinnerSpec?, TimeSpan?, CancellationToken)
Runs a value-less static-message activity dialog (no title) against an explicit
shell. In non-interactive mode the same message is printed once as the default
non-interactive status line.public static Task<ActivityResult<bool>> RunActivityAsync(ICliAppShell shell, string message, Func<ActivityContext, CancellationToken, Task> operation, ActivityStopMode stopMode = ActivityStopMode.Cancel, ActivitySpinnerSpec? spinner = null, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
shellICliAppShellmessagestringoperationFunc<ActivityContext, CancellationToken, Task>stopModeActivityStopModespinnerActivitySpinnerSpectimeoutTimeSpan?ctCancellationToken
Returns
RunActivityAsync(ICliAppShell, string?, string, Func<ActivityContext, CancellationToken, Task>, ActivityStopMode, ActivitySpinnerSpec?, TimeSpan?, CancellationToken)
Runs a value-less static-message activity dialog against an explicit
shell. In
non-interactive mode the same message is printed once as the default non-interactive status line.public static Task<ActivityResult<bool>> RunActivityAsync(ICliAppShell shell, string? title, string message, Func<ActivityContext, CancellationToken, Task> operation, ActivityStopMode stopMode = ActivityStopMode.Cancel, ActivitySpinnerSpec? spinner = null, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
shellICliAppShelltitlestringmessagestringoperationFunc<ActivityContext, CancellationToken, Task>stopModeActivityStopModespinnerActivitySpinnerSpectimeoutTimeSpan?ctCancellationToken
Returns
RunActivityAsync(ActivityDialogSpec, Func<ActivityContext, CancellationToken, Task>, ActivityStopMode, ActivitySpinnerSpec?, TimeSpan?, CancellationToken)
Runs a rich activity dialog (no title) for a value-less operation.
public static Task<ActivityResult<bool>> RunActivityAsync(ActivityDialogSpec spec, Func<ActivityContext, CancellationToken, Task> operation, ActivityStopMode stopMode = ActivityStopMode.Cancel, ActivitySpinnerSpec? spinner = null, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
specActivityDialogSpecoperationFunc<ActivityContext, CancellationToken, Task>stopModeActivityStopModespinnerActivitySpinnerSpectimeoutTimeSpan?ctCancellationToken
Returns
RunActivityAsync(string?, ActivityDialogSpec, Func<ActivityContext, CancellationToken, Task>, ActivityStopMode, ActivitySpinnerSpec?, TimeSpan?, CancellationToken)
Runs a rich activity dialog for a value-less operation against the default shell. The result's
Value is
true on completion.public static Task<ActivityResult<bool>> RunActivityAsync(string? title, ActivityDialogSpec spec, Func<ActivityContext, CancellationToken, Task> operation, ActivityStopMode stopMode = ActivityStopMode.Cancel, ActivitySpinnerSpec? spinner = null, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
titlestringspecActivityDialogSpecoperationFunc<ActivityContext, CancellationToken, Task>stopModeActivityStopModespinnerActivitySpinnerSpectimeoutTimeSpan?ctCancellationToken
Returns
RunActivityAsync(string, Func<ActivityContext, CancellationToken, Task>, ActivityStopMode, ActivitySpinnerSpec?, TimeSpan?, CancellationToken)
Runs a static-message activity dialog (no title) for a value-less operation. In non-interactive
mode the same message is printed once as the default non-interactive status line.
public static Task<ActivityResult<bool>> RunActivityAsync(string message, Func<ActivityContext, CancellationToken, Task> operation, ActivityStopMode stopMode = ActivityStopMode.Cancel, ActivitySpinnerSpec? spinner = null, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
messagestringoperationFunc<ActivityContext, CancellationToken, Task>stopModeActivityStopModespinnerActivitySpinnerSpectimeoutTimeSpan?ctCancellationToken
Returns
RunActivityAsync(string?, string, Func<ActivityContext, CancellationToken, Task>, ActivityStopMode, ActivitySpinnerSpec?, TimeSpan?, CancellationToken)
Runs a static-message activity dialog for a value-less operation. In non-interactive mode the same
message is printed once as the default non-interactive status line.
public static Task<ActivityResult<bool>> RunActivityAsync(string? title, string message, Func<ActivityContext, CancellationToken, Task> operation, ActivityStopMode stopMode = ActivityStopMode.Cancel, ActivitySpinnerSpec? spinner = null, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
titlestringmessagestringoperationFunc<ActivityContext, CancellationToken, Task>stopModeActivityStopModespinnerActivitySpinnerSpectimeoutTimeSpan?ctCancellationToken
Returns
RunActivityAsync<T>(ICliAppShell, ActivityDialogSpec, Func<ActivityContext, CancellationToken, Task<T>>, ActivityStopMode, ActivitySpinnerSpec?, TimeSpan?, CancellationToken)
Runs a rich activity dialog (no title) against an explicit
shell.public static Task<ActivityResult<T>> RunActivityAsync<T>(ICliAppShell shell, ActivityDialogSpec spec, Func<ActivityContext, CancellationToken, Task<T>> operation, ActivityStopMode stopMode = ActivityStopMode.Cancel, ActivitySpinnerSpec? spinner = null, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
shellICliAppShellspecActivityDialogSpecoperationFunc<ActivityContext, CancellationToken, Task<T>>stopModeActivityStopModespinnerActivitySpinnerSpectimeoutTimeSpan?ctCancellationToken
Returns
- Task<ActivityResult<T>>
Type Parameters
T
RunActivityAsync<T>(ICliAppShell, string?, ActivityDialogSpec, Func<ActivityContext, CancellationToken, Task<T>>, ActivityStopMode, ActivitySpinnerSpec?, TimeSpan?, CancellationToken)
Runs a rich activity dialog against an explicit
shell.public static Task<ActivityResult<T>> RunActivityAsync<T>(ICliAppShell shell, string? title, ActivityDialogSpec spec, Func<ActivityContext, CancellationToken, Task<T>> operation, ActivityStopMode stopMode = ActivityStopMode.Cancel, ActivitySpinnerSpec? spinner = null, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
shellICliAppShelltitlestringspecActivityDialogSpecoperationFunc<ActivityContext, CancellationToken, Task<T>>stopModeActivityStopModespinnerActivitySpinnerSpectimeoutTimeSpan?ctCancellationToken
Returns
- Task<ActivityResult<T>>
Type Parameters
T
RunActivityAsync<T>(ICliAppShell, string, Func<ActivityContext, CancellationToken, Task<T>>, ActivityStopMode, ActivitySpinnerSpec?, TimeSpan?, CancellationToken)
Runs a static-message activity dialog (no title) against an explicit
shell. In
non-interactive mode the same message is printed once as the default non-interactive status line.public static Task<ActivityResult<T>> RunActivityAsync<T>(ICliAppShell shell, string message, Func<ActivityContext, CancellationToken, Task<T>> operation, ActivityStopMode stopMode = ActivityStopMode.Cancel, ActivitySpinnerSpec? spinner = null, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
shellICliAppShellmessagestringoperationFunc<ActivityContext, CancellationToken, Task<T>>stopModeActivityStopModespinnerActivitySpinnerSpectimeoutTimeSpan?ctCancellationToken
Returns
- Task<ActivityResult<T>>
Type Parameters
T
RunActivityAsync<T>(ICliAppShell, string?, string, Func<ActivityContext, CancellationToken, Task<T>>, ActivityStopMode, ActivitySpinnerSpec?, TimeSpan?, CancellationToken)
Runs a static-message activity dialog against an explicit
shell. In
non-interactive mode the same message is printed once as the default non-interactive status line.public static Task<ActivityResult<T>> RunActivityAsync<T>(ICliAppShell shell, string? title, string message, Func<ActivityContext, CancellationToken, Task<T>> operation, ActivityStopMode stopMode = ActivityStopMode.Cancel, ActivitySpinnerSpec? spinner = null, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
shellICliAppShelltitlestringmessagestringoperationFunc<ActivityContext, CancellationToken, Task<T>>stopModeActivityStopModespinnerActivitySpinnerSpectimeoutTimeSpan?ctCancellationToken
Returns
- Task<ActivityResult<T>>
Type Parameters
T
RunActivityAsync<T>(ActivityDialogSpec, Func<ActivityContext, CancellationToken, Task<T>>, ActivityStopMode, ActivitySpinnerSpec?, TimeSpan?, CancellationToken)
Runs a rich activity dialog (no title) for a background
operation.public static Task<ActivityResult<T>> RunActivityAsync<T>(ActivityDialogSpec spec, Func<ActivityContext, CancellationToken, Task<T>> operation, ActivityStopMode stopMode = ActivityStopMode.Cancel, ActivitySpinnerSpec? spinner = null, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
specActivityDialogSpecoperationFunc<ActivityContext, CancellationToken, Task<T>>stopModeActivityStopModespinnerActivitySpinnerSpectimeoutTimeSpan?ctCancellationToken
Returns
- Task<ActivityResult<T>>
Type Parameters
T
RunActivityAsync<T>(string?, ActivityDialogSpec, Func<ActivityContext, CancellationToken, Task<T>>, ActivityStopMode, ActivitySpinnerSpec?, TimeSpan?, CancellationToken)
Runs a rich activity dialog for a background
operation against the default
shell, returning the rich ActivityResult<T> (never collapsed). The operation reports
progress through the supplied ActivityContext. The dialog exposes a single stop
action selected by stopMode (Cancel or Abort, never both); a confirmed stop
switches the dialog to a "Cancelling…"/"Aborting…" view (with no action button) and waits for the
operation to observe cancellation.public static Task<ActivityResult<T>> RunActivityAsync<T>(string? title, ActivityDialogSpec spec, Func<ActivityContext, CancellationToken, Task<T>> operation, ActivityStopMode stopMode = ActivityStopMode.Cancel, ActivitySpinnerSpec? spinner = null, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
titlestringspecActivityDialogSpecoperationFunc<ActivityContext, CancellationToken, Task<T>>stopModeActivityStopModespinnerActivitySpinnerSpectimeoutTimeSpan?ctCancellationToken
Returns
- Task<ActivityResult<T>>
Type Parameters
T
RunActivityAsync<T>(string, Func<ActivityContext, CancellationToken, Task<T>>, ActivityStopMode, ActivitySpinnerSpec?, TimeSpan?, CancellationToken)
Runs a static-message activity dialog (no title) for a background
operation. In
non-interactive mode the same message is printed once as the default non-interactive status line.public static Task<ActivityResult<T>> RunActivityAsync<T>(string message, Func<ActivityContext, CancellationToken, Task<T>> operation, ActivityStopMode stopMode = ActivityStopMode.Cancel, ActivitySpinnerSpec? spinner = null, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
messagestringoperationFunc<ActivityContext, CancellationToken, Task<T>>stopModeActivityStopModespinnerActivitySpinnerSpectimeoutTimeSpan?ctCancellationToken
Returns
- Task<ActivityResult<T>>
Type Parameters
T
RunActivityAsync<T>(string?, string, Func<ActivityContext, CancellationToken, Task<T>>, ActivityStopMode, ActivitySpinnerSpec?, TimeSpan?, CancellationToken)
Runs a rich activity dialog that shows a single static
message line (one
left-aligned text cell) while operation runs. The message is a trusted activity
text template — it may contain TigerCli markup; write literal braces as {{/}}. In
non-interactive mode the same message is printed once as the default non-interactive status line.
Use an explicit ActivityDialogSpec with
SetNonInteractiveMessage(string?) when the non-interactive
message should differ from the visible activity message.public static Task<ActivityResult<T>> RunActivityAsync<T>(string? title, string message, Func<ActivityContext, CancellationToken, Task<T>> operation, ActivityStopMode stopMode = ActivityStopMode.Cancel, ActivitySpinnerSpec? spinner = null, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
titlestringmessagestringoperationFunc<ActivityContext, CancellationToken, Task<T>>stopModeActivityStopModespinnerActivitySpinnerSpectimeoutTimeSpan?ctCancellationToken
Returns
- Task<ActivityResult<T>>
Type Parameters
T
RunControlAsync(ICliAppShell, InlineControlBase, string?, InlineDialogConfirmationPolicy?, TimeSpan?, CancellationToken)
Hosts and runs a custom control against an explicit
shell.public static Task<DialogResult> RunControlAsync(ICliAppShell shell, InlineControlBase control, string? title = null, InlineDialogConfirmationPolicy? confirmation = null, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
shellICliAppShellcontrolInlineControlBasetitlestringconfirmationInlineDialogConfirmationPolicytimeoutTimeSpan?ctCancellationToken
Returns
RunControlAsync(InlineControlBase, string?, InlineDialogConfirmationPolicy?, TimeSpan?, CancellationToken)
Hosts a custom InlineControlBase in an InlineDialog and runs it on the
DefaultShell, returning its DialogResult (the control's
Payload is carried on Payload). This is
the public path for running a custom control without touching internal shell types; the built-in
prompts are themselves thin adapters over the same composition.
public static Task<DialogResult> RunControlAsync(InlineControlBase control, string? title = null, InlineDialogConfirmationPolicy? confirmation = null, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
controlInlineControlBasetitlestringconfirmationInlineDialogConfirmationPolicytimeoutTimeSpan?ctCancellationToken
Returns
RunDialogAsync(ICliAppShell, ICliDialog, TimeSpan?, CancellationToken)
Runs a fully-constructed dialog against an explicit
shell.public static Task<DialogResult> RunDialogAsync(ICliAppShell shell, ICliDialog dialog, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
shellICliAppShelldialogICliDialogtimeoutTimeSpan?ctCancellationToken
Returns
RunDialogAsync(ICliDialog, TimeSpan?, CancellationToken)
Runs a fully-constructed dialog on the DefaultShell and returns its
DialogResult. Use this to run a custom ICliDialog (e.g. an
InlineDialog) without depending on internal shell types. Timeout and cancellation
behave exactly as for the built-in prompts.
public static Task<DialogResult> RunDialogAsync(ICliDialog dialog, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
dialogICliDialogtimeoutTimeSpan?ctCancellationToken
Returns
SecretInputAsync(ICliAppShell, string, string?, TimeSpan?, CancellationToken, int?, Func<string, string?>?)
Prompts for a line of masked text.
public static Task<string?> SecretInputAsync(ICliAppShell shell, string label, string? initialValue = null, TimeSpan? timeout = null, CancellationToken ct = default, int? width = null, Func<string, string?>? validator = null)
Parameters
shellICliAppShell- The shell that hosts the input prompt.
labelstring- The label displayed with the input.
initialValuestring- The initial input value.
timeoutTimeSpan?- The optional maximum time to wait for a response.
ctCancellationToken- A token that cancels the prompt.
widthint?- The optional input width in cells.
validatorFunc<string, string>- An optional function that returns a validation message, or
nullfor valid input.
Returns
- Task<string>
- The entered text, or
nullwhen the prompt does not complete successfully. Interactive and semi-interactive shells render the prompt; non-interactive shells do not read input and returnnull.
SecretInputAsync(string, string?, TimeSpan?, CancellationToken, int?, Func<string, string?>?)
Prompts for a line of masked text.
public static Task<string?> SecretInputAsync(string label, string? initialValue = null, TimeSpan? timeout = null, CancellationToken ct = default, int? width = null, Func<string, string?>? validator = null)
Parameters
labelstring- The label displayed with the input.
initialValuestring- The initial input value.
timeoutTimeSpan?- The optional maximum time to wait for a response.
ctCancellationToken- A token that cancels the prompt.
widthint?- The optional input width in cells.
validatorFunc<string, string>- An optional function that returns a validation message, or
nullfor valid input.
Returns
- Task<string>
- The entered text, or
nullwhen the prompt does not complete successfully. Interactive and semi-interactive shells render the prompt; non-interactive shells do not read input and returnnull.
SecretInputResultAsync(ICliAppShell, string, string?, TimeSpan?, CancellationToken, int?, Func<string, string?>?)
Prompts for a line of masked text and preserves the exact dialog result.
public static Task<TigerTuiResult<string>> SecretInputResultAsync(ICliAppShell shell, string label, string? initialValue = null, TimeSpan? timeout = null, CancellationToken ct = default, int? width = null, Func<string, string?>? validator = null)
Parameters
shellICliAppShell- The shell that hosts the input prompt.
labelstring- The label displayed with the input.
initialValuestring- The initial input value.
timeoutTimeSpan?- The optional maximum time to wait for a response.
ctCancellationToken- A token that cancels the prompt.
widthint?- The optional input width in cells.
validatorFunc<string, string>- An optional function that returns a validation message, or
nullfor valid input.
Returns
- Task<TigerTuiResult<string>>
- A result containing the entered text and exact outcome. Interactive and semi-interactive shells render the prompt; non-interactive shells do not read input and return InteractionNotAllowed.
SecretInputResultAsync(string, string?, TimeSpan?, CancellationToken, int?, Func<string, string?>?)
Prompts for a line of masked text and preserves the exact dialog result.
public static Task<TigerTuiResult<string>> SecretInputResultAsync(string label, string? initialValue = null, TimeSpan? timeout = null, CancellationToken ct = default, int? width = null, Func<string, string?>? validator = null)
Parameters
labelstring- The label displayed with the input.
initialValuestring- The initial input value.
timeoutTimeSpan?- The optional maximum time to wait for a response.
ctCancellationToken- A token that cancels the prompt.
widthint?- The optional input width in cells.
validatorFunc<string, string>- An optional function that returns a validation message, or
nullfor valid input.
Returns
- Task<TigerTuiResult<string>>
- A result containing the entered text and exact outcome. Interactive and semi-interactive shells render the prompt; non-interactive shells do not read input and return InteractionNotAllowed.
SelectAsync(ICliAppShell, string, IReadOnlyList<string>, string?, SelectOrder, IComparer<string>?, CliFormattingMode, TimeSpan?, CancellationToken)
Selects one string from a list.
public static Task<string?> SelectAsync(ICliAppShell shell, string title, IReadOnlyList<string> items, string? preselect = null, SelectOrder order = SelectOrder.Insertion, IComparer<string>? customOrder = null, CliFormattingMode itemsFormattingMode = CliFormattingMode.Raw, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
shellICliAppShell- The shell that hosts the prompt.
titlestring- The prompt title.
itemsIReadOnlyList<string>- The values available for selection.
preselectstring- The value selected initially, or
nullto select the first value. orderSelectOrder- The order in which to display the values.
customOrderIComparer<string>- The comparer used when
orderis Custom. itemsFormattingModeCliFormattingMode- How item labels are formatted.
timeoutTimeSpan?- The optional maximum time to wait for a response.
ctCancellationToken- A token that cancels the prompt.
Returns
- Task<string>
- The selected value, or
nullwhen no value is selected. Interactive and semi-interactive shells render the prompt; non-interactive shells do not read input and returnnull.
SelectAsync(string, IReadOnlyList<string>, string?, SelectOrder, IComparer<string>?, CliFormattingMode, TimeSpan?, CancellationToken)
Selects one string from a list.
public static Task<string?> SelectAsync(string title, IReadOnlyList<string> items, string? preselect = null, SelectOrder order = SelectOrder.Insertion, IComparer<string>? customOrder = null, CliFormattingMode itemsFormattingMode = CliFormattingMode.Raw, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
titlestring- The prompt title.
itemsIReadOnlyList<string>- The values available for selection.
preselectstring- The value selected initially, or
nullto select the first value. orderSelectOrder- The order in which to display the values.
customOrderIComparer<string>- The comparer used when
orderis Custom. itemsFormattingModeCliFormattingMode- How item labels are formatted.
timeoutTimeSpan?- The optional maximum time to wait for a response.
ctCancellationToken- A token that cancels the prompt.
Returns
- Task<string>
- The selected value, or
nullwhen no value is selected. Interactive and semi-interactive shells render the prompt; non-interactive shells do not read input and returnnull.
SelectAsync<TKey>(ICliAppShell, string, IReadOnlyList<OptionItem<TKey>>, int?, SelectOrder, IComparer<OptionItem<TKey>>?, IEqualityComparer<TKey>?, TimeSpan?, CancellationToken)
Selects the key of one option from a list.
public static Task<TKey?> SelectAsync<TKey>(ICliAppShell shell, string title, IReadOnlyList<OptionItem<TKey>> items, int? preselectIndex = null, SelectOrder order = SelectOrder.Insertion, IComparer<OptionItem<TKey>>? customOrder = null, IEqualityComparer<TKey>? keyComparer = null, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
shellICliAppShell- The shell that hosts the prompt.
titlestring- The prompt title.
itemsIReadOnlyList<OptionItem<TKey>>- The keyed options available for selection.
preselectIndexint?- The initially selected option index, or
nullfor the first option. orderSelectOrder- The order in which to display the options.
customOrderIComparer<OptionItem<TKey>>- The comparer used when
orderis Custom. keyComparerIEqualityComparer<TKey>- The comparer used for option keys.
timeoutTimeSpan?- The optional maximum time to wait for a response.
ctCancellationToken- A token that cancels the prompt.
Returns
- Task<TKey>
- The selected key, or the default value when no option is selected. Interactive and semi-interactive shells render the prompt; non-interactive shells do not read input.
Type Parameters
TKey- The option key type.
SelectAsync<T>(ICliAppShell, string, T?, TimeSpan?, CancellationToken)
Selects one value from the members of an enum.
public static Task<T?> SelectAsync<T>(ICliAppShell shell, string title, T? preselect = null, TimeSpan? timeout = null, CancellationToken ct = default) where T : struct, Enum
Parameters
shellICliAppShell- The shell that hosts the prompt.
titlestring- The prompt title.
preselectT?- The value selected initially, or
nullto select the first value. timeoutTimeSpan?- The optional maximum time to wait for a response.
ctCancellationToken- A token that cancels the prompt.
Returns
- Task<T?>
- The selected enum value, or
nullwhen no value is selected. Interactive and semi-interactive shells render the prompt; non-interactive shells do not read input and returnnull.
Type Parameters
T- The enum type to select from.
SelectAsync<TKey>(string, IReadOnlyList<OptionItem<TKey>>, int?, SelectOrder, IComparer<OptionItem<TKey>>?, IEqualityComparer<TKey>?, TimeSpan?, CancellationToken)
Selects the key of one option from a list.
public static Task<TKey?> SelectAsync<TKey>(string title, IReadOnlyList<OptionItem<TKey>> items, int? preselectIndex = null, SelectOrder order = SelectOrder.Insertion, IComparer<OptionItem<TKey>>? customOrder = null, IEqualityComparer<TKey>? keyComparer = null, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
titlestring- The prompt title.
itemsIReadOnlyList<OptionItem<TKey>>- The keyed options available for selection.
preselectIndexint?- The initially selected option index, or
nullfor the first option. orderSelectOrder- The order in which to display the options.
customOrderIComparer<OptionItem<TKey>>- The comparer used when
orderis Custom. keyComparerIEqualityComparer<TKey>- The comparer used for option keys.
timeoutTimeSpan?- The optional maximum time to wait for a response.
ctCancellationToken- A token that cancels the prompt.
Returns
- Task<TKey>
- The selected key, or the default value when no option is selected. Interactive and semi-interactive shells render the prompt; non-interactive shells do not read input.
Type Parameters
TKey- The option key type.
SelectAsync<T>(string, T?, TimeSpan?, CancellationToken)
Selects one value from the members of an enum.
public static Task<T?> SelectAsync<T>(string title, T? preselect = null, TimeSpan? timeout = null, CancellationToken ct = default) where T : struct, Enum
Parameters
titlestring- The prompt title.
preselectT?- The value selected initially, or
nullto select the first value. timeoutTimeSpan?- The optional maximum time to wait for a response.
ctCancellationToken- A token that cancels the prompt.
Returns
- Task<T?>
- The selected enum value, or
nullwhen no value is selected. Interactive and semi-interactive shells render the prompt; non-interactive shells do not read input and returnnull.
Type Parameters
T- The enum type to select from.
SelectFolderAsync(ICliAppShell, string, string?, IFolderBrowser?, TimeSpan?, CancellationToken)
Selects a folder path.
public static Task<string?> SelectFolderAsync(ICliAppShell shell, string title, string? initialPath = null, IFolderBrowser? browser = null, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
shellICliAppShell- The shell that hosts the folder picker.
titlestring- The picker title.
initialPathstring- The path shown initially, or
nullto use the browser root. browserIFolderBrowser- The folder navigation provider, or
nullto use the local filesystem. timeoutTimeSpan?- The optional maximum time to wait for a response.
ctCancellationToken- A token that cancels the picker.
Returns
- Task<string>
- The selected folder path, or
nullwhen no folder is selected. Interactive and semi-interactive shells render the picker; non-interactive shells do not read input and returnnull.
SelectFolderAsync(string, string?, IFolderBrowser, TimeSpan?, CancellationToken)
Runs the folder picker on the default semi-interactive shell against a caller-supplied
browser. Lets a consumer drive the default shell with a custom
(e.g. in-memory) navigation policy instead of the real filesystem.public static Task<string?> SelectFolderAsync(string title, string? initialPath, IFolderBrowser browser, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
titlestringinitialPathstringbrowserIFolderBrowsertimeoutTimeSpan?ctCancellationToken
Returns
SelectFolderAsync(string, string?, TimeSpan?, CancellationToken)
Selects a folder path.
public static Task<string?> SelectFolderAsync(string title, string? initialPath = null, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
titlestring- The picker title.
initialPathstring- The path shown initially, or
nullto use the browser root. timeoutTimeSpan?- The optional maximum time to wait for a response.
ctCancellationToken- A token that cancels the picker.
Returns
- Task<string>
- The selected folder path, or
nullwhen no folder is selected. Interactive and semi-interactive shells render the picker; non-interactive shells do not read input and returnnull.
SelectFolderResultAsync(ICliAppShell, string, string?, IFolderBrowser?, TimeSpan?, CancellationToken)
Selects a folder path and preserves the exact dialog result.
public static Task<TigerTuiResult<string>> SelectFolderResultAsync(ICliAppShell shell, string title, string? initialPath = null, IFolderBrowser? browser = null, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
shellICliAppShell- The shell that hosts the folder picker.
titlestring- The picker title.
initialPathstring- The path shown initially, or
nullto use the browser root. browserIFolderBrowser- The folder navigation provider, or
nullto use the local filesystem. timeoutTimeSpan?- The optional maximum time to wait for a response.
ctCancellationToken- A token that cancels the picker.
Returns
- Task<TigerTuiResult<string>>
- A result containing the selected folder path and exact outcome. Interactive and semi-interactive shells render the picker; non-interactive shells do not read input and return InteractionNotAllowed.
SelectFolderResultAsync(string, string?, TimeSpan?, CancellationToken)
Selects a folder path and preserves the exact dialog result.
public static Task<TigerTuiResult<string>> SelectFolderResultAsync(string title, string? initialPath = null, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
titlestring- The picker title.
initialPathstring- The path shown initially, or
nullto use the browser root. timeoutTimeSpan?- The optional maximum time to wait for a response.
ctCancellationToken- A token that cancels the picker.
Returns
- Task<TigerTuiResult<string>>
- A result containing the selected folder path and exact outcome. Interactive and semi-interactive shells render the picker; non-interactive shells do not read input and return InteractionNotAllowed.
SelectIndexAsync(ICliAppShell, string, IReadOnlyList<string?>, int?, CliFormattingMode, TimeSpan?, CancellationToken)
Selects the index of one label.
public static Task<int?> SelectIndexAsync(ICliAppShell shell, string title, IReadOnlyList<string?> labels, int? preselectIndex = null, CliFormattingMode itemsFormattingMode = CliFormattingMode.Raw, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
shellICliAppShell- The shell that hosts the prompt.
titlestring- The prompt title.
labelsIReadOnlyList<string>- The labels to display. A
nulllabel represents a selectable no-selection row. preselectIndexint?- The initially selected index, or
nullfor the first label. itemsFormattingModeCliFormattingMode- How labels are formatted.
timeoutTimeSpan?- The optional maximum time to wait for a response.
ctCancellationToken- A token that cancels the prompt.
Returns
- Task<int?>
- The selected index, or
nullwhen no label is selected. Interactive and semi-interactive shells render the prompt; non-interactive shells do not read input and returnnull.
SelectIndexAsync(string, IReadOnlyList<string?>, int?, CliFormattingMode, TimeSpan?, CancellationToken)
Selects the index of one label.
public static Task<int?> SelectIndexAsync(string title, IReadOnlyList<string?> labels, int? preselectIndex = null, CliFormattingMode itemsFormattingMode = CliFormattingMode.Raw, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
titlestring- The prompt title.
labelsIReadOnlyList<string>- The labels to display. A
nulllabel represents a selectable no-selection row. preselectIndexint?- The initially selected index, or
nullfor the first label. itemsFormattingModeCliFormattingMode- How labels are formatted.
timeoutTimeSpan?- The optional maximum time to wait for a response.
ctCancellationToken- A token that cancels the prompt.
Returns
- Task<int?>
- The selected index, or
nullwhen no label is selected. Interactive and semi-interactive shells render the prompt; non-interactive shells do not read input and returnnull.
SelectIndexResultAsync(ICliAppShell, string, IReadOnlyList<string?>, int?, CliFormattingMode, TimeSpan?, CancellationToken)
Selects the index of one label and preserves the exact dialog result.
public static Task<TigerTuiResult<int>> SelectIndexResultAsync(ICliAppShell shell, string title, IReadOnlyList<string?> labels, int? preselectIndex = null, CliFormattingMode itemsFormattingMode = CliFormattingMode.Raw, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
shellICliAppShell- The shell that hosts the prompt.
titlestring- The prompt title.
labelsIReadOnlyList<string>- The labels to display; a
nulllabel is a selectable no-selection row. preselectIndexint?- The initially selected index, or
nullfor the first label. itemsFormattingModeCliFormattingMode- How labels are formatted.
timeoutTimeSpan?- The optional maximum time to wait for a response.
ctCancellationToken- A token that cancels the prompt.
Returns
- Task<TigerTuiResult<int>>
- A result containing the selected index and exact outcome. Interactive and semi-interactive shells render the prompt; non-interactive shells do not read input and return InteractionNotAllowed.
SelectIndexResultAsync(string, IReadOnlyList<string?>, int?, CliFormattingMode, TimeSpan?, CancellationToken)
Selects the index of one label and preserves the exact dialog result.
public static Task<TigerTuiResult<int>> SelectIndexResultAsync(string title, IReadOnlyList<string?> labels, int? preselectIndex = null, CliFormattingMode itemsFormattingMode = CliFormattingMode.Raw, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
titlestring- The prompt title.
labelsIReadOnlyList<string>- The labels to display; a
nulllabel is a selectable no-selection row. preselectIndexint?- The initially selected index, or
nullfor the first label. itemsFormattingModeCliFormattingMode- How labels are formatted.
timeoutTimeSpan?- The optional maximum time to wait for a response.
ctCancellationToken- A token that cancels the prompt.
Returns
- Task<TigerTuiResult<int>>
- A result containing the selected index and exact outcome. Interactive and semi-interactive shells render the prompt; non-interactive shells do not read input and return InteractionNotAllowed.
WarningAsync(ICliAppShell, string, MessageBoxButtons, string?, TimeSpan?, CancellationToken)
Shell-injected variant of WarningAsync(string, MessageBoxButtons, string?, TimeSpan?, CancellationToken).
public static Task<DialogResultKind> WarningAsync(ICliAppShell shell, string message, MessageBoxButtons buttons = MessageBoxButtons.Ok, string? title = null, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
shellICliAppShellmessagestringbuttonsMessageBoxButtonstitlestringtimeoutTimeSpan?ctCancellationToken
Returns
WarningAsync(string, MessageBoxButtons, string?, TimeSpan?, CancellationToken)
Convenience wrapper over MessageBoxAsync(string, MessageBoxButtons, MessageBoxKind, string?, TimeSpan?, CancellationToken)
that shows the message on the warning surface (Warning).
public static Task<DialogResultKind> WarningAsync(string message, MessageBoxButtons buttons = MessageBoxButtons.Ok, string? title = null, TimeSpan? timeout = null, CancellationToken ct = default)
Parameters
messagestringbuttonsMessageBoxButtonstitlestringtimeoutTimeSpan?ctCancellationToken