# Set up the agent

{% hint style="warning" %}
**Upgrading from agent v0.65 or earlier?** The configuration file format changed in v0.66. Before continuing, follow the steps in [Migrate a legacy configuration](https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/abap-agent/command-line-interface/set-up-the-agent/migrate-a-legacy-configuration) to upgrade your `config.toml`.
{% endhint %}

## Prerequisite to Agent Setup

To check connectivity to Sealights, run the following from your PowerShell window (replace the `{customerId}` with your customer id beforehand):

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

```powershell
Test-NetConnection {customerId}.sealights.io -Port 443 // confirm TCP reachability
Invoke-WebRequest https://{customerId}.sealights.io // confirm HTTPS connectivity
```

{% endcode %}

## Set up the agent

To set up the ABAP agent, run the following from your PowerShell window:

{% code title="Command" overflow="wrap" %}

```powershell
.\slabapcli.exe setup install
```

{% endcode %}

{% code title="Expected output" overflow="wrap" lineNumbers="true" %}

```powershell
PS C:\apps\SLABAPAgent\bin> .\slabapcli.exe setup install
[2025-06-17 08:15:56.388+01:00] [info] Current ANSI Code Page: 65001 (UTF-8) (65001)
[2025-06-17 08:15:56.389+01:00] [info] Config pathname: ../config/config.toml
[2025-06-17 08:15:56.389+01:00] [info] Install default config
[2025-06-17 08:15:56.392+01:00] [info] Installed default config
[2025-06-17 08:15:56.395+01:00] [info] Install symmetric key
[2025-06-17 08:15:56.395+01:00] [info] Create symmetric key
[2025-06-17 08:15:56.398+01:00] [info] Created symmetric key
[2025-06-17 08:15:56.399+01:00] [info] Create IV
[2025-06-17 08:15:56.399+01:00] [info] Created IV
[2025-06-17 08:15:56.400+01:00] [info] Installed symmetric key
[2025-06-17 08:15:56.401+01:00] [info] Install Windows Error Reporting
[2025-06-17 08:15:56.401+01:00] [info] Installed Windows Error Reporting
[2025-06-17 08:15:56.401+01:00] [info] Total time: 00:00:00.013
```

{% endcode %}

This command does the following:

* It generates a machine-locked symmetric key used to protect secrets, including RFC Destination usernames and passwords, and the SeaLights agent ID.
* It creates a default configuration file named `config.toml` in the `..\config directory`.

{% hint style="warning" %}
**Note**: You cannot use the generated key on any other computer. Be sure to back up the `config\config.toml` file.
{% endhint %}

## List the agent’s settings

To list the ABAP agent’s ABAP settings, run the following from your PowerShell window:

{% code title="Command" overflow="wrap" %}

```powershell
.\slabapcli.exe settings list
```

{% endcode %}

{% code title="Expected output" overflow="wrap" lineNumbers="true" %}

```powershell
PS C:\apps\SLABAPAgent\bin> .\slabapcli.exe settings list
[2025-06-20 10:22:48.782+01:00] [info] Current ANSI Code Page: 65001 (UTF-8) (65001)
[2025-06-20 10:22:48.782+01:00] [info] Config pathname: ../config/config.toml
[2025-06-20 10:22:48.785+01:00] [info] Install dir   : C:\apps\SLABAPAgent\bin
[2025-06-20 10:22:48.786+01:00] [info] User data dir : ..\userdata
[2025-06-20 10:22:48.786+01:00] [info] Key           : 01000000d08c9ddf0115d1118c7a00c04fc297eb01000000b4f1adcc9afb9a41849a2ac77c60e16b04...c035668c57485ce5
[2025-06-20 10:22:48.786+01:00] [info] IV            : 00283e66c6697b9ddb9047a3363e06bf
[2025-06-20 10:22:48.787+01:00] [info] Total time: 00:00:00.005
```

{% endcode %}

The command-line interface shows encrypted keys in the **settings list** output.

## Connect the agent to your SeaLights environment

The next step is to connect the agent to your SeaLights environment. You can do this as follows:

### Copy your SeaLights agent token <a href="#toc201668090" id="toc201668090"></a>

First you’ll need to copy your SeaLights agent token to the clipboard, as follows:

1. In a web browser, navigate to the URL for your SeaLights dashboard.
2. Select the **Settings** icon, and then select **Agent Tokens** from the **Settings** menu’s **Cockpit & Onboarding** section.
3. Locate the entry for your agent token, and press the **Copy token** button to copy it to the clipboard. Be sure to copy a token whose status is active.

### Connect the agent to SeaLights <a href="#toc201668091" id="toc201668091"></a>

Next, you’ll need to connect the agent to SeaLights using the command-line interface. You can do this as follows:

* Run the following command from your PowerShell window:

{% code title="Command" overflow="wrap" %}

```powershell
.\slabapcli.exe sealights set
```

{% endcode %}

{% code title="Expected output" overflow="wrap" lineNumbers="true" %}

```powershell
PS C:\apps\SLABAPAgent\bin> .\slabapcli.exe sealights set
[2025-06-17 08:51:38.306+01:00] [info] Current ANSI Code Page: 65001 (UTF-8) (65001)
[2025-06-17 08:51:38.307+01:00] [info] Config pathname: ../config/config.toml
Enter token:
```

{% endcode %}

* Use **Ctrl+V** to paste in your token, and then press **\<Enter>**. Note that you won’t see the token in the PowerShell window. The command-line interface displays this:

<pre class="language-powershell" data-overflow="wrap" data-line-numbers><code class="lang-powershell">[2025-06-17 08:57:47.710+01:00] [info] Total time: 00:06:09.404
<strong>PS C:\apps\SLABAPAgent\bin>
</strong></code></pre>

## List the SeaLights token

To list the SeaLights token in encrypted form, run the following from your PowerShell window:

{% code title="Command" overflow="wrap" %}

```powershell
.\slabapcli.exe sealights list
```

{% endcode %}

{% code title="Expected output" overflow="wrap" lineNumbers="true" %}

```powershell
PS C:\apps\SLABAPAgent\bin> .\slabapcli.exe sealights list
[2025-06-17 09:03:34.867+01:00] [info] Current ANSI Code Page: 65001 (UTF-8) (65001)
[2025-06-17 09:03:34.867+01:00] [info] Config pathname: ../config/config.toml
Hostname: dev-abap-integration-5-gw.dev.sealights.co
Clock sync hostname: dev-staging.dev.sealights.co
Token   : 67d61abc4a4dfc5a6f89be3ed36579af1f9f0c9005fa8a48b639891bd2d01fcc836de10c84dcd40364...baf266b1570db1249ef019effffcb9f4ca4d93d5dd5cea09f6b97b
Customer id: SeaLights
```

{% endcode %}

## Test the connection to SeaLights

To test the connection to SeaLights, run the following from your PowerShell window:

{% code title="Command" overflow="wrap" %}

```powershell
.\slabapcli.exe sealights test
```

{% endcode %}

{% code title="Expected output" overflow="wrap" lineNumbers="true" %}

```powershell
PS C:\apps\SLABAPAgent\bin> .\slabapcli.exe sealights test
[2025-06-17 09:11:54.006+01:00] [info] Current ANSI Code Page: 65001 (UTF-8) (65001)
[2025-06-17 09:11:54.007+01:00] [info] Config pathname: ../config/config.toml
[2025-06-17 09:11:54.013+01:00] [info] Test SeaLights: dev-abap-integration-5-gw.dev.sealights.co
<Lists your SeaLights apps, branches, and builds>
```

{% endcode %}

## Add a proxy

If connection fails your orgniziation might be using a proxy, if that's the case use the following to set it up:

{% code title="Command" overflow="wrap" %}

```powershell
.\slabapcli.exe proxy set --server http://proxy.example.com:8080 --auth
```

{% endcode %}

{% code title="Expected output" overflow="wrap" lineNumbers="true" %}

```powershell
PS C:\apps\SLABAPAgent\bin> .\slabapcli.exe proxy set --server http://proxy.example.com:8080 --auth
Enter proxy username: user1
Enter proxy password:
[2025-10-20 13:45:22.714+02:00] [info] Proxy configuration saved successfully.
```

{% endcode %}
