Add update instructions to CLI version notification message#12614
Closed
Add update instructions to CLI version notification message#12614
Conversation
- Added IsRunningAsDotNetTool() method to CliHostEnvironment.cs - Updated ConsoleInteractionService.DisplayVersionUpdateNotification to detect and show appropriate update command - Updated resource strings in InteractionServiceStrings.resx to include update command in single message - Updated InteractionServiceStrings.Designer.cs with new message format - Updated all localization .xlf files to mark translations as needing update - Removed IsRunningAsDotNetTool() from UpdateCommand.cs and CliUpdateNotifier.cs and use centralized version - Updated IInteractionService interface to remove optional updateCommand parameter - Updated all test services to match new interface signature - Added test to verify update command is included in notification Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Open new pull request with changes from #12391
Add update instructions to CLI version notification message
Nov 2, 2025
Contributor
|
@copilot Here's what the copilot CLI looks like. The command to run is highlighted. It adds some nice polish to the visual |
- Moved IsRunningAsDotNetTool() from CliHostEnvironment to CliExecutionContext - Updated UpdateCommand to use CliExecutionContext.IsRunningAsDotNetTool() - Updated ConsoleInteractionService to use CliExecutionContext.IsRunningAsDotNetTool() - All 520 tests continue to pass Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
Contributor
|
@copilot don't make IsRunningAsDotNetTool static, that will make it hard to mock, we want to be able to unit test this behavior. |
- Changed IsRunningAsDotNetTool() from static to instance method - Added CA1822 suppression with justification for testability - Updated UpdateCommand to call executionContext.IsRunningAsDotNetTool() - Updated ConsoleInteractionService to call _executionContext.IsRunningAsDotNetTool() - All 520 tests continue to pass Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
Contributor
Author
Contributor
|
@copilot this is what the copilot CLI emits
|
- Added [white] markup to highlight the update command
- Updated resource string to use [white]{1}[/] for the command
- Updated Designer.cs to reflect the new format
- Updated all 13 xlf localization files with new markup
- All 520 tests continue to pass
The update command is now visually highlighted similar to the copilot CLI reference.
Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
Contributor
Author
... Added command highlighting in commit 5f6a956. The update command is now displayed in white (highlighted) similar to the copilot CLI visual style. Example output for native binary: Example output for dotnet tool: |
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12614Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12614" |
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.

Implements changes from #12391 to display context-aware update instructions when a new CLI version is available.
Changes
Centralized runtime detection
CliExecutionContext.IsRunningAsDotNetTool()as an instance method to detect if running as dotnet tool vs native binaryUpdateCommandandCliUpdateNotifierUpdated notification message
ConsoleInteractionService.DisplayVersionUpdateNotification()now includes appropriate update commanddotnet tool update aspire.clifor dotnet tool installationsaspire update --selffor native binary installations[white]markup for better visibility[yellow]A new version of the Aspire CLI is available: {0}. Use [white]{1}[/] to update.[/]Interface changes
updateCommandparameter fromIInteractionService.DisplayVersionUpdateNotification()Localization
InteractionServiceStrings.resxto include update command placeholder with highlighting markup.xlftranslations as needing updateOutput
Dotnet tool:
Native binary:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.