Skip to content

Document WithCommand return-value payloads (Text/Json/Markdown) for Aspire 13.3#1161

Open
IEvangelist with Copilot wants to merge 2 commits into
mainfrom
copilot/133-document-command-return-values
Open

Document WithCommand return-value payloads (Text/Json/Markdown) for Aspire 13.3#1161
IEvangelist with Copilot wants to merge 2 commits into
mainfrom
copilot/133-document-command-return-values

Conversation

Copilot AI commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Aspire 13.3 added support for returning payload data from resource commands, including Markdown rendered in the dashboard response viewer. This PR updates the relevant docs to clearly describe the API contract, dashboard behavior, and release-note messaging.

  • Custom resource commands docs

    • Renames the core section to “Returning a result from a command”.
    • Adds a focused Markdown return example using CommandResultData with CommandResultFormat.Markdown.
    • Aligns wording around ExecuteCommandResult.Data and result formats.
  • Dashboard docs

    • Adds a notification-center note clarifying that Markdown command results are rendered as formatted Markdown in the text visualizer.
    • Reuses the existing response-view screenshot context to anchor the behavior.
  • 13.3 changelog

    • Updates the 13.3 AppHost entry to explicitly call out structured command payloads (Text, Json, Markdown) and the CommandResults.Success(string, CommandResultData) usage pattern.
builder.AddProject<Projects.MyService>("myservice")
    .WithCommand(
        name: "migrate-database",
        displayName: "Migrate Database",
        executeCommand: _ =>
        {
            var markdown = """
                # ⚙️ Database Migration Summary
                | Table | Result |
                |---|---|
                | Customers | ✅ 1,200 rows |
                """;

            return Task.FromResult(CommandResults.Success(
                "Database migrated.",
                new CommandResultData
                {
                    Value = markdown,
                    Format = CommandResultFormat.Markdown
                }));
        });

Copilot AI linked an issue Jun 2, 2026 that may be closed by this pull request
Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com>
Copilot AI changed the title [WIP] Document command return values in migration summary Document WithCommand return-value payloads (Text/Json/Markdown) for Aspire 13.3 Jun 2, 2026
Copilot AI requested a review from IEvangelist June 2, 2026 02:49
@IEvangelist IEvangelist marked this pull request as ready for review June 30, 2026 08:38
@IEvangelist IEvangelist requested a review from JamesNK as a code owner June 30, 2026 08:38
Copilot AI review requested due to automatic review settings June 30, 2026 08:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Aspire 13.3 documentation to describe the new “structured command result payloads” contract (Text/Json/Markdown), including how results flow into the dashboard notification center and how to return Markdown output from custom resource commands.

Changes:

  • Updates the Aspire 13.3 “What’s new” entry to explicitly call out ExecuteCommandResult.Data payloads and Markdown-capable results.
  • Renames/reshapes the custom resource commands docs section to focus on returning structured results and adds a Markdown return example.
  • Clarifies dashboard behavior for Markdown command results in the text visualizer and tightens cross-link wording.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/frontend/src/content/docs/whats-new/aspire-13-3.mdx Updates release-note wording to call out structured command payloads and the helper overload used to return them.
src/frontend/src/content/docs/fundamentals/custom-resource-commands.mdx Renames the structured-output section and adds a Markdown return example for CommandResultData / CommandResultFormat.Markdown.
src/frontend/src/content/docs/dashboard/explore.mdx Adds a note that Markdown results are rendered in the text visualizer and refines the link description to the commands docs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

</Tabs>

## Return structured output from a command
## Returning a result from a command
### Resource commands return structured results

Custom resource commands can now return an `ExecuteCommandResult` with a structured `Message` payload that the dashboard renders in the notification center. The new `Logger` property on `ExecuteCommandContext` lets command implementations log directly to the resource's log stream.
Custom resource commands can now return an `ExecuteCommandResult` with structured `Data` payloads (`Text`, `Json`, or `Markdown`) that the dashboard renders from the notification center's **View response** action. The `CommandResults.Success(string, CommandResultData)` overload also makes it easy to return markdown tables and other rich output from a command. The new `Logger` property on `ExecuteCommandContext` lets command implementations log directly to the resource's log stream.

<Image src={notificationCenterResponse} alt="Aspire dashboard text visualizer showing a command response opened from the notification center." />

Markdown command results render as formatted Markdown in the text visualizer (for example, headings and tables), not as raw markdown source.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[13.3] Document command return values

3 participants