# Agent Initialization & Session ID

Before running the build scan and tests, you must initialize the agent with the token to use and create a session ID.

## Initializing the SeaLights CLI <a href="#initializing-the-sealights-cli" id="initializing-the-sealights-cli"></a>

{% code overflow="wrap" lineNumbers="true" %}

```sh
./slcli config init --lang go --token ./sltoken.txt
```

{% endcode %}

## Generating a session ID  <a href="#generating-a-session-id" id="generating-a-session-id"></a>

The Build Session uniquely identifies your application's build and associates any coverage (i.e., all test stages and tests) with that specific build. The session ID is provided for each step and command to link them together as one complete cycle.

{% code overflow="wrap" lineNumbers="true" %}

```sh
./slcli config create-bsid --app <your-app-name> --branch <your-branch-name> --build <your-build-number>
```

{% endcode %}

{% hint style="info" %}
Each time the command runs, the `app/branch/build` trio must be unique to create a new entry in your SeaLights instance. Usually, only `buildname` changes—make sure to generate a unique one each time. For that purpose, you can use a timestamp, e.g., `--build $(date +"%y%m%d_%H%M")` (Linux/macOS).
{% endhint %}
