Skip to content
Merged
Show file tree
Hide file tree
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 Jul 3, 2025
06552a2
Update eng/scripts/get-aspire-cli.sh
radical Jul 3, 2025
c45b215
Merge remote-tracking branch 'origin/main' into get-aspire-cli-scripts
radical Jul 7, 2025
bc855ed
update the scripts
radical Jul 7, 2025
8c4edc4
Update eng/scripts/get-aspire-cli.sh
radical Jul 7, 2025
372f899
Update eng/scripts/get-aspire-cli.ps1
radical Jul 7, 2025
0820d14
add a README.md
radical Jul 7, 2025
8f4d0bc
update README.md
radical Jul 7, 2025
0621834
address review feedback from @ eerhardt
radical Jul 7, 2025
c8dccb8
Address review feedback from @ blowdart and use mime-type to detect w…
radical Jul 7, 2025
6664feb
fix ps1 for modern powershell
radical Jul 7, 2025
01ecfac
Cleanup the ps1 script
radical Jul 7, 2025
73b1379
clean up .sh script, and don't use that ldd is available
radical Jul 7, 2025
877c329
Merge remote-tracking branch 'origin/main' into get-aspire-cli-scripts
radical Jul 7, 2025
6561c32
Update eng/scripts/get-aspire-cli.ps1
radical Jul 8, 2025
41544b0
Use different names for persistent and session scoped networks (#10278)
danegsta Jul 7, 2025
affb837
Address review feedback from @ eerhardt and bump archive download tim…
radical Jul 8, 2025
95dfd0c
Address review feedback from @ eerhardt and change Channel parameter …
radical Jul 8, 2025
2fb6065
Merge remote-tracking branch 'origin/main' into get-aspire-cli-scripts
radical Jul 8, 2025
ae772b0
Address review feedback from @ eerhardt - update README.md
radical Jul 9, 2025
48b262f
Address review feedback - Rename BuildQuality to Quality
radical Jul 9, 2025
f788557
Merge remote-tracking branch 'origin/main' into get-aspire-cli-scripts
radical Jul 11, 2025
3986ae1
Merge remote-tracking branch 'origin/main' into get-aspire-cli-scripts
radical Jul 13, 2025
7e6506f
Improve Aspire CLI download script with auto-installation and PATH ma…
radical Jul 14, 2025
c09d588
update ps1
radical Jul 14, 2025
67908b4
Merge remote-tracking branch 'origin/main' into get-aspire-cli-scripts
radical Jul 14, 2025
e85ae0b
update README.md
radical Jul 14, 2025
2a43c92
Update eng/scripts/get-aspire-cli.sh
radical Jul 14, 2025
3baae6e
Add the install path to the PATH env var also
radical Jul 14, 2025
ef81d43
refactor to extract function to get install path
radical Jul 14, 2025
5b01fe0
Extract method to download and install the archive
radical Jul 14, 2025
323b9bc
some cleanup and refactoring
radical Jul 15, 2025
205d15b
cleanup
radical Jul 15, 2025
cd1d032
Update eng/scripts/get-aspire-cli.sh
radical Jul 15, 2025
4d6e44e
fix script
radical Jul 15, 2025
a0dadea
Merge remote-tracking branch 'origin/main' into get-aspire-cli-scripts
radical Jul 15, 2025
d12589b
Address review feedback from @ davidfowl
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
Loading