- 
                Notifications
    You must be signed in to change notification settings 
- Fork 715
Add scripts to download aspire-cli #10254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
    
  
     Merged
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            37 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      3ffcd36
              
                Add scripts to download aspire-cli
              
              
                radical 06552a2
              
                Update eng/scripts/get-aspire-cli.sh
              
              
                radical c45b215
              
                Merge remote-tracking branch 'origin/main' into get-aspire-cli-scripts
              
              
                radical bc855ed
              
                update the scripts
              
              
                radical 8c4edc4
              
                Update eng/scripts/get-aspire-cli.sh
              
              
                radical 372f899
              
                Update eng/scripts/get-aspire-cli.ps1
              
              
                radical 0820d14
              
                add a README.md
              
              
                radical 8f4d0bc
              
                update README.md
              
              
                radical 0621834
              
                address review feedback from @ eerhardt
              
              
                radical c8dccb8
              
                Address review feedback from @ blowdart and use mime-type to detect w…
              
              
                radical 6664feb
              
                fix ps1 for modern powershell
              
              
                radical 01ecfac
              
                Cleanup the ps1 script
              
              
                radical 73b1379
              
                clean up .sh script, and don't use that ldd is available
              
              
                radical 877c329
              
                Merge remote-tracking branch 'origin/main' into get-aspire-cli-scripts
              
              
                radical 6561c32
              
                Update eng/scripts/get-aspire-cli.ps1
              
              
                radical 41544b0
              
                Use different names for persistent and session scoped networks (#10278)
              
              
                danegsta affb837
              
                Address review feedback from @ eerhardt and bump archive download tim…
              
              
                radical 95dfd0c
              
                Address review feedback from @ eerhardt and change Channel parameter …
              
              
                radical 2fb6065
              
                Merge remote-tracking branch 'origin/main' into get-aspire-cli-scripts
              
              
                radical ae772b0
              
                Address review feedback from @ eerhardt - update README.md
              
              
                radical 48b262f
              
                Address review feedback - Rename BuildQuality to Quality
              
              
                radical f788557
              
                Merge remote-tracking branch 'origin/main' into get-aspire-cli-scripts
              
              
                radical 3986ae1
              
                Merge remote-tracking branch 'origin/main' into get-aspire-cli-scripts
              
              
                radical 7e6506f
              
                Improve Aspire CLI download script with auto-installation and PATH ma…
              
              
                radical c09d588
              
                update ps1
              
              
                radical 67908b4
              
                Merge remote-tracking branch 'origin/main' into get-aspire-cli-scripts
              
              
                radical e85ae0b
              
                update README.md
              
              
                radical 2a43c92
              
                Update eng/scripts/get-aspire-cli.sh
              
              
                radical 3baae6e
              
                Add the install path to the PATH env var also
              
              
                radical ef81d43
              
                refactor to extract function to get install path
              
              
                radical 5b01fe0
              
                Extract method to download and install the archive
              
              
                radical 323b9bc
              
                some cleanup and refactoring
              
              
                radical 205d15b
              
                cleanup
              
              
                radical cd1d032
              
                Update eng/scripts/get-aspire-cli.sh
              
              
                radical 4d6e44e
              
                fix script
              
              
                radical a0dadea
              
                Merge remote-tracking branch 'origin/main' into get-aspire-cli-scripts
              
              
                radical d12589b
              
                Address review feedback from @ davidfowl
              
              
                radical File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      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
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,162 @@ | ||
| # Aspire CLI Download Scripts | ||
|  | ||
| This directory contains scripts to download and install the Aspire CLI for different platforms. | ||
|  | ||
| ## Scripts | ||
|  | ||
| - **`get-aspire-cli.sh`** - Bash script for Unix-like systems (Linux, macOS) | ||
| - **`get-aspire-cli.ps1`** - PowerShell script for cross-platform use (Windows, Linux, macOS) | ||
|  | ||
| ## Current Limitations | ||
|  | ||
| ⚠️ **Important**: Currently, only the following combination works: | ||
| - **Version**: `9.0` | ||
| - **Quality**: `daily` | ||
|  | ||
| Other version/quality combinations are not yet available through the download URLs. | ||
|  | ||
| ## Parameters | ||
|  | ||
| ### Bash Script (`get-aspire-cli.sh`) | ||
|  | ||
| | Parameter | Short | Description | Default | | ||
| |------------------|-------|---------------------------------------------------|-----------------------| | ||
| | `--install-path` | `-i` | Directory to install the CLI | `$HOME/.aspire/bin` | | ||
| | `--version` | | Version of the Aspire CLI to download | `9.0` | | ||
| | `--quality` | `-q` | Quality to download | `daily` | | ||
| | `--os` | | Operating system (auto-detected if not specified) | auto-detect | | ||
| | `--arch` | | Architecture (auto-detected if not specified) | auto-detect | | ||
| | `--keep-archive` | `-k` | Keep downloaded archive files after installation | `false` | | ||
| | `--verbose` | `-v` | Enable verbose output | `false` | | ||
| | `--help` | `-h` | Show help message | | | ||
|  | ||
| ### PowerShell Script (`get-aspire-cli.ps1`) | ||
|  | ||
| | Parameter | Description | Default | | ||
| |-----------------|---------------------------------------------------|----------------------------------| | ||
| | `-InstallPath` | Directory to install the CLI | `$HOME/.aspire/bin` (Unix) / `%USERPROFILE%\.aspire\bin` (Windows) | | ||
| | `-Version` | Version of the Aspire CLI to download | `9.0` | | ||
| | `-Quality` | Quality to download | `daily` | | ||
| | `-OS` | Operating system (auto-detected if not specified) | auto-detect | | ||
| | `-Architecture` | Architecture (auto-detected if not specified) | auto-detect | | ||
| | `-KeepArchive` | Keep downloaded archive files after installation | `false` | | ||
| | `-Help` | Show help message | | | ||
|  | ||
| ## Install Path Parameter | ||
|  | ||
| The `--install-path` (bash) or `-InstallPath` (PowerShell) parameter specifies where the Aspire CLI will be installed: | ||
|  | ||
| - **Default behavior**: | ||
| - **Unix systems**: `$HOME/.aspire/bin` | ||
| - **Windows**: `%USERPROFILE%\.aspire\bin` | ||
| - **Custom path**: You can specify any directory path where you want the CLI installed | ||
| - **Directory creation**: The scripts will automatically create the directory if it doesn't exist | ||
| - **PATH integration**: The scripts automatically update the current session's PATH and add to shell profiles for persistent access | ||
| - **Final location**: The CLI executable will be placed directly in the specified directory as: | ||
| - `aspire` (on Linux/macOS) | ||
| - `aspire.exe` (on Windows) | ||
|  | ||
| ### Example Install Paths | ||
|  | ||
| ```bash | ||
| # Default - installs to $HOME/.aspire/bin/aspire | ||
| ./get-aspire-cli.sh | ||
|  | ||
| # Custom path - installs to /usr/local/bin/aspire | ||
| ./get-aspire-cli.sh --install-path "/usr/local/bin" | ||
|  | ||
| # Relative path - installs to ../tools/aspire-cli/aspire | ||
| ./get-aspire-cli.sh --install-path "../tools/aspire-cli" | ||
| ``` | ||
|  | ||
| ## Usage Examples | ||
|  | ||
| ### Bash Script Examples | ||
|  | ||
| ```bash | ||
| # Basic usage - download to default location ($HOME/.aspire/bin) | ||
| ./get-aspire-cli.sh | ||
|  | ||
| # Specify custom install directory | ||
| ./get-aspire-cli.sh --install-path "/usr/local/bin" | ||
|  | ||
| # Download with verbose output | ||
| ./get-aspire-cli.sh --verbose | ||
|  | ||
| # Keep the downloaded archive files for inspection | ||
| ./get-aspire-cli.sh --keep-archive | ||
|  | ||
| # Force specific OS and architecture (useful for cross-compilation scenarios) | ||
| ./get-aspire-cli.sh --os "linux" --arch "x64" | ||
|  | ||
| # Combine multiple options | ||
| ./get-aspire-cli.sh --install-path "/tmp/aspire" --verbose --keep-archive | ||
| ``` | ||
|  | ||
| ### PowerShell Script Examples | ||
|  | ||
| ```powershell | ||
| # Basic usage - download to default location (%USERPROFILE%\.aspire\bin or $HOME/.aspire/bin) | ||
| .\get-aspire-cli.ps1 | ||
|  | ||
| # Specify custom install directory | ||
| .\get-aspire-cli.ps1 -InstallPath "C:\Tools\Aspire" | ||
|  | ||
| # Download with verbose output | ||
| .\get-aspire-cli.ps1 -Verbose | ||
|  | ||
| # Keep the downloaded archive files for inspection | ||
| .\get-aspire-cli.ps1 -KeepArchive | ||
|  | ||
| # Force specific OS and architecture | ||
| .\get-aspire-cli.ps1 -OS "win" -Architecture "x64" | ||
|  | ||
| # Combine multiple options | ||
| .\get-aspire-cli.ps1 -InstallPath "C:\temp\aspire" -Verbose -KeepArchive | ||
| ``` | ||
|  | ||
| ## Supported Runtime Identifiers | ||
|  | ||
| The following runtime identifier (RID) combinations are available: | ||
|  | ||
| | Runtime Identifier | AOTed | | ||
| |-------------------|-------------| | ||
| | `win-x64` | ✅ | | ||
| | `win-arm64` | ✅ | | ||
| | `win-x86` | ❌ | | ||
| | `linux-x64` | ✅ | | ||
| | `linux-arm64` | ❌ | | ||
| | `linux-musl-x64` | ❌ | | ||
| | `osx-x64` | ✅ | | ||
| | `osx-arm64` | ✅ | | ||
|  | ||
| The non-aot binaries are self-contained executables. | ||
|  | ||
| ## Troubleshooting | ||
|  | ||
| ### Common Issues | ||
|  | ||
| 1. **"Unsupported platform" error**: Your OS/architecture combination may not be supported | ||
| 2. **"Failed to download" error**: Check your internet connection and firewall settings | ||
| 3. **"Checksum validation failed" error**: The download may have been corrupted; try again | ||
| 4. **"HTML error page" error**: The requested version/platform combination may not be available | ||
|  | ||
| ### Getting Help | ||
|  | ||
| Run the scripts with the help flag to see detailed usage information: | ||
|  | ||
| ```bash | ||
| ./get-aspire-cli.sh --help | ||
| ``` | ||
|  | ||
| ```powershell | ||
| .\get-aspire-cli.ps1 -Help | ||
| ``` | ||
|  | ||
| ## Contributing | ||
|  | ||
| When modifying these scripts, ensure: | ||
| - Both scripts maintain feature parity where possible | ||
| - Error handling is comprehensive and user-friendly | ||
| - Platform detection logic is robust | ||
| - Security best practices are followed for downloads and file handling | ||
      
      Oops, something went wrong.
        
    
  
      
      Oops, something went wrong.
        
    
  
  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.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.