# Uploading Reports - More options

## Uploading git commit logs

If you do not work with GitHub or cannot provide access to the source folder where the Git logs are located, you can generate them on your own and upload them separately to the SeaLights servers.

{% hint style="info" %}
See '[Generating an Agent token](https://docs.sealights.io/knowledgebase/settings/token-access-and-management#token-list-and-token-creation-2)' for instructions on how to generate a token
{% endhint %}

### Generating the commit reports <a href="#generating-the-commit-reports" id="generating-the-commit-reports"></a>

The file must be a JSON file with an array of commits named "`commitLog`"

**Sample command on Linux**

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

```sh
echo "{ \"commitLog\": " > commitLog.json
git log --pretty=format:'{"commit": "%H","authorName": "%an","authorEmail": "%ae","commiterName": "%cn","commiterEmail": "%ce","authorDate": "%at000","commiterDate": "%ct000","title": "%f"},'  --since="2 days ago"  | sed "$ s/,$//" | sed ':a;N;$!ba;s/\r\n\([^{]\)/\\n\1/g'| awk 'BEGIN { print("[") } { print($0) } END { print("]") }' >> commitLog.json
echo "}" >> commitLog.json
```

{% endcode %}

### Upload git-generated commit log reports <a href="#upload-git-generated-commit-log-reports" id="upload-git-generated-commit-log-reports"></a>

**Sample command for a single file**

{% tabs %}
{% tab title="Unix" %}
**Sample command**

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

```sh
npx slnodejs uploadReports --tokenfile /path/to/sltoken.txt --buildsessionidfile buildSessionId --reportFile commitLog.json --type "commitLog" --source "script"
```

{% endcode %}
{% endtab %}

{% tab title="Windows" %}
**Sample command**

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

```powershell
call npx slnodejs uploadReports --tokenfile \path\to\sltoken.txt --buildsessionidfile buildSessionId --reportFile commitLog.json --type "commitLog" --source "script"
```

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

{% hint style="info" %}
See [Command Reference](/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/node.js-agent/command-reference.md#upload-report-files) for full parameter details
{% endhint %}

## Uploading multiple files

When uploading report files to the SeaLights server, you might need to upload multiple files rather than only one.

This can be done by either provide a folder where **all** the files existing in it will be uploaded or alternatively upload every single file in a command line loop.

{% hint style="info" %}
See '[Generating an Agent token](https://docs.sealights.io/knowledgebase/settings/token-access-and-management#token-list-and-token-creation-2)' for instructions on how to generate a token
{% endhint %}

### Upload multiple report files in a folder <a href="#upload-multiple-report-files-in-a-folder" id="upload-multiple-report-files-in-a-folder"></a>

{% tabs %}
{% tab title="Unix" %}
**Sample command**

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

```
npx slnodejs uploadReports --tokenfile /path/to/sltoken.txt --buildsessionidfile buildSessionId --reportFilesFolder "/path/to/reports/"
```

{% endcode %}
{% endtab %}

{% tab title="Windows" %}
**Sample command**

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

```
call npx slnodejs uploadReports --tokenfile \path\to\sltoken.txt --buildsessionidfile buildSessionId --reportFilesFolder "\path\to\reports"
```

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

{% hint style="danger" %}
All the files in the specified folder will be uploaded regardless of their extension
{% endhint %}

### Upload multiple report files using a command line loop <a href="#upload-multiple-report-files-using-a-command-line-loop" id="upload-multiple-report-files-using-a-command-line-loop"></a>

{% tabs %}
{% tab title="Unix" %}
**Sample command**

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

```sh
for f in /path/to/junit_report_*.xml
do
    npx slnodejs uploadReports --tokenfile /path/to/sltoken.txt --buildsessionidfile buildSessionId --reportFile "$f"
done
```

{% endcode %}
{% endtab %}

{% tab title="Windows" %}
**Sample command**

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

```powershell
for /r %i in (.\tests\Test*.xml) do npx slnodejs uploadReports --tokenfile .\path\to\sltoken.txt --buildsessionidfile buildSessionId --reportFile %f
```

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

{% hint style="info" %}
See [Command Reference](/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/node.js-agent/command-reference.md#upload-report-files) for full parameter details
{% endhint %}


---

# 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/node.js-agent/advanced-features/uploading-reports-more-options.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.
