# Getting Started

## Prerequisites

* **SeaLights Account**: Active SeaLights account with access credentials
* **Authentication Token**: Valid SeaLights Agent token (stored as `sltoken.txt` or injected via environment variable)
* **Supported Go Version**: The SeaLights Go Agent maintains support in line with what [Golang itself supports](https://versionlog.com/golang/), which is generally "from 2 versions ago" (At the time of this writing, Go 1.22+)
* **Go Agent Binary**: Downloaded `slgoagent` binary placed in your project directory
* **Network Access**: Ability to connect to SeaLights servers (check firewall/proxy settings if needed)

## **Downloading the Go Agent**

The SeaLights Go Agent is distributed as a binary archive. Download and extract it to your project directory before proceeding.

{% hint style="info" %}
**Using an internal artifact repository?** If your organization mirrors SeaLights agents in an internal repository (such as JFrog Artifactory, Nexus, or alike), replace the download URL with your internal repository endpoint. The download path structure remains the same.
{% endhint %}

### Choosing a Download Strategy

<table><thead><tr><th width="184">Strategy</th><th>When to use</th></tr></thead><tbody><tr><td><strong>Latest</strong></td><td>Quick start, dev/sandbox environments, POC</td></tr><tr><td><strong>Specific version</strong> ⭐</td><td>Production pipelines — set via API (recommended) or hardcoded</td></tr></tbody></table>

{% hint style="warning" %}
**Architecture:** Set `SL_OS_ARCH` to match your runner or local machine:

* `linux-amd64` — Linux x86-64 (most CI runners)
* `linux-arm64` — Linux ARM64 (AWS Graviton, self-hosted ARM runners)
* `darwin-amd64` — macOS Intel
* `darwin-arm64` — macOS Apple Silicon (M1/M2/M3)
  {% endhint %}

### Direct Download Links (Latest)

For convenience, the table below contains direct links to the latest version of the SeaLights Go Agent:

<table><thead><tr><th width="87.8333740234375">OS</th><th width="129">Architecture</th><th>V2 Download Link</th><th data-hidden>@latest Download Link</th></tr></thead><tbody><tr><td>Linux</td><td><code>x86-64</code></td><td>https://agents.sealights.co/slgoagent/latest/slgoagent-linux-amd64.tar.gz </td><td>https://agents.sealights.co/slgoagent/latest/slgoagent-linux-amd64.tar.gz</td></tr><tr><td>Linux</td><td><code>ARM64</code></td><td>https://agents.sealights.co/slgoagent/latest/slgoagent-linux-arm64.tar.gz </td><td>https://agents.sealights.co/slgoagent/latest/slgoagent-linux-arm64.tar.gz</td></tr><tr><td>macOS</td><td><code>x86-64</code></td><td>https://agents.sealights.co/slgoagent/latest/slgoagent-darwin-amd64.tar.gz </td><td>https://agents.sealights.co/slgoagent/latest/slgoagent-darwin-amd64.tar.gz</td></tr><tr><td>macOS</td><td><code>ARM64</code></td><td>https://agents.sealights.co/slgoagent/latest/slgoagent-darwin-arm64.tar.gz</td><td>https://agents.sealights.co/slgoagent/latest/slgoagent-darwin-arm64.tar.gz</td></tr></tbody></table>

#### Strategy 1: Always Download the Latest Version

Suitable for development environments where you always want the newest capabilities and can tolerate potential breaking changes between runs.

{% tabs %}
{% tab title="Bash" %}
{% code overflow="wrap" %}

```bash
SL_OS_ARCH=linux-amd64   # Set to match your runner architecture
SL_DOMAIN="<your-custom-domain>.sealights.co"   # Replace with your account domain

echo "[SeaLights] Downloading Go Agent (latest)..."
wget -nv -O slgoagent.tar.gz \
  https://${SL_DOMAIN}/agents/slgoagent/latest/slgoagent-${SL_OS_ARCH}.tar.gz

tar -xzf slgoagent.tar.gz && rm -f slgoagent.tar.gz
echo "[SeaLights] Installed: $(./slgoagent -v 2>/dev/null | grep version)"
```

{% endcode %}
{% endtab %}

{% tab title="GitHub Actions" %}
{% code overflow="wrap" %}

```yaml
- name: Download SeaLights Go Agent (latest)
  shell: bash
  env:
    SL_OS_ARCH: linux-amd64   # Set to match your runner architecture
    SL_DOMAIN: "<your-custom-domain>.sealights.co"   # Replace with your account domain
  run: |
    echo "[SeaLights] Downloading Go Agent (latest)..."
    wget -nv -O slgoagent.tar.gz \
      https://${SL_DOMAIN}/agents/slgoagent/latest/slgoagent-${SL_OS_ARCH}.tar.gz
    tar -xzf slgoagent.tar.gz && rm -f slgoagent.tar.gz
    echo "[SeaLights] Installed: $(./slgoagent -v 2>/dev/null | grep version)"
```

{% endcode %}
{% endtab %}

{% tab title="macOS (zsh)" %}
{% code overflow="wrap" %}

```zsh
SL_OS_ARCH=darwin-arm64   # darwin-arm64 for Apple Silicon, darwin-amd64 for Intel
SL_DOMAIN="<your-custom-domain>.sealights.co"   # Replace with your account domain

echo "[SeaLights] Downloading Go Agent (latest)..."
curl -sSL -o slgoagent.tar.gz \
  https://${SL_DOMAIN}/agents/slgoagent/latest/slgoagent-${SL_OS_ARCH}.tar.gz

tar -xzf slgoagent.tar.gz && rm -f slgoagent.tar.gz
echo "[SeaLights] Installed: $(./slgoagent -v 2>/dev/null | grep version)"
```

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

#### Strategy 2: Specific Version (Recommended)

{% hint style="info" %}
**Tip:** For production pipelines, leave `SL_AGENT_VERSION` empty in the snippet below to automatically resolve (via API call) the version your administrator has approved in the Dashboard settings dedicated page.

* When the approved version changes, every pipeline picks it up automatically on the next run — no edits required.
* When troubleshooting, set it to `latest` or pin it to a specific version (e.g. `v2.0.225`).
  {% endhint %}

**API Endpoint:**&#x20;

{% code overflow="wrap" %}

```
GET https://{DOMAIN}/api/v2/agents/slgoagent/recommended/version
```

{% endcode %}

* Authentication: `Authorization: Bearer <your-agent-token>`
* Response: JSON object with a `version` field, e.g. `{"version": "v2.0.225"}`

{% tabs %}
{% tab title="Bash" %}
{% code overflow="wrap" %}

```bash
SL_OS_ARCH=linux-amd64   # linux-amd64 | linux-arm64 | darwin-amd64 | darwin-arm64
SL_DOMAIN="<your-custom-domain>.sealights.co"   # Replace with your account domain
SL_TOKEN=$(cat ./sltoken.txt)                    # Or inject via secret/env var
SL_AGENT_VERSION=""   # Set to "latest", "vX.Y.Z" to pin, or leave empty to use API

if [ -z "${SL_AGENT_VERSION}" ]; then
  echo "[SeaLights] Resolving recommended version from dashboard..."
  SL_AGENT_VERSION=$(curl -sSf \
    -H "Authorization: Bearer ${SL_TOKEN}" \
    "https://${SL_DOMAIN}/api/v2/agents/slgoagent/recommended/version" \
    | grep -o '"version":"[^"]*"' | cut -d'"' -f4)
fi

echo "[SeaLights] Resolved version: ${SL_AGENT_VERSION}"
wget -nv -O slgoagent.tar.gz \
  https://${SL_DOMAIN}/agents/slgoagent/${SL_AGENT_VERSION}/slgoagent-${SL_OS_ARCH}.tar.gz

tar -xzf slgoagent.tar.gz && rm -f slgoagent.tar.gz
echo "[SeaLights] Installed: $(./slgoagent -v 2>/dev/null | grep version)"
```

{% endcode %}
{% endtab %}

{% tab title="GitHub Actions" %}
{% code overflow="wrap" %}

```yaml
- name: Download SeaLights Go Agent (specific version)
  shell: bash
  env:
    SL_OS_ARCH: linux-amd64   # linux-amd64 | linux-arm64 | darwin-amd64 | darwin-arm64
    SL_DOMAIN: "<your-custom-domain>.sealights.co"   # Replace with your account domain
    SL_TOKEN: ${{ secrets.SL_TOKEN }}
    SL_AGENT_VERSION: ""   # Set to "latest", "vX.Y.Z" to pin, or leave empty to use API
  run: |
    if [ -z "${SL_AGENT_VERSION}" ]; then
      echo "[SeaLights] Resolving recommended version from dashboard..."
      SL_AGENT_VERSION=$(curl -sSf \
        -H "Authorization: Bearer ${SL_TOKEN}" \
        "https://${SL_DOMAIN}/api/v2/agents/slgoagent/recommended/version" \
        | grep -o '"version":"[^"]*"' | cut -d'"' -f4)
    fi

    echo "[SeaLights] Resolved version: ${SL_AGENT_VERSION}"
    wget -nv -O slgoagent.tar.gz \
      https://${SL_DOMAIN}/agents/slgoagent/${SL_AGENT_VERSION}/slgoagent-${SL_OS_ARCH}.tar.gz
    tar -xzf slgoagent.tar.gz && rm -f slgoagent.tar.gz
    echo "[SeaLights] Installed: $(./slgoagent -v 2>/dev/null | grep version)"
```

{% endcode %}
{% endtab %}

{% tab title="macOS (zsh)" %}
{% code overflow="wrap" %}

```zsh
SL_OS_ARCH=darwin-arm64   # darwin-arm64 for Apple Silicon, darwin-amd64 for Intel
SL_DOMAIN="<your-custom-domain>.sealights.co"   # Replace with your account domain
SL_TOKEN=$(cat ./sltoken.txt)                    # Or inject via secret/env var
SL_AGENT_VERSION=""   # Set to "latest", "vX.Y.Z" to pin, or leave empty to use API

if [ -z "${SL_AGENT_VERSION}" ]; then
  echo "[SeaLights] Resolving recommended version from dashboard..."
  SL_AGENT_VERSION=$(curl -sSf \
    -H "Authorization: Bearer ${SL_TOKEN}" \
    "https://${SL_DOMAIN}/api/v2/agents/slgoagent/recommended/version" \
    | grep -o '"version":"[^"]*"' | cut -d'"' -f4)
fi

echo "[SeaLights] Resolved version: ${SL_AGENT_VERSION}"
curl -sSL -o slgoagent.tar.gz \
  https://${SL_DOMAIN}/agents/slgoagent/${SL_AGENT_VERSION}/slgoagent-${SL_OS_ARCH}.tar.gz

tar -xzf slgoagent.tar.gz && rm -f slgoagent.tar.gz
echo "[SeaLights] Installed: $(./slgoagent -v 2>/dev/null | grep version)"
```

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


---

# 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.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/go-agent/go-agent-v2/getting-started.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.
