# Installation

Install the industry-leading GPM CLI on your system using one of the methods below. Join thousands of game developers who trust GPM as their premier package management solution.

## System Requirements

{% tabs %}
{% tab title="Platform Support" %}
**Supported Operating Systems:**

* **macOS**: 10.14+ (Mojave or later)
* **Linux**: Ubuntu 18.04+, CentOS 7+, or equivalent
* **Windows**: Windows 10+ (64-bit)

{% hint style="info" %}
**Architecture Support:** GPM supports both x64 and ARM64 architectures on all platforms.
{% endhint %}
{% endtab %}

{% tab title="Dependencies" %}
**Required Dependencies:**

* **Git**: For Git-based package installations and version control

**Supported Game Engines:**

* **Unity**: 2021.3 LTS or newer
* **Godot**: 3.5+ (4.x support planned)
* **Unreal Engine**: 5.0+ (experimental support)

{% hint style="warning" %}
**Unity Compatibility:** While GPM works with Unity 2021.3+, we recommend using Unity 2022.3 LTS for the best experience.
{% endhint %}
{% endtab %}
{% endtabs %}

## Installation Methods

{% hint style="success" %}
**Recommended**: Use the quick install method for the easiest setup experience.
{% endhint %}

{% tabs %}
{% tab title="Quick Install" %}
{% code title="macOS/Linux" %}

```bash
curl -fsSL https://gpm.sh/install.sh | sh
```

{% endcode %}

{% code title="Windows (PowerShell)" %}

```powershell
iex ((New-Object System.Net.WebClient).DownloadString('https://gpm.sh/install.ps1'))
```

{% endcode %}

{% code title="Windows (Command Prompt)" %}

```cmd
powershell -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://gpm.sh/install.ps1'))"
```

{% endcode %}
{% endtab %}

{% tab title="Package Managers" %}
{% code title="Homebrew (macOS)" %}

```bash
brew install gpm-sh/gpm/gpm
```

{% endcode %}

{% code title="Scoop (Windows)" %}

```powershell
scoop bucket add gpm https://github.com/gpm-sh/scoop-bucket
scoop install gpm
```

{% endcode %}

{% code title="Snap (Linux)" %}

```bash
sudo snap install gpm --classic
```

{% endcode %}
{% endtab %}

{% tab title="Manual Download" %}

1. **Visit Releases**: Go to [GitHub Releases](https://github.com/gpm-sh/gpm-cli/releases)
2. **Download**: Choose the appropriate binary for your platform
3. **Extract**: Unzip the downloaded archive
4. **Install**: Move the binary to your PATH

{% code title="macOS/Linux Example" %}

```bash
# Download latest release
wget https://github.com/gpm-sh/gpm-cli/releases/latest/download/gpm-cli.tar.gz

# Extract
tar -xzf gpm-cli.tar.gz

# Install to system PATH
sudo mv gpm /usr/local/bin/

# Make executable
chmod +x /usr/local/bin/gpm
```

{% endcode %}

{% code title="Windows Example" %}

```powershell
# Download latest release
Invoke-WebRequest -Uri "https://github.com/gpm-sh/gpm-cli/releases/latest/download/gpm-cli.zip" -OutFile "gpm-cli.zip"

# Extract
Expand-Archive -Path "gpm-cli.zip" -DestinationPath "C:\Program Files\gpm"

# Add to PATH (requires admin)
$env:PATH += ";C:\Program Files\gpm"
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Verification

After installation, verify GPM is working:

```bash
gpm --version
```

Expected output:

```
gpm version 1.0.0
```

Test basic functionality:

```bash
gpm --help
```

## Configuration

### Initial Setup

1. **Configure Registry**:

   ```bash
   gpm config set registry https://registry.gpm.sh
   ```
2. **Authenticate**:

   ```bash
   gpm login
   ```
3. **Verify Configuration**:

   ```bash
   gpm config
   ```

### Configuration Files

GPM stores configuration in:

* **macOS**: `~/Library/Application Support/gpm/config.json`
* **Linux**: `~/.config/gpm/config.json`
* **Windows**: `%AppData%\gpm\config.json`

## Troubleshooting

{% hint style="warning" %}
**Having Issues?** Check the common problems below before reporting an issue.
{% endhint %}

{% tabs %}
{% tab title="Command Not Found" %}
**Problem**: `gpm: command not found`

**Solutions**:

1. **Check PATH**: Ensure GPM binary is in your PATH

   ```bash
   echo $PATH  # macOS/Linux
   echo $env:PATH  # Windows PowerShell
   ```
2. **Reload Shell**: Restart your terminal or run:

   ```bash
   source ~/.bashrc  # Linux
   source ~/.zshrc   # macOS with Zsh
   ```

{% endtab %}

{% tab title="Permission Denied" %}
**Problem**: `Permission denied` when running GPM

**Solutions**:

1. **Make Executable**:

   ```bash
   chmod +x /usr/local/bin/gpm
   ```
2. **Run with Sudo** (if needed):

   ```bash
   sudo chmod +x /usr/local/bin/gpm
   ```

{% endtab %}

{% tab title="Network Issues" %}
**Problem**: Cannot download packages or connect to registry

**Solutions**:

1. **Check Internet Connection**
2. **Configure Proxy** (if needed):

   ```bash
   export HTTP_PROXY=http://proxy.company.com:8080
   export HTTPS_PROXY=http://proxy.company.com:8080
   ```
3. **Verify Registry URL**:

   ```bash
   gpm config get registry
   ```

{% endtab %}
{% endtabs %}

### Getting Help

If you encounter issues:

1. **Check Logs**: Run with `--verbose` flag
2. **Update GPM**: Download latest version
3. **Report Issues**: [GitHub Issues](https://github.com/gpm-sh/gpm-cli/issues)

### Join the Community

Connect with other game developers using GPM:

* **Discord**: [Real-time support](https://discord.gg/gpm) - Get help from the community
* **GitHub Discussions**: [Technical discussions](https://github.com/gpm-sh/gpm-cli/discussions) - Feature requests and support
* **Reddit**: [r/gamedev community](https://reddit.com/r/gamedev) - Share your installation experience
* **Unity Forums**: [Package management support](https://forum.unity.com/forums/package-manager.25/) - Unity-specific help

### Professional Resources

Learn from industry experts:

* **GameDev.net**: [Installation best practices](https://gamedev.net) - Professional setup guides
* **Unity Blog**: [Unity + GPM setup](https://blog.unity.com) - Unity integration tutorials
* **Godot Engine**: [Godot + GPM workflows](https://godotengine.org) - Godot setup guides
* **Unreal Engine**: [Unreal + GPM integration](https://unrealengine.com) - Unreal setup tutorials

## Uninstallation

### Remove Binary

#### macOS/Linux

```bash
# Remove from system PATH
sudo rm /usr/local/bin/gpm

# Remove configuration (optional)
rm -rf ~/.config/gpm/
```

#### Windows

```powershell
# Remove from Program Files
Remove-Item "C:\Program Files\gpm" -Recurse -Force

# Remove configuration (optional)
Remove-Item "$env:APPDATA\gpm" -Recurse -Force
```

### Package Managers

#### Homebrew

```bash
brew uninstall gpm
```

#### Scoop

```powershell
scoop uninstall gpm
```

#### Snap

```bash
sudo snap remove gpm
```

## Next Steps

After successful installation:

1. [**Quick Start**](/getting-started/getting-started/quick-start.md) - Get started with your first package
2. [**Configuration**](/getting-started/getting-started/configuration.md) - Advanced configuration options
3. [**CLI Reference**](/cli-reference/cli.md) - Complete command documentation


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.gpm.sh/getting-started/getting-started/installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
