
> **Note:** Linux is the reference platform. Windows is supported via bundled JRE and the `varyup` toolchain manager.

## Quick install

One command installs [varyup](/docs/varyup/) (the toolchain manager) and the latest Vary toolchain.

Open **PowerShell** and run:

```powershell
irm https://github.com/ccollicutt/vary/releases/latest/download/install.ps1 | iex
```

This will download `varyup.exe` to `%LOCALAPPDATA%\vary\bin\`, install the latest Vary toolchain, and install the `vary.exe` compiler shim.

Then add `%LOCALAPPDATA%\vary\bin` to your user PATH:

```powershell
$path = [Environment]::GetEnvironmentVariable("Path", "User")
[Environment]::SetEnvironmentVariable("Path", "$env:LOCALAPPDATA\vary\bin;$path", "User")
```

> **Note:** The installer does not modify your PATH automatically. Adding the PATH entry is a manual step by design, so nothing is changed in your environment without your knowledge.

Open a **new terminal**, then verify:

```powershell
vary --version
```

You should see:

```text
Vary vX-alpha.Y
```

### Options

| Parameter | Effect |
|-----------|--------|
| `-SkipToolchain` | Skip automatic toolchain install |

Environment variables `VARY_HOME` (default: `%LOCALAPPDATA%\vary`) and `VARY_RELEASE_URL` can override defaults.

## Manual install

If you prefer not to pipe to `iex`, you can install manually:

### 1. Download varyup

```powershell
$varyBin = "$env:LOCALAPPDATA\vary\bin"
mkdir $varyBin -ErrorAction SilentlyContinue
Invoke-WebRequest "https://github.com/ccollicutt/vary/releases/latest/download/varyup-windows-x64.exe" -OutFile "$varyBin\varyup.exe"
```

### 2. Verify checksum

```powershell
$sums = (Invoke-WebRequest "https://github.com/ccollicutt/vary/releases/latest/download/SHA256SUMS" -UseBasicParsing).Content
$expected = (($sums -split "`n") | Where-Object { $_ -match "varyup-windows-x64.exe$" }) -split "\s+" | Select-Object -First 1
$actual = (Get-FileHash "$varyBin\varyup.exe" -Algorithm SHA256).Hash.ToLower()
if ($actual -ne $expected) { Write-Error "Checksum mismatch! Expected $expected, got $actual" }
else { Write-Host "Checksum verified" }
```

If the check fails, delete the binary and retry the download.

### 3. Add to PATH

```powershell
$varyBin = "$env:LOCALAPPDATA\vary\bin"
$path = [Environment]::GetEnvironmentVariable("Path", "User")
if ($path -notlike "*$varyBin*") {
    [Environment]::SetEnvironmentVariable("Path", "$path;$varyBin", "User")
    $env:Path += ";$varyBin"
}
```

Or add `%LOCALAPPDATA%\vary\bin` through **Settings > System > About > Advanced system settings > Environment Variables > User Path**.

Open a new terminal and install a toolchain:

```powershell
varyup toolchain install latest
```

## Managing toolchains

List available versions:

```powershell
varyup toolchain list-available
```

Install a specific version:

```powershell
varyup toolchain install <version>
```

Short aliases are available:

```bash
varyup tc la   # list-available
varyup tc i    # install
```

Run `varyup` with no arguments to see all commands and aliases.

## Install VS Code extension

Each toolchain bundles the Vary VS Code extension. Install it with:

```powershell
varyup vscode install
```

See [VS Code](/docs/vscode/) for full extension documentation.

## Next steps

| Action | Link |
|--------|------|
| Manage versions, update, pin per-project | [varyup](/docs/varyup/) |
| Write your first program | [Getting Started](/docs/getting-started/) |
| Run `vary test` on examples | [Testing](/docs/test-dsl/) |
| Run `vary mutate` on examples | [Mutation testing](/docs/mutation/testing/) |
