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

# Uploading Reports - More options

`uploadReports` uploads report files to SeaLights. By default they are JUnit XML test results (`--type JUnitReport`). This page covers several files, and Git commit logs generated outside `slnodejs`. All flags: [Command Reference → uploadReports](https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/node.js-agent/command-reference.md#uploadreports).

{% 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 the token, and [Capturing Tests](https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/node.js-agent/capturing-tests.md) for when to upload test results.
{% endhint %}

## Uploading several files <a href="#uploading-multiple-files" id="uploading-multiple-files"></a>

Pass several files, or several folders, as **one comma-separated list**. If you repeat `--file` or `--filesFolder`, only the last value is used.

### A list of files <a href="#upload-a-list-of-files" id="upload-a-list-of-files"></a>

{% tabs %}
{% tab title="Bash" %}

```bash
npx slnodejs uploadReports --tokenFile sltoken.txt --buildSessionIdFile buildSessionId \
  --file "$(ls reports/junit_*.xml | paste -sd, -)"
```

{% endtab %}

{% tab title="PowerShell" %}

```powershell
$files = (Get-ChildItem -Path .\reports -Filter "junit_*.xml" -Recurse | ForEach-Object { $_.FullName }) -join ","
npx slnodejs uploadReports --tokenFile sltoken.txt --buildSessionIdFile buildSessionId --file $files
```

{% endtab %}
{% endtabs %}

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

```bash
npx slnodejs uploadReports --tokenFile sltoken.txt --buildSessionIdFile buildSessionId --filesFolder reports
```

{% hint style="danger" %}
Every file in the folder is uploaded, whatever its extension. Keep only report files there.
{% endhint %}

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

A loop also works. Upload into a test stage that is already open (do not pass `--testStage`, which would open and close a test stage for each file):

{% tabs %}
{% tab title="Bash" %}

```bash
for f in reports/junit_*.xml; do
  npx slnodejs uploadReports --tokenFile sltoken.txt --buildSessionIdFile buildSessionId --file "$f"
done
```

{% endtab %}

{% tab title="PowerShell" %}

```powershell
Get-ChildItem -Path .\reports -Filter "junit_*.xml" -Recurse | ForEach-Object {
  npx slnodejs uploadReports --tokenFile sltoken.txt --buildSessionIdFile buildSessionId --file $_.FullName
}
```

{% endtab %}

{% tab title="CMD" %}

```bat
for /r reports %i in (junit_*.xml) do npx slnodejs uploadReports --tokenFile sltoken.txt --buildSessionIdFile buildSessionId --file "%i"
```

In a `.bat` or `.cmd` file, write `%%i` instead of `%i`.
{% endtab %}
{% endtabs %}

## Uploading Git commit logs <a href="#uploading-git-commit-logs" id="uploading-git-commit-logs"></a>

If the scan cannot read the Git history (for example, it runs outside the Git checkout), generate the commit log yourself and upload it.

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

The file is a JSON object with an array named `commitLog`. Sample command on Linux:

```bash
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
```

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

```bash
npx slnodejs uploadReports --tokenFile sltoken.txt --buildSessionIdFile buildSessionId \
  --file commitLog.json --type commitLog --source script
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
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>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
