Skip to content

[docs] Add command arguments, validation, and visibility to custom-resource-commands#892

Merged
davidfowl merged 3 commits into
release/13.4from
docs/resource-command-arguments-visibility-16710-d4f2449422670560
May 9, 2026
Merged

[docs] Add command arguments, validation, and visibility to custom-resource-commands#892
davidfowl merged 3 commits into
release/13.4from
docs/resource-command-arguments-visibility-16710-d4f2449422670560

Conversation

@aspire-repo-bot
Copy link
Copy Markdown
Contributor

Documents changes from microsoft/aspire#16710

Author: @davidfowl

Target branch: Targeting main (falling back to main because release/13.4 does not exist on microsoft/aspire.dev yet).

Why this PR is needed

PR microsoft/aspire#16710 added significant new user-facing features to resource commands:

  • Command argumentsCommandOptions.Arguments lets commands declare typed input fields that the dashboard renders as a prompt dialog and the CLI accepts as positional values.
  • Argument validationValidateArguments callback performs server-side validation, returning field-level errors to dashboard, CLI, and MCP callers.
  • Command visibilityResourceCommandVisibility controls whether a command appears in the dashboard UI, API/MCP clients, or both.

The existing custom-resource-commands.mdx page had none of this content.

Changes

Updated

  • src/frontend/src/content/docs/fundamentals/custom-resource-commands.mdx — Added three new top-level sections:
    • Command arguments: InteractionInput properties table, InputType enum table, typed accessor examples (GetString/GetInt32/GetBoolean/GetDouble in C#; value/requiredValue/toArray in TypeScript), and CLI positional argument passing.
    • Argument validation: ValidateArguments callback examples (C# and TypeScript), built-in vs. custom validation order, and how errors flow to dashboard/CLI/MCP.
    • Command visibility: ResourceCommandVisibility enum 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.

Generated by PR Documentation Check for issue #16710 · ● 19.9M ·

@aspire-repo-bot aspire-repo-bot Bot added the docs-from-code Copilot initiated issue from dotnet/aspire repo label May 8, 2026
@aspire-repo-bot aspire-repo-bot Bot requested a review from davidfowl May 8, 2026 23:07
@davidfowl davidfowl changed the base branch from main to release/13.4 May 8, 2026 23:36
aspire-repo-bot Bot and others added 2 commits May 8, 2026 17:01
…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>
@davidfowl davidfowl force-pushed the docs/resource-command-arguments-visibility-16710-d4f2449422670560 branch from 7034d4a to 26fa7f0 Compare May 9, 2026 00:26
@davidfowl davidfowl marked this pull request as ready for review May 9, 2026 00:41
@davidfowl davidfowl requested a review from IEvangelist as a code owner May 9, 2026 00:41
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>
@davidfowl davidfowl merged commit 8a6601b into release/13.4 May 9, 2026
5 checks passed
@davidfowl davidfowl deleted the docs/resource-command-arguments-visibility-16710-d4f2449422670560 branch May 9, 2026 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-from-code Copilot initiated issue from dotnet/aspire repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant