# CommandOptions Properties

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [CommandOptions](/reference/api/csharp/aspire.hosting/commandoptions.md)
- Kind: `Properties`
- Members: `10`

Optional configuration for resource commands added with [ResourceBuilderExtensions.WithCommand(IResourceBuilder<T>, string, string, Func<ExecuteCommandContext, Task<ExecuteCommandResult>>, CommandOptions?)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withcommand-iresourcebuilder-t-string-string-func-executecommandcontext-task-executecommandresult-commandoptions).

## Arguments

> **Experimental:** ASPIREINTERACTION001 - [Learn more](/diagnostics/aspireinteraction001/)

- Name: `Arguments`
- Modifiers: `get; set`
- Returns: [IReadOnlyList<InteractionInput>](/reference/api/csharp/aspire.hosting/interactioninput.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.Hosting/ApplicationModel/CommandOptions.cs)

Gets or sets the invocation arguments accepted by the command.

```csharp
public IReadOnlyList<InteractionInput> Arguments { get; set; }
```

## Remarks

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](/reference/api/csharp/aspire.hosting/interactioninput/properties.md#name).

## ConfirmationMessage

- Name: `ConfirmationMessage`
- Modifiers: `nullable` `get; set`
- Returns: `string?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.Hosting/ApplicationModel/CommandOptions.cs)

When a confirmation message is specified, the UI will prompt with an OK/Cancel dialog and the confirmation message before starting the command.

```csharp
public string? ConfirmationMessage { get; set; }
```

## Description

- Name: `Description`
- Modifiers: `nullable` `get; set`
- Returns: `string?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.Hosting/ApplicationModel/CommandOptions.cs)

Optional description of the command, to be shown in the UI. Could be used as a tooltip. May be localized.

```csharp
public string? Description { get; set; }
```

## IconName

- Name: `IconName`
- Modifiers: `nullable` `get; set`
- Returns: `string?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.Hosting/ApplicationModel/CommandOptions.cs)

The icon name for the command. The name should be a valid FluentUI icon name from [https://aka.ms/fluentui-system-icons](https://aka.ms/fluentui-system-icons).

```csharp
public string? IconName { get; set; }
```

## IconVariant

- Name: `IconVariant`
- Modifiers: `nullable` `get; set`
- Returns: [IconVariant?](/reference/api/csharp/aspire.hosting/iconvariant.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.Hosting/ApplicationModel/CommandOptions.cs)

The icon variant.

```csharp
public IconVariant? IconVariant { get; set; }
```

## IsHighlighted

- Name: `IsHighlighted`
- Modifiers: `get; set`
- Returns: `bool`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.Hosting/ApplicationModel/CommandOptions.cs)

A flag indicating whether the command is highlighted in the UI.

```csharp
public bool IsHighlighted { get; set; }
```

## Parameter

> **Obsolete:** Use Arguments to describe invocation arguments and ExecuteCommandContext.Arguments to read them.

- Name: `Parameter`
- Modifiers: `nullable` `get; set`
- Returns: `object?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.Hosting/ApplicationModel/CommandOptions.cs)

Obsolete optional parameter that configures the command in some way. Clients must return any value provided by the server when invoking the command.

```csharp
public object? Parameter { get; set; }
```

## UpdateState

- Name: `UpdateState`
- Modifiers: `nullable` `get; set`
- Returns: `Func<UpdateCommandStateContext, ResourceCommandState>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.Hosting/ApplicationModel/CommandOptions.cs)

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.

```csharp
public Func<UpdateCommandStateContext, ResourceCommandState>? UpdateState { get; set; }
```

## ValidateArguments

> **Experimental:** ASPIREINTERACTION001 - [Learn more](/diagnostics/aspireinteraction001/)

- Name: `ValidateArguments`
- Modifiers: `nullable` `get; set`
- Returns: `Func<InputsDialogValidationContext, Task>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.Hosting/ApplicationModel/CommandOptions.cs)

Gets or sets the callback that validates invocation arguments before the command callback is executed.

```csharp
public Func<InputsDialogValidationContext, Task>? ValidateArguments { get; set; }
```

## Remarks

When validation errors are added to the [InputsDialogValidationContext](/reference/api/csharp/aspire.hosting/inputsdialogvalidationcontext.md), 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.

## Visibility

- Name: `Visibility`
- Modifiers: `get; set`
- Returns: [ResourceCommandVisibility](/reference/api/csharp/aspire.hosting/resourcecommandvisibility.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.Hosting/ApplicationModel/CommandOptions.cs)

Gets or sets where the command is visible to users and clients.

```csharp
public ResourceCommandVisibility Visibility { get; set; }
```

## Remarks

UI clients use the [ResourceCommandVisibility.UI](/reference/api/csharp/aspire.hosting/resourcecommandvisibility/fields.md) flag when displaying commands, and API clients use the [ResourceCommandVisibility.Api](/reference/api/csharp/aspire.hosting/resourcecommandvisibility/fields.md) flag when discovering commands. Visibility controls discovery and display, not authorization. Use [ResourceCommandVisibility.Api](/reference/api/csharp/aspire.hosting/resourcecommandvisibility/fields.md) without [ResourceCommandVisibility.UI](/reference/api/csharp/aspire.hosting/resourcecommandvisibility/fields.md) for headless or agent-oriented commands that should not be displayed in the dashboard UI.
