Hide the aspire setup command if the bundle isn't available#14464
Merged
davidfowl merged 3 commits intorelease/13.2from Feb 12, 2026
Merged
Hide the aspire setup command if the bundle isn't available#14464davidfowl merged 3 commits intorelease/13.2from
davidfowl merged 3 commits intorelease/13.2from
Conversation
Conditionally add SetupCommand to the CLI command tree only when IBundleService.IsBundle is true, following the same pattern used for ExecCommand and SdkCommand feature-flag gating. Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Hide aspire setup command when bundle is unavailable
Hide the aspire setup command if the bundle isn't available
Feb 12, 2026
Add two tests to RootCommandTests: - SetupCommand_NotAvailable_WhenBundleIsNotAvailable: verifies setup command is hidden when the CLI has no embedded bundle - SetupCommand_Available_WhenBundleIsAvailable: verifies setup command is visible when the CLI has an embedded bundle Also add BundleServiceFactory to CliServiceCollectionTestOptions and TestBundleService to support overriding bundle behavior in tests. Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 14464Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 14464" |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Aspire CLI’s root command composition so the setup command is only surfaced when the running CLI binary actually contains an embedded bundle payload (bundle mode). This aligns the CLI’s help/command surface with what the binary can meaningfully support.
Changes:
- Conditionally adds
SetupCommandtoRootCommandsubcommands based onIBundleService.IsBundle. - Extends
CliTestHelperDI setup to allow overridingIBundleServicevia a newBundleServiceFactorytest option. - Adds root command tests validating
setupis hidden/shown depending on bundle availability.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/Aspire.Cli/Commands/RootCommand.cs |
Gates adding setup to the command tree on bundleService.IsBundle. |
tests/Aspire.Cli.Tests/Utils/CliTestHelper.cs |
Adds BundleServiceFactory to test service-collection options and introduces TestBundleService for bundle/no-bundle scenarios. |
tests/Aspire.Cli.Tests/Commands/RootCommandTests.cs |
Adds two tests asserting the setup subcommand is absent/present based on bundle service behavior. |
sebastienros
approved these changes
Feb 12, 2026
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.
setupcommand is conditionally added based onbundleService.IsBundleBundleServiceFactoryoption toCliServiceCollectionTestOptionsto allow overridingIBundleServicein testsTestBundleServicewith configurableIsBundlepropertyRootCommandTests.cs:SetupCommand_NotAvailable_WhenBundleIsNotAvailable— verifies setup is hidden when no bundleSetupCommand_Available_WhenBundleIsAvailable— verifies setup is shown when bundle exists✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.