# Installation

The Escape CLI is distributed as a standalone binary for all major operating systems. Choose the installation method that best fits your environment.

## Prerequisites

- **Operating System**: Linux, macOS, or Windows
- **Architecture**: x64 or ARM64 on Linux and macOS; x64 on Windows
- **Privileges**: Administrative access may be required for system-wide installation

## Quick Install

### MacOS (Homebrew)

The recommended way to install the Escape CLI on macOS is via Homebrew:

```bash
brew install --cask escape-technologies/tap/escape-cli
```

**Upgrade to the latest version:**

```bash
brew upgrade --cask escape-technologies/tap/escape-cli
```

Homebrew handles binary placement, PATH configuration, and macOS Gatekeeper attributes automatically.

**Verify the installation:**

```bash
escape-cli version
```

### Linux

Install the Escape CLI using the automated installation script:

```bash
curl -sf https://raw.githubusercontent.com/Escape-Technologies/cli/refs/heads/main/scripts/install.sh | sudo bash
```

This script automatically:

- Detects your operating system and architecture
- Downloads the appropriate binary
- Installs it to `/usr/local/bin/escape-cli`
- Sets proper execution permissions

**Verify the installation:**

```bash
escape-cli version
```

### Windows

Install using PowerShell with administrative privileges:

```powershell
powershell -c "irm https://raw.githubusercontent.com/Escape-Technologies/cli/refs/heads/main/scripts/install.ps1 | iex"
```

**Verify the installation:**

```powershell
escape-cli version
```

## Docker Installation

The Escape CLI is available as a Docker image for containerized environments and CI/CD pipelines.

### Pull the Image

```bash
docker pull escapetech/cli:latest
```

### Run Commands

```bash
docker run -e ESCAPE_API_KEY="${ESCAPE_API_KEY}" -it --rm escapetech/cli:latest version
```

### Use in Docker Compose

```yaml
services:
  escape-cli:
    image: escapetech/cli:latest
    environment:
      - ESCAPE_API_KEY=${ESCAPE_API_KEY}
```

## Helm Deployment

For Private Locations in Kubernetes, use the [Helm deployment guide](<https://docs.escape.tech/documentation/platform/private-location/deployment/index.md>).

## Manual Installation

For environments requiring manual installation or specific version control:

### Download and Extract the Archive

Visit [GitHub Releases](<https://github.com/Escape-Technologies/cli/releases>) and select the archive for your platform. Release tags use `v<version>`; archive names omit the `v`:

- `cli_<version>_linux_amd64.tar.gz`: Linux x64
- `cli_<version>_linux_arm64.tar.gz`: Linux ARM64
- `cli_<version>_darwin_amd64.tar.gz`: macOS Intel
- `cli_<version>_darwin_arm64.tar.gz`: macOS Apple Silicon
- `cli_<version>_windows_amd64.zip`: Windows x64

**Linux/macOS:**

```bash
# Example: Linux x64, release v1.9.1
curl -fL -o cli.tar.gz https://github.com/Escape-Technologies/cli/releases/download/v1.9.1/cli_1.9.1_linux_amd64.tar.gz
tar -xzf cli.tar.gz
sudo install -m 755 escape-cli /usr/local/bin/escape-cli
```

**Windows:**

Extract the ZIP archive, move `escape-cli.exe` to a directory in your PATH, such as `C:\Program Files\Escape\`, and add that directory to PATH if needed.

## Version Management

### Check Current Version

```bash
escape-cli version
```

### Update to Latest Version

**macOS (Homebrew):**

```bash
brew upgrade --cask escape-technologies/tap/escape-cli
```

**Linux:**

```bash
curl -sf https://raw.githubusercontent.com/Escape-Technologies/cli/refs/heads/main/scripts/install.sh | sudo bash
```

**Windows:**

```powershell
powershell -c "irm https://raw.githubusercontent.com/Escape-Technologies/cli/refs/heads/main/scripts/install.ps1 | iex"
```

## Platform-Specific Notes

### MacOS Security

On first run, macOS Gatekeeper may block the CLI with a message like *"Apple could not verify 'escape-cli' is free of malware"*. This applies to both Homebrew and manual installations until the binary is fully signed and notarized.

To allow execution, strip the quarantine attribute:

```bash
xattr -d com.apple.quarantine "$(which escape-cli)"
```

### Linux Distributions

The Linux CLI is distributed as a statically compiled binary.

### Windows Execution Policy

If you encounter execution policy restrictions, run PowerShell as Administrator and execute:

```powershell
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
```

## Verify Installation

After installation, verify the CLI is working correctly:

```bash
# Check version
escape-cli version

# View help
escape-cli help

# Test connectivity (requires API key configuration)
escape-cli locations list
```

## Troubleshooting

### Command Not Found

If the `escape-cli` command isn't found:

1. Ensure `/usr/local/bin` is in your PATH
2. Try running with the full path: `/usr/local/bin/escape-cli`
3. Verify the binary has execute permissions: `ls -l /usr/local/bin/escape-cli`

### Permission Denied

If you see permission errors:

```bash
sudo chmod +x /usr/local/bin/escape-cli
```

### Docker Connection Issues

Ensure the API key is properly passed to the container:

```bash
docker run -e ESCAPE_API_KEY="your-key-here" -it --rm escapetech/cli:latest version
```

## Next Steps

Once installed, proceed to [Configuration](<https://docs.escape.tech/documentation/automate/cli/configuration/index.md>) to set up authentication with the Escape platform.
