Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
124e804
Add scripts to download aspire-cli
radical Jul 3, 2025
eab9aad
Update eng/scripts/get-aspire-cli.sh
radical Jul 3, 2025
afec3e4
update the scripts
radical Jul 7, 2025
3acc3f1
Update eng/scripts/get-aspire-cli.sh
radical Jul 7, 2025
667e922
Update eng/scripts/get-aspire-cli.ps1
radical Jul 7, 2025
ffef1d7
add a README.md
radical Jul 7, 2025
850604b
update README.md
radical Jul 7, 2025
1e96ef6
address review feedback from @ eerhardt
radical Jul 7, 2025
1f3e548
Address review feedback from @ blowdart and use mime-type to detect w…
radical Jul 7, 2025
6167436
fix ps1 for modern powershell
radical Jul 7, 2025
01810e0
Cleanup the ps1 script
radical Jul 7, 2025
4180279
clean up .sh script, and don't use that ldd is available
radical Jul 7, 2025
fd95e49
Update eng/scripts/get-aspire-cli.ps1
radical Jul 8, 2025
5d1be62
Address review feedback from @ eerhardt and bump archive download tim…
radical Jul 8, 2025
0eb1c78
Address review feedback from @ eerhardt and change Channel parameter …
radical Jul 8, 2025
398474c
Address review feedback from @ eerhardt - update README.md
radical Jul 9, 2025
15aa851
Address review feedback - Rename BuildQuality to Quality
radical Jul 9, 2025
89b1876
Improve Aspire CLI download script with auto-installation and PATH ma…
radical Jul 14, 2025
f27b2ea
update ps1
radical Jul 14, 2025
4004c7c
update README.md
radical Jul 14, 2025
983aad3
Update eng/scripts/get-aspire-cli.sh
radical Jul 14, 2025
84501f6
Add the install path to the PATH env var also
radical Jul 14, 2025
89322ad
refactor to extract function to get install path
radical Jul 14, 2025
cf16569
Extract method to download and install the archive
radical Jul 14, 2025
9ae435c
some cleanup and refactoring
radical Jul 15, 2025
cddd5fd
cleanup
radical Jul 15, 2025
88f1b66
Update eng/scripts/get-aspire-cli.sh
radical Jul 15, 2025
9d11a51
fix script
radical Jul 15, 2025
75a065c
Address review feedback from @ davidfowl
radical Jul 15, 2025
8079f37
get-aspire-cli.ps1: Prepend the installation path to PATH instead of …
radical Jul 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
162 changes: 162 additions & 0 deletions eng/scripts/README.md
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
Loading