# CommandOptions

- Kind: `class`
- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Version: `13.3.0`
- Namespace: `Aspire.Hosting.ApplicationModel`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/CommandOptions.cs)

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).

## Definition

```csharp
namespace Aspire.Hosting.ApplicationModel;

public class CommandOptions
{
    // ...
}
```

## ATS metadata

### ATS DTO

- Serialized as a plain JSON object without a `$type` discriminator.

## Constructors

- [CommandOptions](/reference/api/csharp/aspire.hosting/commandoptions/constructors.md#constructor)

## Properties

- [ConfirmationMessage](/reference/api/csharp/aspire.hosting/commandoptions/properties.md#confirmationmessage) : `string?` `get; set` -- When a confirmation message is specified, the UI will prompt with an OK/Cancel dialog and the confirmation message before starting the command.
- [Description](/reference/api/csharp/aspire.hosting/commandoptions/properties.md#description) : `string?` `get; set` -- Optional description of the command, to be shown in the UI. Could be used as a tooltip. May be localized.
- [IconName](/reference/api/csharp/aspire.hosting/commandoptions/properties.md#iconname) : `string?` `get; set` -- 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).
- [IconVariant](/reference/api/csharp/aspire.hosting/commandoptions/properties.md#iconvariant) : [IconVariant?](/reference/api/csharp/aspire.hosting/iconvariant.md) `get; set` -- The icon variant.
- [IsHighlighted](/reference/api/csharp/aspire.hosting/commandoptions/properties.md#ishighlighted) : `bool` `get; set` -- A flag indicating whether the command is highlighted in the UI.
- [Parameter](/reference/api/csharp/aspire.hosting/commandoptions/properties.md#parameter) : `object?` `get; set` -- Optional parameter that configures the command in some way. Clients must return any value provided by the server when invoking the command.
- [UpdateState](/reference/api/csharp/aspire.hosting/commandoptions/properties.md#updatestate) : `Func<UpdateCommandStateContext, ResourceCommandState>` `get; set` -- 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.
