# Installation

Get Gonzo installed and ready to analyze your logs. Choose the installation method that works best for your environment.

### Package Managers

#### Go Install (Recommended)

If you have Go installed, this is the fastest way to get the latest version:

```bash
go install github.com/control-theory/gonzo/cmd/gonzo@latest
```

#### Homebrew (macOS/Linux)

For macOS and Linux users with Homebrew:

```bash
# Install gonzo
brew install gonzo
```

### Binary Downloads

Download pre-built binaries for your platform from the [GitHub releases page](https://github.com/control-theory/gonzo/releases).

Available for:

* Linux (x86\_64, ARM64)
* macOS (Intel, Apple Silicon)
* Windows (x86\_64)

{% tabs %}
{% tab title="Linux" %}

```bash
# Download and install (replace with latest version)
wget https://github.com/control-theory/gonzo/releases/download/v1.0.0/gonzo-linux-amd64
chmod +x gonzo-linux-amd64
sudo mv gonzo-linux-amd64 /usr/local/bin/gonzo
```

{% endtab %}

{% tab title="macOS" %}

```bash
# Download and install (replace with latest version)
curl -L -o gonzo https://github.com/control-theory/gonzo/releases/download/v1.0.0/gonzo-darwin-amd64
chmod +x gonzo
sudo mv gonzo /usr/local/bin/gonzo
```

{% endtab %}

{% tab title="Windows" %}

1. Download `gonzo-windows-amd64.exe` from the releases page
2. Rename to `gonzo.exe`
3. Add to your PATH or place in a directory that's already in PATH
   {% endtab %}
   {% endtabs %}

### Build from Source

For development or to get the absolute latest features:

#### Prerequisites

* Go 1.21 or higher
* Make (optional, for convenience commands)

#### Build Steps

```bash
# Clone the repository
git clone https://github.com/control-theory/gonzo.git
cd gonzo

# Build using Make (recommended)
make build

# Or build directly with Go
go build -o gonzo cmd/gonzo/main.go

# Install to GOPATH/bin
go install ./cmd/gonzo
```

#### Development Build Options

```bash
# Quick build
make build

# Development mode (format, vet, test, build)
make dev

# Build for all platforms
make cross-build

# Run tests
make test
```

### Shell Completion

Enable shell autocompletion for a better CLI experience:

{% tabs %}
{% tab title="Bash" %}

```bash
# Add to ~/.bashrc
source <(gonzo completion bash)

# Or install permanently
gonzo completion bash > /usr/local/share/bash-completion/completions/gonzo
```

{% endtab %}

{% tab title="Zsh" %}

```bash
# Add to ~/.zshrc
source <(gonzo completion zsh)

# Or install permanently (for oh-my-zsh)
gonzo completion zsh > ~/.oh-my-zsh/completions/_gonzo
```

{% endtab %}

{% tab title="Fish" %}

```bash
gonzo completion fish | source

# Or install permanently
gonzo completion fish > ~/.config/fish/completions/gonzo.fish
```

{% endtab %}

{% tab title="PowerShell" %}

```powershell
# Add to your PowerShell profile
gonzo completion powershell | Out-String | Invoke-Expression
```

{% endtab %}
{% endtabs %}

### Verification

Verify your installation is working:

```bash
# Check version
gonzo version

# Test with sample logs
echo '{"level":"info","msg":"test log"}' | gonzo

# View help
gonzo --help
```

### What's Next?

* Quick Start Tutorial - Learn the basics with a hands-on example
* Basic Usage - Common usage patterns
* Interface Overview - Understanding the Gonzo dashboard

### Troubleshooting Installation

#### Common Issues

**Command not found after installation**

* Make sure `$GOPATH/bin` is in your PATH for Go installs
* For manual installations, verify the binary is in your PATH

**Permission denied errors**

* Use `sudo` when moving binaries to system directories
* Or install to user directories like `~/bin`

**Go version errors**

* Gonzo requires Go 1.21 or higher
* Update Go: <https://golang.org/dl/>

Need help? Check our Troubleshooting Guide or [open an issue](https://github.com/control-theory/gonzo/issues).
