# RequiredCommandAnnotation Properties

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [RequiredCommandAnnotation](/reference/api/csharp/aspire.hosting/requiredcommandannotation.md)
- Kind: `Properties`
- Members: `3`

An annotation which declares that a resource requires a specific command/executable to be available on the local machine PATH before it can start.

## Command

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

Gets the command string (file name or path) that should be validated.

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

## HelpLink

- Name: `HelpLink`
- Modifiers: `nullable` `get; init`
- Returns: `string?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/RequiredCommandAnnotation.cs)

Gets or sets an optional help link URL to guide users when the command is missing.

```csharp
public string? HelpLink { get; init; }
```

## ValidationCallback

- Name: `ValidationCallback`
- Modifiers: `nullable` `get; init`
- Returns: `Func<RequiredCommandValidationContext, Task<RequiredCommandValidationResult>>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/RequiredCommandAnnotation.cs)

Gets or sets an optional custom validation callback that will be invoked after the command has been resolved.

```csharp
public Func<RequiredCommandValidationContext, Task<RequiredCommandValidationResult>>? ValidationCallback { get; init; }
```

## Remarks

The callback receives a [RequiredCommandValidationContext](/reference/api/csharp/aspire.hosting/requiredcommandvalidationcontext.md) containing the resolved path and service provider. It should return a [RequiredCommandValidationResult](/reference/api/csharp/aspire.hosting/requiredcommandvalidationresult.md) indicating whether the command is valid.
