Add --install-mode tool support to get-aspire-cli-pr scripts#16535
Draft
Add --install-mode tool support to get-aspire-cli-pr scripts#16535
--install-mode tool support to get-aspire-cli-pr scripts#16535Conversation
Agent-Logs-Url: https://github.com/microsoft/aspire/sessions/7386b0f6-6cac-4fdb-9b70-257989d23768 Co-authored-by: radical <1472+radical@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/aspire/sessions/7386b0f6-6cac-4fdb-9b70-257989d23768 Co-authored-by: radical <1472+radical@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add option to install Aspire CLI from dotnet-tool package
Apr 28, 2026
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 16535Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 16535" |
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
The PR dogfooding scripts (
get-aspire-cli-pr.{sh,ps1}) only installed the CLI from RID-specific native archives. They now also support installing theAspire.Clidotnet tool globally from the same PR's NuGet hive.New flags (default behavior unchanged):
--install-mode archive|tool/-InstallMode Archive|Tool--force/-Force— required to replace an existing globalAspire.Cli(usesdotnet tool update --allow-downgradeso PR versions can be pinned in either direction).Tool-mode flow:
cli-native-archives-<rid>download; still downloads/installsbuilt-nugets+built-nugets-for-<rid>into the hive.Aspire.Cli.<version>.nupkgin the populated hive, parses the exact version, and runsdotnet tool install --global Aspire.Cli --version <v> --add-source <hive>(orupdate --allow-downgradewith--force). Fails fast on zero/multipleAspire.Clipackages.aspire config set -g channelthrough the resolved global tool shim path; routes PATH update to the dotnet global tools directory instead of<install-path>/bin.--skip-extension).Validations (tool mode, when not
--hive-only):--install-path(would split CLI location from hive location).dotneton PATH.Aspire.Cliand fails unless--forceis set.--hive-onlycontinues to bypass all tool-mode-only checks.Tests: new
PRScriptToolModeTests(23 tests, bash + PowerShell) covering help text, invalid-mode rejection, dry-run/WhatIf flow (asserts native archive is skipped anddotnet tool install ... --add-source <hive>is shown), custom-install-path rejection, hive-only bypass, extension preservation, PATH routing, andfind_aspire_cli_package_version/Find-AspireCliPackageVersionfor success/missing/multiple cases.Checklist
<remarks />and<code />elements on your triple slash comments?aspire.devissue:Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
7k6vsblobprodcus337.vsblob.vsassets.io/usr/share/dotnet/dotnet dotnet build tests/Aspire.Acquisition.Tests/Aspire.Acquisition.Tests.csproj(dns block)/usr/share/dotnet/dotnet dotnet test --project tests/Aspire.Acquisition.Tests/Aspire.Acquisition.Tests.csproj --no-launch-profile -- --filter-class *.PRScriptToolModeTests --filter-not-trait quarantined=true --filter-not-trait outerloop=true t-in��(dns block)https://api.github.com/graphql/usr/bin/gh gh api graphql -f query=query($owner:String!, $name:String!, $number:Int!) { repository(owner:$owner, name:$name) { pullRequest(number:$number) { headRefOid } } } -f owner=microsoft -f name=aspire -F number=1234 --jq .data.repository.pullRequest.headRefOid(http block)https://api.github.com/repos/microsoft/aspire/pulls/1234/usr/bin/gh gh api repos/microsoft/aspire/pulls/1234 --jq .head.sha(http block)If you need me to access, download, or install something from one of these locations, you can either: