import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

<Tabs
  groupId="platform"
  defaultValue="brew"
  values={[
	{ label: "Homebrew", value: "brew" },
    { label: 'Mac (Intel/AMD)', value: 'mac', },
    { label: 'Mac (Silicon/ARM)', value: 'mac-arm', },
    { label: 'Linux (AMD)', value: 'linux', },
    { label: 'Linux (ARM)', value: 'linux-arm', },
    { label: 'Windows Powershell', value: 'windows', },
  ]
}>
<TabItem value="brew">

```bash
brew install loft-sh/tap/vcluster
```

If you installed the CLI using `brew install loft-sh/tap/vcluster`, you should `brew uninstall vcluster` and then install using the tap.
The binaries in the tap are signed using the [Sigstore](https://docs.sigstore.dev/) framework for enhanced security.

</TabItem>
<TabItem value="mac">

```bash
curl -L -o vcluster "https://github.com/loft-sh/vcluster/releases/latest/download/vcluster-darwin-amd64" && sudo install -c -m 0755 vcluster /usr/local/bin && rm -f vcluster
```

</TabItem>
<TabItem value="mac-arm">

```bash
curl -L -o vcluster "https://github.com/loft-sh/vcluster/releases/latest/download/vcluster-darwin-arm64" && sudo install -c -m 0755 vcluster /usr/local/bin && rm -f vcluster
```

</TabItem>
<TabItem value="linux">

```bash
curl -L -o vcluster "https://github.com/loft-sh/vcluster/releases/latest/download/vcluster-linux-amd64" && sudo install -c -m 0755 vcluster /usr/local/bin && rm -f vcluster
```

</TabItem>
<TabItem value="linux-arm">

```bash
curl -L -o vcluster "https://github.com/loft-sh/vcluster/releases/latest/download/vcluster-linux-arm64" && sudo install -c -m 0755 vcluster /usr/local/bin && rm -f vcluster
```

</TabItem>
<TabItem value="windows">

```powershell {4}
md -Force "$Env:APPDATA\vcluster"; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]'Tls,Tls11,Tls12';
Invoke-WebRequest -URI "https://github.com/loft-sh/vcluster/releases/latest/download/vcluster-windows-amd64.exe" -o $Env:APPDATA\vcluster\vcluster.exe;
$env:Path += ";" + $Env:APPDATA + "\vcluster";
[Environment]::SetEnvironmentVariable("Path", $env:Path, [System.EnvironmentVariableTarget]::User);
```

:::caution Reboot Required
You may need to reboot your computer to use the CLI due to changes to the PATH variable (see below).
:::

:::info Check Environment Variable $PATH
Line 4 of this install script adds the install directory `%APPDATA%\vcluster` to the `$PATH`environment variable. This is only effective for the current Powershell session, i.e. when opening a new terminal window,`vcluster` may not be found.

**Make sure to add the folder `%APPDATA%\vcluster` to the `PATH` environment variable after installing vcluster CLI via Powershell. Afterward, a reboot might be necessary.**
:::

</TabItem>
</Tabs>

Alternatively, you can download the binary for your platform from the [GitHub Releases](https://github.com/loft-sh/vcluster/releases) page and add this binary to your PATH.

To confirm that vCluster CLI is successfully installed, test via:

```bash
vcluster --version
```
