Skip to content
DocsTry Aspire
DocsTry

ProcessCommandResultContext Properties

ClassProperties10 members
Context passed to callback to configure ExecuteCommandResult when using ResourceBuilderExtensions.WithProcessCommand.
Gets the invocation arguments supplied by the client when the command is executed.
public InteractionInputCollection Arguments { get; init; }

The collection contains the arguments described by the command's CommandOptions.Arguments with their submitted values populated. CLI positional arguments are mapped by declaration order. Dashboard, MCP, and other named-payload clients are mapped by InteractionInput.Name.

Read a declared command argument when producing a custom result:

GetCommandResult = context =>
Task.FromResult(CommandResults.Success("received", context.Arguments.GetString("message")!));
CancellationTokenSection titled CancellationTokenCancellationToken
Gets the cancellation token.
public CancellationToken CancellationToken { get; init; }
Gets the process exit code.
public int ExitCode { get; init; }
Gets the logger for the command invocation.
public ILogger Logger { get; init; }
OutputSection titled OutputIReadOnlyList<string>
Gets the retained stdout and stderr output lines in the order observed by the process runner.
public IReadOnlyList<string> Output { get; init; }
Gets the process command specification used for the command invocation.
public ProcessCommandSpec ProcessCommandSpec { get; init; }
ResourceNameSection titled ResourceNamestring
Gets the name of the resource the command was configured on.
public string ResourceName { get; init; }
ServiceProviderSection titled ServiceProviderIServiceProvider
Gets the service provider.
public IServiceProvider ServiceProvider { get; init; }
ServicesSection titled ServicesIServiceProvider
Gets the service provider.
public IServiceProvider Services { get; init; }
Gets the total number of stdout and stderr lines observed by the process runner.
public int TotalOutputLineCount { get; init; }