# Quick Start

Get started with SeaLights SBT Plugin in 5 simple steps.

{% stepper %}
{% step %}

#### Prerequisites

* **SeaLights account** and valid token (`sltoken.txt`)
* **Agent JARs**: `sl-build-scanner.jar` and `sl-test-listener.jar`
* **SBT** 1.x, **Scala** 2.12.x, **Java** 8+
* **Outbound network access** to SeaLights server
  {% endstep %}

{% step %}

#### Add Plugin to Your Project

Add to `project/plugins.sbt`:

```scala
addSbtPlugin("io.sealights" % "sealights-sbt-plugin" % "<latest-version>")
```

{% hint style="info" %}
**Note:** The plugin is an AutoPlugin, so it activates automatically on JVM projects.
{% endhint %}
{% endstep %}

{% step %}

#### Create Configuration

Create `sl-config.json` in your project root:

```json
{
  "tokenFile": "./sltoken.txt",
  "scannerJar": "./sl-agents/sl-build-scanner.jar",
  "listenerJar": "./sl-agents/sl-test-listener.jar",
  "appName": "<scala-app>",
  "branchName": "<master>",
  "buildName": "<build-001>",
  "logFolder": "./sl-logs/build-001",
  "packagesIncluded": "<*com.example*>",
  "testTasksAndStages": {
    "Test/test": "Unit Tests"
  },
  "logLevel": "info",
  "logEnabled": true,
  "recursive": true,
  "logToConsole": true,
  "logToFile": true,
  "createBuildSessionId": true
}
```

{% hint style="info" %}
**Tip**: See Common Concepts for explanations of Build Scanner, Test Listener, Test Stages, and Build Session IDs.
{% endhint %}
{% endstep %}

{% step %}

#### Apply Configuration

Run the Build Scanner to wire SBT settings:

```bash
java -jar tools/sl-build-scanner.jar \
  -sbt \
  -configfile sl-config.json \
  -workspacepath /path/to/project
```

**Parameters**

<table><thead><tr><th width="158.46484375">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>-sbt</code></td><td>Generate SBT-specific settings</td></tr><tr><td><code>-configfile</code></td><td>Path to the JSON config</td></tr><tr><td><code>-workspacepath</code></td><td>Root directory of your SBT project</td></tr></tbody></table>
{% endstep %}

{% step %}

#### Run Tests with SeaLights

Execute:

```bash
sbt sealightsRun
```

This task performs:

1. Build scan
2. Test instrumentation
3. Build end notification and reporting to SeaLights

> Expected outcome: instrumented tests with results visible in the SeaLights dashboard.
> {% endstep %}
> {% endstepper %}
