Skip to content
DocsTry Aspire
DocsTry

CommandOptions Properties

ClassProperties10 members
Optional configuration for resource commands added with ResourceBuilderExtensions.WithCommand.
Gets or sets the invocation arguments accepted by the command.
public IReadOnlyList<InteractionInput> Arguments { get; set; }

The list order is part of the command contract. CLI positional arguments are mapped to this list by index before the command executes. Clients that submit named argument payloads, such as Dashboard and MCP clients, map values by InteractionInput.Name.

ConfirmationMessageSection titled ConfirmationMessagenullablestring?
When a confirmation message is specified, the UI will prompt with an OK/Cancel dialog and the confirmation message before starting the command.
public string? ConfirmationMessage { get; set; }
DescriptionSection titled Descriptionnullablestring?
Optional description of the command, to be shown in the UI. Could be used as a tooltip. May be localized.
public string? Description { get; set; }
IconNameSection titled IconNamenullablestring?
The icon name for the command. The name should be a valid FluentUI icon name from https://aka.ms/fluentui-system-icons.
public string? IconName { get; set; }
The icon variant.
public IconVariant? IconVariant { get; set; }
A flag indicating whether the command is highlighted in the UI.
public bool IsHighlighted { get; set; }
ParameterSection titled Parameternullableobject?
Obsolete optional parameter that configures the command in some way. Clients must return any value provided by the server when invoking the command.
public object? Parameter { get; set; }
UpdateStateSection titled UpdateStatenullableFunc<UpdateCommandStateContext, ResourceCommandState>

A callback that is used to update the command state. The callback is executed when the command's resource snapshot is updated.

If a callback isn't specified, the command is always enabled.

public Func<UpdateCommandStateContext, ResourceCommandState>? UpdateState { get; set; }
ValidateArgumentsSection titled ValidateArgumentsnullableFunc<InputsDialogValidationContext, Task>
Gets or sets the callback that validates invocation arguments before the command callback is executed.
public Func<InputsDialogValidationContext, Task>? ValidateArguments { get; set; }

When validation errors are added to the InputsDialogValidationContext, the command callback is not executed. Dashboard clients can display the errors next to the matching inputs, while API clients can report the same errors to callers.

Gets or sets where the command is visible to users and clients.
public ResourceCommandVisibility Visibility { get; set; }
UI clients use the ResourceCommandVisibility.UI flag when displaying commands, and API clients use the ResourceCommandVisibility.Api flag when discovering commands. Visibility controls discovery and display, not authorization. Use ResourceCommandVisibility.Api without ResourceCommandVisibility.UI for headless or agent-oriented commands that should not be displayed in the dashboard UI.