Skip to content

Add update instructions to CLI version notification message#12391

Closed
Copilot wants to merge 3 commits intomainfrom
copilot/update-aspire-cli-message
Closed

Add update instructions to CLI version notification message#12391
Copilot wants to merge 3 commits intomainfrom
copilot/update-aspire-cli-message

Conversation

Copy link
Contributor

Copilot AI commented Oct 26, 2025

Update CLI version notification messages to include update instructions

Summary:
This PR updates the CLI version notification to show specific update instructions based on how the CLI is running.

Changes:

  • Update resource strings in InteractionServiceStrings.resx to add new message formats
  • Update ConsoleInteractionService.DisplayVersionUpdateNotification to detect if running as dotnet tool
  • Show "aspire update --self" for native binary
  • Show "dotnet tool update aspire.cli" for dotnet tool
  • Update Designer.cs file for the resource strings
  • Build and test the changes (497 tests pass)
  • Verify the messages appear correctly in both scenarios
  • Centralize IsRunningAsDotNetTool logic in CliHostEnvironment

Expected Output:

When running as dotnet tool:

A new version of the Aspire CLI is available: 13.0.0-preview.1.25526.1. Use dotnet tool update aspire.cli to update.
For more information, see: https://aka.ms/aspire/update

When running as native binary:

A new version of the Aspire CLI is available: 13.0.0-preview.1.25526.1. Use aspire update --self to update.
For more information, see: https://aka.ms/aspire/update

Implementation Details:

  • Centralized IsRunningAsDotNetTool() in CliHostEnvironment.cs as a shared static helper
  • Uses Environment.ProcessPath to detect if running as dotnet tool
  • Detects by checking if process filename is "dotnet" or "dotnet.exe"
  • All existing tests continue to pass
  • Added new test to verify update command is included in notification
Original prompt

We still have this message for upgrading the aspire CLI
"A new version of the Aspire CLI is available: 13.0.0-preview.1.25526.1
For more information, see: https://aka.ms/aspire/update"

It should be updated to show update instructions:

When not running as a dotnet tool:

"A new version of the Aspire CLI is available: 13.0.0-preview.1.25526.1. Use aspire update --self to update.
For more information, see: https://aka.ms/aspire/update"

When using a dotnet tool:

"A new version of the Aspire CLI is available: 13.0.0-preview.1.25526.1. Use dotnet tool update aspire.cli to update.
For more information, see: https://aka.ms/aspire/update"


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

- Modified InteractionServiceStrings.resx to include update command parameter
- Updated ConsoleInteractionService to detect if running as dotnet tool
- Shows "aspire update --self" for native binary
- Shows "dotnet tool update aspire.cli" for dotnet tool
- Updated Designer.cs for resource strings
- Added test to verify update message includes command

Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
Copilot AI changed the title [WIP] Update Aspire CLI upgrade message with instructions Add update instructions to CLI version notification message Oct 26, 2025
Copilot AI requested a review from davidfowl October 26, 2025 15:34
@davidfowl
Copy link
Member

@copilot Centralize IsRunningAsDotNetTool logic, it exists in UpdateCommand, make it a shared helper.

Move duplicate IsRunningAsDotNetTool method from UpdateCommand and
ConsoleInteractionService to a shared static method in CliHostEnvironment.
This reduces code duplication and provides a single source of truth for
detecting whether the CLI is running as a dotnet tool or native binary.

Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Oct 26, 2025

@copilot Centralize IsRunningAsDotNetTool logic, it exists in UpdateCommand, make it a shared helper.

Done. Moved IsRunningAsDotNetTool() to CliHostEnvironment as a public static method and updated both UpdateCommand and ConsoleInteractionService to use it. (0d4c347)

@davidfowl davidfowl requested a review from mitchdenny October 27, 2025 01:23
@davidfowl davidfowl closed this Nov 2, 2025
@dotnet-policy-service dotnet-policy-service bot added this to the 13.1 milestone Nov 2, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Dec 3, 2025
@sebastienros sebastienros deleted the copilot/update-aspire-cli-message branch January 15, 2026 16:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants