Skip to content

Results

Result factory helpers.

public static class Results

Creates a cancelled result (e.g. user declined a confirmation prompt).

public static IReplResult Cancelled(string message)
  • message (string): Cancellation message.

IReplResult - A cancelled result.

Signals that the process should enter interactive REPL mode after command completion. When returned from a CLI one-shot command, the process renders the optional payload and then enters the interactive REPL loop instead of exiting. Also works as the last element of a tuple return.

public static EnterInteractiveResult EnterInteractive(object? payload = null)
  • payload (object): Optional payload to render before entering interactive mode.

EnterInteractiveResult - An enter-interactive result.

Creates an error result.

public static IReplResult Error(string code, string message)
  • code (string): Error code.
  • message (string): Error message.

IReplResult - An error result.

Creates an explicit process exit result with an optional payload to render.

public static IExitResult Exit(int code, object? payload = null)
  • code (int): Process exit code.
  • payload (object): Optional payload rendered through configured output format.

IExitResult - An explicit exit result.

Requests interactive navigation to an explicit scope path after command completion.

public static ReplNavigationResult NavigateTo(string targetPath, object? payload = null)
  • targetPath (string): Target scope path.
  • payload (object): Payload to render.

ReplNavigationResult - A navigation result.

Requests interactive navigation one level up after command completion.

public static ReplNavigationResult NavigateUp(object? payload = null)
  • payload (object): Payload to render.

ReplNavigationResult - A navigation result.

Creates a not-found result.

public static IReplResult NotFound(string message)
  • message (string): Not-found message.

IReplResult - A not-found result.

Creates a conventional success text result.

public static IReplResult Ok(string content)
  • content (string): Text content.

IReplResult - A text result.

Creates a structured success result.

public static IReplResult Success(string message, object? details = null)
  • message (string): Success message.
  • details (object): Optional details payload.

IReplResult - A success result.

Creates a plain text result.

public static IReplResult Text(string content)
  • content (string): Text content.

IReplResult - A text result.

Creates a validation result.

public static IReplResult Validation(string message, object? details = null)
  • message (string): Validation message.
  • details (object): Optional details payload.

IReplResult - A validation result.