Add scripts to download aspire-cli#10254
Conversation
Only works with `https://aka.ms/dotnet/9.0/daily/aspire-cli-${os}-${arch}.{zip,.tar.gz}` style urls.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
eng/scripts/get-aspire-cli.sh
Outdated
| printf "Downloading from: %s\n" "$url" | ||
| printf "Saving to: %s\n" "$filename" | ||
|
|
||
| if curl -fsSL -o "$filename" "$url"; then |
There was a problem hiding this comment.
Let's check with security experts but I believe we'd want to have explicit cert verification like: curl -fsSL --tlsv1.2 --cert-status -o "$filename" "$url"
There was a problem hiding this comment.
Might also want to add a connect-timeout and a max-time
eng/scripts/get-aspire-cli.ps1
Outdated
| Write-Host "Saving to: $filename" | ||
|
|
||
| try { | ||
| Invoke-WebRequest -Uri $url -OutFile $filename -MaximumRedirection 10 |
There was a problem hiding this comment.
dotnet-install.ps1 has something similar - https://github.com/dotnet/install-scripts/blob/8b5963d70695cd89e8f5193e92e35510b5c55013/src/dotnet-install.ps1#L1018
But that function might be better. We could copy that here.
eng/scripts/get-aspire-cli.sh
Outdated
| printf "Downloading from: %s\n" "$url" | ||
| printf "Saving to: %s\n" "$filename" | ||
|
|
||
| if curl -fsSL -o "$filename" "$url"; then |
eng/scripts/get-aspire-cli.sh
Outdated
| printf "Downloading from: %s\n" "$url" | ||
| printf "Saving to: %s\n" "$filename" | ||
|
|
||
| if curl -fsSL -o "$filename" "$url"; then |
|
What minimum version of powershell can the script here expect? |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
I have updated the scripts to be little more comprehensive. Issues:
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@DamianEdwards I updated the script to add the PATH to the powershell session and the User PATH environment variable. |
There was a problem hiding this comment.
Pull Request Overview
This PR adds cross-platform scripts to download and install the Aspire CLI, along with comprehensive usage documentation.
- Introduces a Bash script (
get-aspire-cli.sh) for Unix-like systems - Introduces a PowerShell script (
get-aspire-cli.ps1) for cross-platform use - Adds
README.mdwith usage instructions, supported platforms, and troubleshooting
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| eng/scripts/get-aspire-cli.sh | New Bash script to download, validate, and install the CLI |
| eng/scripts/get-aspire-cli.ps1 | New PowerShell script to download, validate, and install the CLI |
| eng/scripts/README.md | Documentation for script usage, parameters, supported RIDs, and troubleshooting |
Comments suppressed due to low confidence (3)
eng/scripts/README.md:128
- The Supported Runtime Identifiers table marks
linux-arm64as unsupported, but the scripts detect and support ARM64 on Linux. Please update this entry to match actual support.
| `linux-arm64` | ❌ |
eng/scripts/get-aspire-cli.sh:1
- [nitpick] There are no automated tests for this script; consider adding integration or unit tests (e.g., using a testing framework or CI job) to cover key behaviors and prevent regressions.
#!/usr/bin/env bash
eng/scripts/README.md:43
- [nitpick] The PowerShell script supports the common
-Verboseswitch (viaCmdletBinding), but it isn't listed in the parameters table. Consider adding-Verboseto the documented options.
| `-Help` | Show help message | |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
The windows script exits the shell: 1 Add the helper flag near the top of
|
| Scenario | Command | Result |
|---|---|---|
| Interactive dev console | iex "& { $(irm https://aka.ms/get-aspire-cli.ps1) }" |
Prompt returns; $env:PATH patched for this session; no shell exit. |
| CI / scripted setup | pwsh -NoProfile -ExecutionPolicy Bypass -File get-aspire-cli.ps1 -Version 9.0 |
Process ends with exit 0 (or 1 on failure) – perfect for pipeline step status. |
That’s it: a two‑line guard preserves CI‑friendly exit codes and keeps local shells alive when you pipe the script through iex.
|
One more thing: This does not update the session path. |
|
/backport to release/9.4 |
|
Started backporting to release/9.4: https://github.com/dotnet/aspire/actions/runs/16301668214 |
Add scripts to download aspire-cli
This PR introduces two cross-platform scripts for downloading and installing the Aspire CLI from the official Microsoft distribution channels:
eng/scripts/get-aspire-cli.sh- Bash script for Unix-like systems (Linux, macOS)eng/scripts/get-aspire-cli.ps1- PowerShell script for cross-platform use (Windows, Linux, macOS)Both scripts provide feature parity and follow platform-specific best practices for robust, secure CLI installation.
Core Features
Download & Installation
https://aka.ms/dotnet/{version}/{quality}/aspire-cli-{os}-{arch}.{zip,tar.gz}9.0) and build qualities (default:daily)$HOME/.aspire/bin)9.0version withdailyquality is availablePATH Integration
GITHUB_PATH)Platform Support
win-x64,win-arm64(ZIP archives)linux-x64,linux-musl-x64(tar.gz archives)osx-x64,osx-arm64(tar.gz archives)Security & Reliability
Developer Features
curl | bash)Usage Examples
Bash Script
PowerShell Script
Documentation
eng/scripts/README.mdwith detailed usage instructionsFixes #9642