> For the complete documentation index, see [llms.txt](https://docs.sealights.io/knowledgebase/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/java-build-tools-plugins/sealights-gradle-plugin-1/scanning-builds.md).

# 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 %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/java-build-tools-plugins/sealights-gradle-plugin-1/scanning-builds.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
