Dashboard: split-button on resource command execute to reveal equivalent CLI command
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 201
Description
## Summary
When a user executes a resource command from the Aspire dashboard, the primary **Execute** button should be a split button. The secondary action would reveal (and let the user copy) the exact `aspire resource -- ...` command line that would perform the same execution with the values currently entered in the UI.
## Motivation
Resource commands now support rich input metadata, including dynamic inputs (see #17249). Developers who want to **script or automate** apphost commands need to discover the CLI invocation, the argument names, and the argument values. Today they have to read source / docs and assemble the command by hand.
If the dashboard surfaces the equivalent CLI command directly from the same form they're already filling in, developers:
- Learn that the CLI scripting capability exists.
- See the canonical option names (`--category`, `--item`, etc.) for the command they're using.
- Get a working, copy-pasteable command tailored to the current input state, which they can drop into a script or CI step.
This turns the dashboard into a teaching tool for the CLI's scripting surface.
## Proposed UX
- The **Execute** button in the resource command dialog becomes a split button.
- The dropdown exposes an action like **Copy as CLI command** (and possibly **Show CLI command** that opens an inline / modal preview).
- The generated command:
- Uses the resource name and command name.
- Includes `--non-interactive` and a `--` separator.
- Emits one `--=` per filled-in input, matching the same option names the CLI accepts today.
- Updates live as the user changes inputs in the dialog.
- Sensitive inputs (secrets / passwords) should be redacted or replaced with a placeholder rather than copied verbatim.
## Open questions
- Should the command include `--apphost `? Probably yes when we can resolve it; otherwise omit and rely on auto-discovery.
- For dynamic inputs whose values aren't yet selected, do we emit a placeholder, omit them, or disable the action until required values are present?
- How to render the preview for very long commands — inline expandable region vs. modal.
## Related
- Built on top of #17249 (Support dynamic resource command inputs), which establishes the CLI invocation shape (`aspire resource -- --name=value ...`) that this feature would surface in the dashboard.
Contributor guide
Research direction
Start at the dashboard's resource command dialog and trace the existing Execute action and dynamic-input state described in #17249. Verify the established `aspire resource -- ...` invocation shape, then define how live input values and sensitive fields appear in the copied command. Done means the split action produces a current, safe, copy-pasteable CLI command.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- cli, frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100