# ResourceCommandAnnotation Properties

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [ResourceCommandAnnotation](/reference/api/csharp/aspire.hosting/resourcecommandannotation.md)
- Kind: `Properties`
- Members: `13`

Represents a command annotation for a resource.

## Arguments

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

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

Gets the invocation arguments accepted by the command.

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

## 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`
- Returns: `string?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.Hosting/ApplicationModel/ResourceCommandAnnotation.cs#L152)

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; }
```

## DisplayDescription

- Name: `DisplayDescription`
- Modifiers: `nullable` `get`
- Returns: `string?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.Hosting/ApplicationModel/ResourceCommandAnnotation.cs#L120)

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

```csharp
public string? DisplayDescription { get; }
```

## DisplayName

- Name: `DisplayName`
- Modifiers: `get`
- Returns: `string`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.Hosting/ApplicationModel/ResourceCommandAnnotation.cs#L102)

The display name visible in UI.

```csharp
public string DisplayName { get; }
```

## ExecuteCommand

- Name: `ExecuteCommand`
- Modifiers: `get`
- Returns: `Func<ExecuteCommandContext, Task<ExecuteCommandResult>>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.Hosting/ApplicationModel/ResourceCommandAnnotation.cs#L114)

A callback that is executed when the command is executed. The result is used to indicate success or failure in the UI.

```csharp
public Func<ExecuteCommandContext, Task<ExecuteCommandResult>> ExecuteCommand { get; }
```

## IconName

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

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

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

## IconVariant

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

The icon variant for the command.

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

## IsHighlighted

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

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

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

## Name

- Name: `Name`
- Modifiers: `get`
- Returns: `string`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.Hosting/ApplicationModel/ResourceCommandAnnotation.cs#L97)

The name of command. The name uniquely identifies the command.

```csharp
public string Name { get; }
```

## Parameter

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

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

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; }
```

## UpdateState

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

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

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

## ValidateArguments

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

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

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

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

## Visibility

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

Gets where the command is visible to users and clients.

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