[docs] Add command arguments, validation, and visibility to custom-resource-commands#892
Merged
davidfowl merged 3 commits intoMay 9, 2026
Conversation
16 tasks
…ource-commands Documents new features from microsoft/aspire#16710: - Command arguments (InteractionInput, InputType, InteractionInputCollection) - Typed argument accessors (GetString, GetBoolean, GetInt32, GetDouble in C#; toArray, value, requiredValue in TypeScript) - Positional CLI argument passing - Argument validation (ValidateArguments callback, field-level errors) - Command visibility (ResourceCommandVisibility.Dashboard, Api, All) Covers both C# and TypeScript AppHost usage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Verified against microsoft/aspire source: - ResourceCommandVisibility values are None, UI, Api (bit-combinable); the previously documented names Dashboard and All do not exist. Use UI | Api for "both" (the default). - InteractionInputCollection.GetInt32/GetBoolean/GetDouble return non-nullable values and throw on absent or unparseable input; only GetString returns string?. Updated comments and prose. - Replaced "GetInt32(...) ?? 1" in the example, which would not compile against a non-nullable int return, with int.TryParse against GetString. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
7034d4a to
26fa7f0
Compare
davidfowl
approved these changes
May 9, 2026
Update the InteractionInput property table to reflect that Label is optional and that Choice options use the IReadOnlyList/InteractionInputOption shape from the product APIs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documents changes from microsoft/aspire#16710
Author:
@davidfowlTarget branch: Targeting
main(falling back tomainbecauserelease/13.4does not exist onmicrosoft/aspire.devyet).Why this PR is needed
PR microsoft/aspire#16710 added significant new user-facing features to resource commands:
CommandOptions.Argumentslets commands declare typed input fields that the dashboard renders as a prompt dialog and the CLI accepts as positional values.ValidateArgumentscallback performs server-side validation, returning field-level errors to dashboard, CLI, and MCP callers.ResourceCommandVisibilitycontrols whether a command appears in the dashboard UI, API/MCP clients, or both.The existing
custom-resource-commands.mdxpage had none of this content.Changes
Updated
src/frontend/src/content/docs/fundamentals/custom-resource-commands.mdx— Added three new top-level sections:InteractionInputproperties table,InputTypeenum table, typed accessor examples (GetString/GetInt32/GetBoolean/GetDoublein C#;value/requiredValue/toArrayin TypeScript), and CLI positional argument passing.ValidateArgumentscallback examples (C# and TypeScript), built-in vs. custom validation order, and how errors flow to dashboard/CLI/MCP.ResourceCommandVisibilityenum table, C# and TypeScript usage examples, and a tip on when to use each value.Both C# and TypeScript AppHost usage are documented throughout using the existing
syncKey="aspire-lang"tab pattern.