Restructure CLI resource commands under 'aspire resource'#14918
Merged
davidfowl merged 6 commits intorelease/13.2from Mar 4, 2026
Merged
Restructure CLI resource commands under 'aspire resource'#14918davidfowl merged 6 commits intorelease/13.2from
davidfowl merged 6 commits intorelease/13.2from
Conversation
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 14918Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 14918" |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR restructures Aspire CLI resource operations from top-level commands (start/stop/restart, command) into a unified nested aspire resource <resource> <command> model, and updates the VS Code extension and tests accordingly.
Changes:
- Consolidates resource lifecycle operations (start/stop/restart/custom) under
aspire resource, removingRestartCommandandResourceCommandBase. - Makes
aspire start/aspire stopAppHost-only commands and updates CLI wiring plus unit tests. - Updates VS Code extension command invocations and refreshes related RESX/XLF localization resources.
Reviewed changes
Copilot reviewed 40 out of 42 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Aspire.Cli.Tests/Utils/CliTestHelper.cs | Removes RestartCommand DI registration in CLI tests. |
| tests/Aspire.Cli.Tests/Commands/StartCommandTests.cs | Removes resource-argument tests now that start is AppHost-only. |
| tests/Aspire.Cli.Tests/Commands/RestartCommandTests.cs | Deletes tests for removed RestartCommand. |
| tests/Aspire.Cli.Tests/Commands/ResourceCommandTests.cs | Updates parsing from command → resource and adds coverage for well-known/backchannel resource command names. |
| src/Aspire.Cli/Resources/xlf/StopCommandStrings.zh-Hant.xlf | Updates stop description and removes resource-argument-related string. |
| src/Aspire.Cli/Resources/xlf/StopCommandStrings.zh-Hans.xlf | Updates stop description and removes resource-argument-related string. |
| src/Aspire.Cli/Resources/xlf/StopCommandStrings.tr.xlf | Updates stop description and removes resource-argument-related string. |
| src/Aspire.Cli/Resources/xlf/StopCommandStrings.ru.xlf | Updates stop description and removes resource-argument-related string. |
| src/Aspire.Cli/Resources/xlf/StopCommandStrings.pt-BR.xlf | Updates stop description and removes resource-argument-related string. |
| src/Aspire.Cli/Resources/xlf/StopCommandStrings.pl.xlf | Updates stop description and removes resource-argument-related string. |
| src/Aspire.Cli/Resources/xlf/StopCommandStrings.ko.xlf | Updates stop description and removes resource-argument-related string. |
| src/Aspire.Cli/Resources/xlf/StopCommandStrings.ja.xlf | Updates stop description and removes resource-argument-related string. |
| src/Aspire.Cli/Resources/xlf/StopCommandStrings.it.xlf | Updates stop description and removes resource-argument-related string. |
| src/Aspire.Cli/Resources/xlf/StopCommandStrings.fr.xlf | Updates stop description and removes resource-argument-related string. |
| src/Aspire.Cli/Resources/xlf/StopCommandStrings.es.xlf | Updates stop description and removes resource-argument-related string. |
| src/Aspire.Cli/Resources/xlf/StopCommandStrings.de.xlf | Updates stop description and removes resource-argument-related string. |
| src/Aspire.Cli/Resources/xlf/StopCommandStrings.cs.xlf | Updates stop description and removes resource-argument-related string. |
| src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.zh-Hant.xlf | Updates resource command descriptions and removes restart/start resource-arg strings. |
| src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.zh-Hans.xlf | Updates resource command descriptions and removes restart/start resource-arg strings. |
| src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.tr.xlf | Updates resource command descriptions and removes restart/start resource-arg strings. |
| src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.ru.xlf | Updates resource command descriptions and removes restart/start resource-arg strings. |
| src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.pt-BR.xlf | Updates resource command descriptions and removes restart/start resource-arg strings. |
| src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.pl.xlf | Updates resource command descriptions and removes restart/start resource-arg strings. |
| src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.ko.xlf | Updates resource command descriptions and removes restart/start resource-arg strings. |
| src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.ja.xlf | Updates resource command descriptions and removes restart/start resource-arg strings. |
| src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.it.xlf | Updates resource command descriptions and removes restart/start resource-arg strings. |
| src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.fr.xlf | Updates resource command descriptions and removes restart/start resource-arg strings. |
| src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.es.xlf | Updates resource command descriptions and removes restart/start resource-arg strings. |
| src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.de.xlf | Updates resource command descriptions and removes restart/start resource-arg strings. |
| src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.cs.xlf | Updates resource command descriptions and removes restart/start resource-arg strings. |
| src/Aspire.Cli/Resources/StopCommandStrings.resx | Aligns stop description with AppHost-only behavior; removes AllAndResourceMutuallyExclusive. |
| src/Aspire.Cli/Resources/StopCommandStrings.Designer.cs | Removes generated accessor for AllAndResourceMutuallyExclusive. |
| src/Aspire.Cli/Resources/ResourceCommandStrings.resx | Updates resource command descriptions; removes restart/start resource-arg and option-validity strings. |
| src/Aspire.Cli/Resources/ResourceCommandStrings.Designer.cs | Removes generated accessors for deleted ResourceCommandStrings entries. |
| src/Aspire.Cli/Program.cs | Removes RestartCommand service registration. |
| src/Aspire.Cli/Commands/StopCommand.cs | Removes resource-argument support; stop now targets AppHost (or --all). |
| src/Aspire.Cli/Commands/StartCommand.cs | Removes resource-start behavior; start now launches AppHost detached. |
| src/Aspire.Cli/Commands/RootCommand.cs | Removes RestartCommand from root command wiring. |
| src/Aspire.Cli/Commands/RestartCommand.cs | Deletes RestartCommand implementation. |
| src/Aspire.Cli/Commands/ResourceCommandBase.cs | Deletes now-obsolete shared base for resource lifecycle commands. |
| src/Aspire.Cli/Commands/ResourceCommand.cs | Renames command to resource and adds mapping for friendly names (start/stop/restart) to backchannel commands. |
| extension/src/views/AspireAppHostTreeProvider.ts | Updates extension to invoke aspire resource "<resource>" <command> instead of aspire command ... / aspire start/stop .... |
Files not reviewed (2)
- src/Aspire.Cli/Resources/ResourceCommandStrings.Designer.cs: Language not supported
- src/Aspire.Cli/Resources/StopCommandStrings.Designer.cs: Language not supported
src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.zh-Hans.xlf
Outdated
Show resolved
Hide resolved
src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.zh-Hant.xlf
Outdated
Show resolved
Hide resolved
Member
Author
|
New help output: |
Contributor
🎬 CLI E2E Test RecordingsThe following terminal recordings are available for commit
📹 Recordings uploaded automatically from CI run #22646594252 |
davidfowl
approved these changes
Mar 4, 2026
Copilot AI
pushed a commit
that referenced
this pull request
Mar 10, 2026
* Restructure CLI resource commands under 'aspire resource' * Detect bare-word args in 'aspire start' and guide users to 'aspire resource' * Remove TreatUnmatchedTokensAsErrors=false from StartCommand * Add tests that 'aspire start/stop myresource' fail * Restore unmatched token forwarding in StartCommand and add forwarding tests * Move StartDescription to StartCommandStrings
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.
Description
Restructure Aspire CLI resource commands from a flat structure (
aspire start/stop/restart <resource>,aspire command <resource> <command>) to a nested structure under a unifiedaspire resourcecommand (aspire resource <resource> start/stop/restart/<command>).aspire startandaspire stopare now apphost-only commandsaspire resource <resource> <command>handles all resource operations (start, stop, restart, and custom commands)RestartCommandandResourceCommandBase— their logic is folded intoResourceCommandvia a well-known command mappingStartCommandTeststoResourceCommandTestsFixes #14797
Checklist
<remarks />and<code />elements on your triple slash comments?aspire.devissue: