# Command Reference

{% hint style="warning" %}
**Legacy Alias Deprecation Notice**

Starting with **NodeJS Agent 6.2.1**, SeaLights supports standardised CLI parameter naming across technologies.

Legacy parameter aliases remain supported for backward compatibility, but they are planned for future deprecation. Customers are strongly encouraged to migrate to the standardised CLI parameters as part of their regular maintenance and upgrade process. More information can be found in **Configuration Standards**.
{% endhint %}

## NodeJS Agent — Command Reference <a href="#configure-a-session-and-create-session-id" id="configure-a-session-and-create-session-id"></a>

### Generating a Session ID (`config`) <a href="#standard-session-id" id="standard-session-id"></a>

This example is with minimum required CLI Parameters. All available CLI Parameters can be found in the table below.

```bash
##Minimum required CLI parameters
npx slnodejs config \
  --token <token> \
  --appName <app-name> \
  --branchName <branch> \
  --buildName <build>
```

#### All CLI Parameters

<table><thead><tr><th width="214.14453125" valign="top">CLI Parameter</th><th width="214.9453125" valign="top">Legacy Alias</th><th valign="top">Description</th></tr></thead><tbody><tr><td valign="top"><code>--token</code></td><td valign="top"><code>--token</code></td><td valign="top">Access token generated from the Sealights server.</td></tr><tr><td valign="top"><code>--tokenFile</code></td><td valign="top"><code>--tokenfile</code></td><td valign="top">Path to file containing access token generated from the SeaLights server.</td></tr><tr><td valign="top"><code>--appName</code></td><td valign="top"><code>--appname</code></td><td valign="top">Name of the application.</td></tr><tr><td valign="top"><code>--branchName</code></td><td valign="top"><code>--branch</code></td><td valign="top">The source branch of the application.</td></tr><tr><td valign="top"><code>--buildName</code></td><td valign="top"><code>--build</code></td><td valign="top">The build label of the current build.</td></tr><tr><td valign="top"><code>--buildSessionId</code></td><td valign="top"><code>--buildsessionid</code></td><td valign="top">(Optional) A user provided session ID (case-sensitive).</td></tr><tr><td valign="top"><code>--failOnError</code></td><td valign="top"><code>--failbuild</code></td><td valign="top">Flag indicating whether the command should exit with status code <code>1</code> if the command fails (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--skipUpgrade</code></td><td valign="top"><code>--skipupgrade</code></td><td valign="top">Prevents the agent from attempting automatic upgrades (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--beControlledVersions</code></td><td valign="top"><code>--becontrolledversions</code></td><td valign="top">Updates the agent to the version defined by the backend configuration (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--overrideServer</code></td><td valign="top"><code>--overrideserver</code></td><td valign="top">Overrides the server URL used by the agent for connectivity. Example use case: using the Collector as a proxy.</td></tr><tr><td valign="top"><code>--proxy</code></td><td valign="top"><code>--proxy</code></td><td valign="top">Address of proxy to run connection through.</td></tr><tr><td valign="top"><code>--help</code></td><td valign="top"><code>--help</code></td><td valign="top">Show Help message and exit.</td></tr></tbody></table>

### Scanning a Build (`scan`) <a href="#pull-request-session-id" id="pull-request-session-id"></a>

This example is with minimum required CLI Parameters. All available CLI Parameters can be found in the table below.

```bash
##Minimum required CLI parameters
npx slnodejs scan \
  --token <token> \
  --buildSessionId <id> \
  --scanDir <path> \
  --outputPath <path> \
  --labId <labid>
```

#### All CLI Parameters

<table><thead><tr><th width="235.0546875" valign="top">CLI Parameter</th><th width="234.54296875" valign="top">Legacy Alias</th><th valign="top">Description</th></tr></thead><tbody><tr><td valign="top"><code>--token</code></td><td valign="top"><code>--token</code></td><td valign="top">Access token generated from the SeaLights server.</td></tr><tr><td valign="top"><code>--tokenFile</code></td><td valign="top"><code>--tokenfile</code></td><td valign="top">Path to file containing access token generated from the SeaLights server.</td></tr><tr><td valign="top"><code>--buildSessionId</code></td><td valign="top"><code>--buildsessionid</code></td><td valign="top">Session ID of configuration created.</td></tr><tr><td valign="top"><code>--buildSessionIdFile</code></td><td valign="top"><code>--buildsessionidfile</code></td><td valign="top">Path to file containing the Session ID of configuration created.</td></tr><tr><td valign="top"><code>--appName</code></td><td valign="top"><code>--appname</code></td><td valign="top">Name of the application.</td></tr><tr><td valign="top"><code>--branchName</code></td><td valign="top"><code>--branch</code></td><td valign="top">The source branch of the application.</td></tr><tr><td valign="top"><code>--buildName</code></td><td valign="top"><code>--build</code></td><td valign="top">The build label of the current build.</td></tr><tr><td valign="top"><code>--scanDir</code></td><td valign="top"><code>--workspacePath</code>, <code>--distFolderPath</code>, <code>--distPath</code>, <code>--distributablePath</code>, <code>-w</code></td><td valign="top">Path to the source workspace where the source code exists.</td></tr><tr><td valign="top"><code>--outputPath</code></td><td valign="top"><code>-outputpath</code></td><td valign="top">Folder to generate the instrumented JS files in when using the <code>instrumentForBrowsers</code> parameter.</td></tr><tr><td valign="top"><code>--excludeFiles</code></td><td valign="top"><code>--excludedpaths</code></td><td valign="top"><p>Comma-separated list of files to exclude from scan.</p><p>Supports wildcards (<code>*</code> is any string, <code>?</code> is any character). For example: <code>'*-with-dependencies.jar, bad-bad?.war, *-source.jar'</code></p></td></tr><tr><td valign="top"><code>--labId</code></td><td valign="top"><code>--labid</code></td><td valign="top">Unique ID for a set of test labs in case multiple labs are running simultaneously or for an Integration Build.<br>This needs to be done during the instrumentation process when using the <code>instrumentForBrowsers</code> option.</td></tr><tr><td valign="top"><code>--useModulePrefix</code></td><td valign="top"></td><td valign="top">Add uniqueModuleId as prefix (if exists) to uniqueId and files path (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--jobName</code></td><td valign="top"><code>--jobName</code></td><td valign="top">Name of Jenkins job.</td></tr><tr><td valign="top"><code>--logsUrl</code></td><td valign="top"></td><td valign="top">Path to Jenkins log folder.</td></tr><tr><td valign="top"><code>--projectRoot</code></td><td valign="top"><code>--projectRoot</code></td><td valign="top">Path to the root of the project. Usually where the src folder resides.</td></tr><tr><td valign="top"><code>--recursive</code></td><td valign="top"></td><td valign="top">Enables recursive scan behavior (Default: <code>true</code>).</td></tr><tr><td valign="top"><code>--scanDotFolders</code></td><td valign="top"></td><td valign="top">Includes folders starting with <code>.</code> during scan and dryRun commands.</td></tr><tr><td valign="top"><code>--partialBuildMapping</code></td><td valign="top"></td><td valign="top">Splits build mapping into chunks with the specified number of files.</td></tr><tr><td valign="top"><code>--useRelativeSlMapping</code></td><td valign="top"></td><td valign="top">Uses paths relative to the workspace path (<code>--scanDir</code>) in <code>sl-mapping</code>.</td></tr><tr><td valign="top"><code>--compressSlMapping</code></td><td valign="top"></td><td valign="top">Compresses <code>sl-mapping</code> file before upload.</td></tr><tr><td valign="top"><code>--moduleName</code></td><td valign="top"><code>--uniqueModuleId</code></td><td valign="top">Unique module identifier. Value should remain consistent between runs.</td></tr><tr><td valign="top"><code>--autoResolveProjectRoot</code></td><td valign="top"></td><td valign="top">Automatically resolves project root during runtime. When set to <code>true</code> additional data will be appended to the end of the scanned code, which will be used to resolve the project root when running with a test listener (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--instrumentForBrowsers</code></td><td valign="top"><code>--instrumentForBrowsers</code></td><td valign="top">Instrument the javascript files for providing browser front-end coverage information. Must be used with the <code>--outputPath</code> parameter.</td></tr><tr><td valign="top"><code>--instrumentationOnly</code></td><td valign="top"><code>--instrumentationOnly</code></td><td valign="top">Only instrument the javascript files, without sending the build information to the SeaLights server (i.e. skip the build scan).<br>This parameter must be used in addition to the <code>--instrumentForBrowsers</code> parameter.</td></tr><tr><td valign="top"><code>--toggleBasedBrowserInstrumentation</code></td><td valign="top"></td><td valign="top">Once enabled the browser agent will create separate instrumented files and keep the original files intact.<br>If the preamble file is not found, the original files will be loaded in the browser (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--ctxPropagationOnly</code></td><td valign="top"></td><td valign="top">Enable only context propagation without performing any additional browser agent instrumentation (Default:<br><code>false</code>).</td></tr><tr><td valign="top"><code>--enableOpenTelemetry</code></td><td valign="top"><code>--enableOpenTelemetry</code></td><td valign="top">Enable open-telemetry instrumentation when working with the browser test listener (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--allowCORS</code></td><td valign="top"></td><td valign="top">Comma-separated origins allowed for header propagation (<code>*</code> to enable propagation everywhere). Defaults to current origin only.  <code>--enableOpenTelemetry</code> must be <code>true</code> for this option.</td></tr><tr><td valign="top"><code>--allowedDomains</code></td><td valign="top"></td><td valign="top">Comma-separated list of domains where the browser agent should load. If empty string is passed, this<br>option is disabled and agent is loaded for all domains (can be used to overwrite env var or remote config).<br>In scan and dryRun commands --instrumentForBrowsers<br>must be used for this to take effect.</td></tr><tr><td valign="top"><code>--delayShutdownInSeconds</code></td><td valign="top"></td><td valign="top">Shutdown time in seconds for the browser agent (Default: <code>30</code>).</td></tr><tr><td valign="top"><code>--excludeTokenFromBrowserConfig</code></td><td valign="top"></td><td valign="top">Exclude the browser agent token from the browser configuration file (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--rawCoverage</code></td><td valign="top"></td><td valign="top">Generates metadata required for processing coverage from v8 lightweight agent (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--es6Modules</code></td><td valign="top"><code>--es6Modules</code></td><td valign="top">Enables ES6 module handling during scan or run (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--es6Classes</code></td><td valign="top"></td><td valign="top">Enables ES6 class adjustments during scan. Use it when you scan <code>ts</code> classes that later transpiled to <code>es6</code> classes.</td></tr><tr><td valign="top"><code>--enrichPrivateMethods</code></td><td valign="top"></td><td valign="top">Enriches methods with accessibility modifiers.</td></tr><tr><td valign="top"><code>--hashIncludeNestedMethods</code></td><td valign="top"></td><td valign="top">Includes nested anonymous methods in hash calculation. First activation of this CLI parameter can cause false-positive code changes.</td></tr><tr><td valign="top"><code>--excludeNestedMethods</code></td><td valign="top"></td><td valign="top">Excludes nested methods from build mapping. First activation of this CLI parameter can cause false-positive code changes.</td></tr><tr><td valign="top"><code>--enableLineCoverage</code></td><td valign="top"></td><td valign="top">Enables line-level coverage mapping (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--useBranchCoverage</code></td><td valign="top"></td><td valign="top">Enables branch coverage collection (Default: <code>false</code>). </td></tr><tr><td valign="top"><code>--sourceHash</code></td><td valign="top"></td><td valign="top">Generates method hash from source files instead of generated code.</td></tr><tr><td valign="top"><code>--embedCorrectUniqueId</code></td><td valign="top"></td><td valign="top">Embeds unique ID mapping into instrumented files (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--resolveWithoutHash</code></td><td valign="top"></td><td valign="top">Resolves mappings without using hashes (Default: <code>true</code>).</td></tr><tr><td valign="top"><code>--newInstrumenter</code></td><td valign="top"></td><td valign="top">Uses <code>sl-istanbul-lib-instrument</code> instead of <code>istanbul-lib-instrument</code> (Default: <code>true</code>).</td></tr><tr><td valign="top"><code>--useBabylon</code></td><td valign="top"></td><td valign="top">Uses Babylon parser for scanning files (Default: <code>true</code>). </td></tr><tr><td valign="top"><code>--babylonPlugins</code></td><td valign="top"></td><td valign="top"><p>Values:</p><ul><li><code>decorators-legacy</code> - when there are decorators in the code.</li><li><code>jsx</code> - for React applications.</li></ul></td></tr><tr><td valign="top"><code>--footprintsMapping</code></td><td valign="top"></td><td valign="top">Determines where browser footprints are resolved (<code>agent</code> or <code>server</code>). Default: <code>agent</code>.</td></tr><tr><td valign="top"><code>--enrichByLinesMatch</code></td><td valign="top"><code>-l</code></td><td valign="top">Enables experimental method matching algorithm.</td></tr><tr><td valign="top"><code>--enrichByMethodRange</code></td><td valign="top"></td><td valign="top">Matches methods using original method range positions. Implicitly sets<br>recognizeBabelCreateClass on (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--experimentalDeduplicateEnrichedMethodsWithOriginals</code></td><td valign="top"></td><td valign="top">Removes duplicated methods from the build map (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--recognizeBabelCreateClass</code></td><td valign="top"></td><td valign="top">Improves recognition of Babel <code>_createClass</code> calls, even with code minification (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--preferSourceMapFromFile</code></td><td valign="top"></td><td valign="top">Gives precedence to file-based source maps over inline source maps (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--excludeSourceMapFiles</code></td><td valign="top"><code>--excludeSourceMapFiles</code></td><td valign="top"><p>(Optional) During files instrumentation step, this option explicits what to do with <code>*.js.map</code> files in the <code>--scanDir</code> and <code>--outputPath</code> folders:</p><ul><li><code>none</code> - Do nothing and copy <code>*.js.map</code> files as is to the <code>--outputPath</code> folder.</li><li><code>skipCopy</code> - Do not copy the <code>*.js.map</code> files from <code>--scanDir</code> into <code>--outputPath</code> folder.</li><li><code>skipAndDelete</code> - Skip copy of <code>*.js.map</code> files and delete them from the <code>--scanDir</code>.</li></ul></td></tr><tr><td valign="top"><code>--skipInstrumentingFilesWithoutSourceMap</code></td><td valign="top"></td><td valign="top">Skip instrumenting files without source map (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--splitPreambleIntoFile</code></td><td valign="top"><code>--splitPreambleIntoFile</code></td><td valign="top"><p>Moves instrumentation config into a separate file. </p><ul><li><strong>Important</strong>: customer is responsible to make this file non-cacheable and accessible from the browser.</li></ul><p>Usage is <code>--splitPreambleIntoFile</code> to use (not <code>--splitPreambleIntoFile true</code>).</p></td></tr><tr><td valign="top"><code>--preambleFileName</code></td><td valign="top"><code>--preambleFileName</code></td><td valign="top">Used together with <code>--splitPreambleIntoFile</code> to define a custom preamble file name.</td></tr><tr><td valign="top"><code>--preambleFileUrl</code></td><td valign="top"><code>--preambleFileUrl</code></td><td valign="top"><p>Used together with <code>--preambleFileName</code> to define a custom URL (Default: <code>""</code> which equals to root, you can pass like <code>https://example.com/a/b/c</code> or relative like <code>a/b/c</code>).</p><ul><li><strong>Important</strong>: Only use this if you need a different server than the one used for the instrumented files.</li><li><strong>Important</strong>: actual URL will be <code>{preambleFileUrl}/{preambleFileName}</code>.</li></ul></td></tr><tr><td valign="top"><code>--awsConfigure</code></td><td valign="top"></td><td valign="top">Creates <code>sl-config</code> files for AWS Lambda layer integration.</td></tr><tr><td valign="top"><code>--awsConfigKeysToIgnore</code></td><td valign="top"></td><td valign="top">Comma-separated list of AWS config keys to ignore. Supported values are: <code>token</code>, <code>buildSessionId</code>, <code>collectorUrl</code>, <code>projectRoot</code>, <code>labId</code>, <code>commonSrcPrefix</code>, <code>slMapping</code>, <code>proxy</code>, <code>rawCoverage</code>.</td></tr><tr><td valign="top"><code>--scmType</code></td><td valign="top"><code>--scm</code></td><td valign="top"><p>Source control used</p><p>Current options are: <code>git</code>, <code>none</code>.</p></td></tr><tr><td valign="top"><code>--scmProvider</code></td><td valign="top"><code>--scmprovider</code></td><td valign="top">The provider name of your Source Control Management (SCM) tool.<br>Values: <code>Github</code>, <code>Bitbucket</code> and <code>Gitlab</code> (Default is Github).</td></tr><tr><td valign="top"><code>--repositoryUrl</code></td><td valign="top"><code>--scmbaseurl</code></td><td valign="top"><p>The URL to the repository which contains the code.</p><p>If not provided, the url of the remote GIT origin will be used.</p><p>Example: <code>https://my.bitbucket.com/projects/ABCD/repos/XYZ/browse/A1</code></p></td></tr><tr><td valign="top"><code>--scmVersion</code></td><td valign="top"><code>--scmversion</code></td><td valign="top">The version of your Source Control Management (SCM) tool. If left blank, cloud version is assumed. Otherwise, specify the version of your on-premise server.</td></tr><tr><td valign="top"><code>--commit</code></td><td valign="top"><code>--commit</code></td><td valign="top">Commit ID, as provided by the SCM.</td></tr><tr><td valign="top"><code>--dependency</code></td><td valign="top"><code>--dependency</code></td><td valign="top">Project dependencies. Format: semicolon:separated list of <code>AppName@BranchName@BuildName</code>.</td></tr><tr><td valign="top"><code>--dependenciesFile</code></td><td valign="top"><code>-d</code></td><td valign="top">Path to JSON file containing dependency definitions. Format: <code>[{"appName":"","branchName":"","buildName":"","buildSessionId":""}</code>.</td></tr><tr><td valign="top"><code>--sendContributors</code></td><td valign="top"><code>--sendContributors</code></td><td valign="top">Sends contributor details for advanced committer reports and features.</td></tr><tr><td valign="top"><code>--failOnError</code></td><td valign="top"><code>--failbuild</code></td><td valign="top">Flag indicating whether the command should exit with status code <code>1</code> if the command fails (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--collectorUrl</code></td><td valign="top"><code>--collectorurl</code></td><td valign="top">The URL to Sealights collector used to collect footprints from browser environment (Format: <code>https://&#x3C;collectorIP>:&#x3C;collectorPort>/api</code>).</td></tr><tr><td valign="top"><code>--overrideServer</code></td><td valign="top"><code>--overrideserver</code></td><td valign="top">Overrides the server URL used by the agent for connectivity. Example use case: using the Collector as a proxy.</td></tr><tr><td valign="top"><code>--skipUpgrade</code></td><td valign="top"><code>--skipupgrade</code></td><td valign="top">Prevents the agent from attempting automatic upgrades (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--proxy</code></td><td valign="top"><code>--proxy</code></td><td valign="top">Address of proxy to run connection through.</td></tr><tr><td valign="top"><code>--help</code></td><td valign="top"><code>--help</code></td><td valign="top">Show Help message and exit.</td></tr><tr><td valign="top"><code>--quiet</code></td><td valign="top"><code>--quiet</code></td><td valign="top">Suppresses console feedback messages only. Does not suppress log output when logging is configured to print to the console (Default: <code>false</code>).</td></tr></tbody></table>

### Ending a Multi-Module Build (`buildend`) <a href="#pull-request-session-id" id="pull-request-session-id"></a>

This example is with minimum required CLI Parameters. All available CLI Parameters can be found in the table below.

```bash
##Minimum required CLI parameters
npx slnodejs buildend \
  --token <token> \
  --buildSessionId <id>
```

#### All CLI Parameters

<table><thead><tr><th width="214.14453125" valign="top">CLI Parameter</th><th width="214.9453125" valign="top">Legacy Alias</th><th valign="top">Description</th></tr></thead><tbody><tr><td valign="top"><code>--token</code></td><td valign="top"><code>--token</code></td><td valign="top">Access token generated from the Sealights server.</td></tr><tr><td valign="top"><code>--tokenFile</code></td><td valign="top"><code>--tokenfile</code></td><td valign="top">Path to file containing access token generated from the SeaLights server.</td></tr><tr><td valign="top"><code>--buildSessionId</code></td><td valign="top"><code>--buildsessionid</code></td><td valign="top">(Optional) A user provided session ID (case-sensitive).</td></tr><tr><td valign="top"><code>--buildSessionIdFile</code></td><td valign="top"><code>--buildsessionidfile</code></td><td valign="top">Path to file containing the Session ID of configuration created.</td></tr><tr><td valign="top"><code>--failOnError</code></td><td valign="top"><code>--failbuild</code></td><td valign="top">Flag indicating whether the command should exit with status code <code>1</code> if the command fails (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--skipUpgrade</code></td><td valign="top"><code>--skipupgrade</code></td><td valign="top">Prevents the agent from attempting automatic upgrades (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--overrideServer</code></td><td valign="top"><code>--overrideserver</code></td><td valign="top">Overrides the server URL used by the agent for connectivity. Example use case: using the Collector as a proxy.</td></tr><tr><td valign="top"><code>--ok</code></td><td valign="top"><code>--ok</code></td><td valign="top">Indicates a successful build.</td></tr><tr><td valign="top"><code>--failed</code></td><td valign="top"><code>--failed</code></td><td valign="top">Indicates a failed build.</td></tr><tr><td valign="top"><code>--proxy</code></td><td valign="top"><code>--proxy</code></td><td valign="top">Address of proxy to run connection through.</td></tr><tr><td valign="top"><code>--help</code></td><td valign="top"><code>--help</code></td><td valign="top">Show Help message and exit.</td></tr></tbody></table>

### Instrumenting a Front-End Build (`instrument`) <a href="#pull-request-session-id" id="pull-request-session-id"></a>

This example is with minimum required CLI Parameters. All available CLI Parameters can be found in the table below.

```bash
##Minimum required CLI parameters
npx slnodejs instrument \
  --token <token> \
  --buildSessionId <id> \
  --scanDir <path> \
  --outputPath <path> \
  --labId <labid>
```

#### All CLI Parameters

<table><thead><tr><th width="214.14453125" valign="top">CLI Parameter</th><th width="214.9453125" valign="top">Legacy Alias</th><th valign="top">Description</th></tr></thead><tbody><tr><td valign="top"><code>--token</code></td><td valign="top"><code>--token</code></td><td valign="top">Access token generated from the Sealights server.</td></tr><tr><td valign="top"><code>--tokenFile</code></td><td valign="top"><code>--tokenfile</code></td><td valign="top">Path to file containing access token generated from the SeaLights server.</td></tr><tr><td valign="top"><code>--buildSessionId</code></td><td valign="top"><code>--buildsessionid</code></td><td valign="top">(Optional) A user provided session ID (case-sensitive).</td></tr><tr><td valign="top"><code>--buildSessionIdFile</code></td><td valign="top"><code>--buildsessionidfile</code></td><td valign="top">Path to file containing the Session ID of configuration created.</td></tr><tr><td valign="top"><code>--labId</code></td><td valign="top"><code>--labid</code></td><td valign="top">Unique ID for a set of test labs in case multiple labs are running simultaneously or for an Integration Build.<br>This needs to be done during the instrumentation process when using the <code>instrumentForBrowsers</code> option.</td></tr><tr><td valign="top"><code>--failOnError</code></td><td valign="top"><code>--failbuild</code></td><td valign="top">Flag indicating whether the command should exit with status code <code>1</code> if the command fails (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--skipUpgrade</code></td><td valign="top"><code>--skipupgrade</code></td><td valign="top">Prevents the agent from attempting automatic upgrades (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--overrideServer</code></td><td valign="top"><code>--overrideserver</code></td><td valign="top">Overrides the server URL used by the agent for connectivity. Example use case: using the Collector as a proxy.</td></tr><tr><td valign="top"><code>--scanDir</code></td><td valign="top"><code>--workspacePath</code>, <code>--distFolderPath</code>, <code>--distPath</code>, <code>--distributablePath</code>, <code>-w</code></td><td valign="top">Path to the source workspace where the source code exists.</td></tr><tr><td valign="top"><code>--outputPath</code></td><td valign="top"><code>--outputpath</code></td><td valign="top">Folder to generate the instrumented JS files in when using the <code>instrumentForBrowsers</code> parameter.</td></tr><tr><td valign="top"><code>--projectRoot</code></td><td valign="top"><code>--projectRoot</code></td><td valign="top">Path to the root of the project. Usually where the src folder resides.</td></tr><tr><td valign="top"><code>--toggleBasedBrowserInstrumentation</code></td><td valign="top"></td><td valign="top">Once enabled the browser agent will create separate instrumented files and keep the original files intact.<br>If the preamble file is not found, the original files will be loaded in the browser (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--ctxPropagationOnly</code></td><td valign="top"></td><td valign="top">Enable only context propagation without performing any additional browser agent instrumentation (Default:<br><code>false</code>).</td></tr><tr><td valign="top"><code>--collectorUrl</code></td><td valign="top"><code>--collectorurl</code></td><td valign="top">The URL to Sealights collector used to collect footprints from browser environment (Format: <code>https://&#x3C;collectorIP>:&#x3C;collectorPort>/api</code>).</td></tr><tr><td valign="top"><code>--enableOpenTelemetry</code></td><td valign="top"><code>--enableOpenTelemetry</code></td><td valign="top">Enable open-telemetry instrumentation when working with the browser test listener (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--allowCORS</code></td><td valign="top"></td><td valign="top">Comma-separated origins allowed for header propagation (<code>*</code> to enable propagation everywhere). Defaults to current origin only.  <code>--enableOpenTelemetry</code> must be <code>true</code> for this option.</td></tr><tr><td valign="top"><code>--allowedDomains</code></td><td valign="top"></td><td valign="top">Comma-separated list of domains where the browser agent should load. If empty string is passed, this<br>option is disabled and agent is loaded for all domains (can be used to overwrite env var or remote config).<br>In scan and dryRun commands --instrumentForBrowsers<br>must be used for this to take effect.</td></tr><tr><td valign="top"><code>--excludeTokenFromBrowserConfig</code></td><td valign="top"></td><td valign="top">Exclude the browser agent token from the browser configuration file (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--delayShutdownInSeconds</code></td><td valign="top"></td><td valign="top">Shutdown time in seconds for the browser agent (Default: 30 seconds).</td></tr><tr><td valign="top"><code>--es6Modules</code></td><td valign="top"><code>--es6Modules</code></td><td valign="top">Enables ES6 module handling during scan or run (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--babylonPlugins</code></td><td valign="top"></td><td valign="top"><p>Values:</p><ul><li><code>decorators-legacy</code> - when there are decorators in the code.</li><li><code>jsx</code> - for React applications.</li></ul></td></tr><tr><td valign="top"><code>--footprintsMapping</code></td><td valign="top"></td><td valign="top">Determines where browser footprints are resolved (<code>agent</code> or <code>server</code>). Default: <code>agent</code>.</td></tr><tr><td valign="top"><code>--splitPreambleIntoFile</code></td><td valign="top"><code>--splitPreambleIntoFile</code></td><td valign="top"><p>Moves instrumentation config into a separate file. </p><ul><li><strong>Important</strong>: customer is responsible to make this file non-cacheable and accessible from the browser.</li></ul><p>Usage is <code>--splitPreambleIntoFile</code> to use (not <code>--splitPreambleIntoFile true</code>).</p></td></tr><tr><td valign="top"><code>--preambleFileName</code></td><td valign="top"><code>--preambleFileName</code></td><td valign="top">Used together with <code>--splitPreambleIntoFile</code> to define a custom preamble file name.</td></tr><tr><td valign="top"><code>--preambleFileUrl</code></td><td valign="top"><code>--preambleFileUrl</code></td><td valign="top"><p>Used together with <code>--preambleFileName</code> to define a custom URL (Default: <code>""</code> which equals to root, you can pass like <code>https://example.com/a/b/c</code> or relative like <code>a/b/c</code>).</p><ul><li><strong>Important</strong>: Only use this if you need a different server than the one used for the instrumented files.</li><li><strong>Important</strong>: actual URL will be <code>{preambleFileUrl}/{preambleFileName}</code>.</li></ul></td></tr><tr><td valign="top"><code>--no-reduceFileSize</code></td><td valign="top"></td><td valign="top">Optimizes instrumented file size.</td></tr><tr><td valign="top"><code>--proxy</code></td><td valign="top"><code>--proxy</code></td><td valign="top">Address of proxy to run connection through.</td></tr><tr><td valign="top"><code>--help</code></td><td valign="top"><code>--help</code></td><td valign="top">Show Help message and exit.</td></tr></tbody></table>

### Running Backend Server (`run`) <a href="#pull-request-session-id" id="pull-request-session-id"></a>

This example is with minimum required CLI Parameters. All available CLI Parameters can be found in the table below.

```bash
##Minimum required CLI parameters
npx slnodejs run \
  --token <token> \
  --buildSessionId <id> \
  --scanDir <path> \
  --labId <labid> \
  --testStage <teststage>
```

{% hint style="info" %}
Example of command:

{% code overflow="wrap" %}

```bash
npx slnodejs run --tokenFile ./sltoken.txt --buildSessionIdFile buildSessionId --labId "LAB_ID_2" --workspacePath "./server" --useinitialcolor true -- "./server/app.js"
```

{% endcode %}

Note the `./server` in the `--workspacePath` refers to `./server/app.js` in the above example.
{% endhint %}

#### All CLI Parameters

<table><thead><tr><th width="214.14453125" valign="top">CLI Parameter</th><th width="214.9453125" valign="top">Legacy Alias</th><th valign="top">Description</th></tr></thead><tbody><tr><td valign="top"><code>--token</code></td><td valign="top"><code>--token</code></td><td valign="top">Access token generated from the Sealights server.</td></tr><tr><td valign="top"><code>--tokenFile</code></td><td valign="top"><code>--tokenfile</code></td><td valign="top">Path to file containing access token generated from the SeaLights server.</td></tr><tr><td valign="top"><code>--buildSessionId</code></td><td valign="top"><code>--buildsessionid</code></td><td valign="top">(Optional) A user provided session ID (case-sensitive).</td></tr><tr><td valign="top"><code>--buildSessionIdFile</code></td><td valign="top"><code>--buildsessionidfile</code></td><td valign="top">Path to file containing the Session ID of configuration created.</td></tr><tr><td valign="top"><code>--appName</code></td><td valign="top"><code>--appname</code></td><td valign="top">Name of the application.</td></tr><tr><td valign="top"><code>--branchName</code></td><td valign="top"><code>--branch</code></td><td valign="top">The build label of the current build.</td></tr><tr><td valign="top"><code>--buildName</code></td><td valign="top"><code>--build</code></td><td valign="top">The build label of the current build.</td></tr><tr><td valign="top"><code>--labId</code></td><td valign="top"><code>--labid</code></td><td valign="top">Unique ID for a set of test labs in case multiple labs are running simultaneously or for an Integration Build.<br>This needs to be done during the instrumentation process when using the <code>instrumentForBrowsers</code> option.</td></tr><tr><td valign="top"><code>--testStage</code></td><td valign="top"><code>--teststage</code></td><td valign="top">'integration tests', 'regression'). The default will be 'Unit Tests'.</td></tr><tr><td valign="top"><code>--useBranchCoverage</code></td><td valign="top"></td><td valign="top">Enables branch coverage collection (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--failOnError</code></td><td valign="top"><code>--failbuild</code></td><td valign="top">Flag indicating whether the command should exit with status code <code>1</code> if the command fails (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--collectorUrl</code></td><td valign="top"><code>--collectorurl</code></td><td valign="top">The URL to Sealights collector used to collect footprints from browser environment (Format: <code>https://&#x3C;collectorIP>:&#x3C;collectorPort>/api</code>).</td></tr><tr><td valign="top"><code>--skipUpgrade</code></td><td valign="top"><code>--skipupgrade</code></td><td valign="top">Prevents the agent from attempting automatic upgrades (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--overrideServer</code></td><td valign="top"><code>--overrideserver</code></td><td valign="top">Overrides the server URL used by the agent for connectivity. Example use case: using the Collector as a proxy.</td></tr><tr><td valign="top"><code>--scanDir</code></td><td valign="top"><code>--workspacePath</code>, <code>--distFolderPath</code>, <code>--distPath</code>, <code>--distributablePath</code>, <code>-w</code></td><td valign="top">Path to the source workspace where the source code exists.</td></tr><tr><td valign="top"><code>--outputPath</code></td><td valign="top"><code>--outputpath</code></td><td valign="top">Folder to generate the instrumented JS files in when using the <code>instrumentForBrowsers</code> parameter.</td></tr><tr><td valign="top"><code>--projectRoot</code></td><td valign="top"><code>--projectRoot</code></td><td valign="top">Path to the root of the project. Usually where the src folder resides.</td></tr><tr><td valign="top"><code>--es6Modules</code></td><td valign="top"><code>--es6Modules</code></td><td valign="top">Enables ES6 module handling during scan or run (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--httpServerColoring</code></td><td valign="top"></td><td valign="top">Enables server-side coloring propagation  (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--httpClientColoring</code></td><td valign="top"></td><td valign="top">Enables client-side coloring propagation (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--useInitialColor</code></td><td valign="top"><code>--useinitialcolor</code></td><td valign="top">Enables generic mode for unsupported test frameworks (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--libraries</code></td><td valign="top"></td><td valign="top">Comma-separated list of Node modules to include in coverage. CSV format: <code>--libraries=@socket.io,agent-base,chokidar</code>.</td></tr><tr><td valign="top"><code>--omitFootprintsLeadingSlash</code></td><td valign="top"></td><td valign="top">Removes leading slash from footprint paths if present (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--forwardSignals</code></td><td valign="top"></td><td valign="top">Enables signal forwarding for graceful shutdown in containerized environments. When enabled, termination signals (SIGTERM, SIGINT, etc.) are properly forwarded to the child application process (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--signalForwardingTimeout</code></td><td valign="top"></td><td valign="top">Timeout in seconds before forcefully terminating child process after signal forwarding (Default: <code>10</code>).</td></tr><tr><td valign="top"><code>--proxy</code></td><td valign="top"><code>--proxy</code></td><td valign="top">Address of proxy to run connection through.</td></tr><tr><td valign="top"><code>--help</code></td><td valign="top"><code>--help</code></td><td valign="top">Show Help message and exit.</td></tr></tbody></table>

### Updating/deleting a Component from an Integration Build (`componentUpdate` or `componentDelete`) <a href="#pull-request-session-id" id="pull-request-session-id"></a>

This example is with minimum required CLI Parameters. All available CLI Parameters can be found in the table below.

```bash
##Minimum required CLI parameters
npx slnodejs componentUpdate \
  --token <token> \
  --buildSessionId <id> \
  --componentIds <listofcomponents>
```

#### All CLI Parameters

<table><thead><tr><th width="214.14453125" valign="top">CLI Parameter</th><th width="214.9453125" valign="top">Legacy Alias</th><th valign="top">Description</th></tr></thead><tbody><tr><td valign="top"><code>--token</code></td><td valign="top"><code>--token</code></td><td valign="top">Access token generated from the Sealights server.</td></tr><tr><td valign="top"><code>--tokenFile</code></td><td valign="top"><code>--tokenfile</code></td><td valign="top">Path to file containing access token generated from the SeaLights server.</td></tr><tr><td valign="top"><code>--buildSessionId</code></td><td valign="top"><code>--buildsessionid</code></td><td valign="top">(Optional) A user provided session ID (case-sensitive).</td></tr><tr><td valign="top"><code>--buildSessionIdFile</code></td><td valign="top"><code>--buildsessionidfile</code></td><td valign="top">Path to file containing the Session ID of configuration created.</td></tr><tr><td valign="top"><code>--appName</code></td><td valign="top"><code>--appname</code></td><td valign="top">Name of the application.</td></tr><tr><td valign="top"><code>--branchName</code></td><td valign="top"><code>--branch</code></td><td valign="top">The source branch of the application.</td></tr><tr><td valign="top"><code>--buildName</code></td><td valign="top"><code>--build</code></td><td valign="top">The build label of the current build.</td></tr><tr><td valign="top"><code>--failOnError</code></td><td valign="top"><code>--failbuild</code></td><td valign="top">Flag indicating whether the command should exit with status code <code>1</code> if the command fails (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--skipUpgrade</code></td><td valign="top"><code>--skipupgrade</code></td><td valign="top">Prevents the agent from attempting automatic upgrades (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--overrideServer</code></td><td valign="top"><code>--overrideserver</code></td><td valign="top">Overrides the server URL used by the agent for connectivity. Example use case: using the Collector as a proxy.</td></tr><tr><td valign="top"><code>--componentIds</code></td><td valign="top"><code>--componentids</code></td><td valign="top">A list of comma-separated components build session ids (BSIDs).</td></tr><tr><td valign="top"><code>--componentFile</code></td><td valign="top"><code>--componentfile</code></td><td valign="top">A path to a json file. Format: <code>[{"appname":"","branch":"","build":"","buildSessionId":""},{...}]</code>. Every entry may include <code>appName+branchName+buildName</code> or <code>buildSessionId</code>.</td></tr><tr><td valign="top"><code>--proxy</code></td><td valign="top"><code>--proxy</code></td><td valign="top">Address of proxy to run connection through.</td></tr><tr><td valign="top"><code>--help</code></td><td valign="top"><code>--help</code></td><td valign="top">Show Help message and exit.</td></tr></tbody></table>

### Test Listener - Opening a Test Stage (`start`) <a href="#starting-a-test-stage" id="starting-a-test-stage"></a>

This example is with minimum required CLI Parameters. All available CLI Parameters can be found in the table below.

```bash
##Minimum required CLI parameters
npx slnodejs start \
  --token <token> \
  --buildSessionId <id> \
  --labId <labid> \
  --testStage <teststage>
```

{% hint style="warning" %}
The `buildSessionId` and `buildSessionIdFile` parameters are **deprecated** for test-runner commands. Use `labId` instead. These parameters remain supported only for unit-test runners that execute the build's code directly (e.g. Mocha, Karma, AVA).
{% endhint %}

#### All CLI Parameters

<table><thead><tr><th width="214.14453125" valign="top">CLI Parameter</th><th width="214.9453125" valign="top">Legacy Alias</th><th valign="top">Description</th></tr></thead><tbody><tr><td valign="top"><code>--token</code></td><td valign="top"><code>--token</code></td><td valign="top">Access token generated from the Sealights server.</td></tr><tr><td valign="top"><code>--tokenFile</code></td><td valign="top"><code>--tokenfile</code></td><td valign="top">Path to file containing access token generated from the SeaLights server.</td></tr><tr><td valign="top"><code>--buildSessionId</code></td><td valign="top"><code>--buildsessionid</code></td><td valign="top">(Optional) A user provided session ID (case-sensitive).</td></tr><tr><td valign="top"><code>--buildSessionIdFile</code></td><td valign="top"><code>--buildsessionidfile</code></td><td valign="top">Path to file containing the Session ID of configuration created.</td></tr><tr><td valign="top"><code>--labId</code></td><td valign="top"><code>--labid</code></td><td valign="top">Unique ID for a set of test labs in case multiple labs are running simultaneously or for an Integration Build.<br>This needs to be done during the instrumentation process when using the <code>instrumentForBrowsers</code> option.</td></tr><tr><td valign="top"><code>--testStage</code></td><td valign="top"><code>--teststage</code></td><td valign="top">Name of the test stage.</td></tr><tr><td valign="top"><code>--testGroupId</code></td><td valign="top"><code>--testgroupid</code></td><td valign="top">The test group id.</td></tr><tr><td valign="top"><code>--appName</code></td><td valign="top"><code>--appname</code></td><td valign="top">Name of the application.</td></tr><tr><td valign="top"><code>--branchName</code></td><td valign="top"><code>--branch</code></td><td valign="top">The source branch of the application.</td></tr><tr><td valign="top"><code>--buildName</code></td><td valign="top"><code>--build</code></td><td valign="top">The build label of the current build.</td></tr><tr><td valign="top"><code>--failOnError</code></td><td valign="top"><code>--failbuild</code></td><td valign="top">Flag indicating whether the command should exit with status code <code>1</code> if the command fails (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--skipUpgrade</code></td><td valign="top"><code>--skipupgrade</code></td><td valign="top">Prevents the agent from attempting automatic upgrades (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--overrideServer</code></td><td valign="top"><code>--overrideserver</code></td><td valign="top">Overrides the server URL used by the agent for connectivity. Example use case: using the Collector as a proxy.</td></tr><tr><td valign="top"><code>--componentIds</code></td><td valign="top"><code>--componentids</code></td><td valign="top">A list of comma-separated components build session ids (BSIDs).</td></tr><tr><td valign="top"><code>--componentFile</code></td><td valign="top"><code>--componentfile</code></td><td valign="top">A path to a json file. Format: <code>[{"appname":"","branch":"","build":"","buildSessionId":""},{...}]</code>. Every entry may include <code>appName+branchName+buildName</code> or <code>buildSessionId</code>.</td></tr><tr><td valign="top"><code>--proxy</code></td><td valign="top"><code>--proxy</code></td><td valign="top">Address of proxy to run connection through.</td></tr><tr><td valign="top"><code>--help</code></td><td valign="top"><code>--help</code></td><td valign="top">Show Help message and exit.</td></tr></tbody></table>

### Test Listener - Uploading Report Files (`uploadReports`) <a href="#upload-report-files" id="upload-report-files"></a>

{% hint style="warning" %}
Report files must be JUnit style XML reports.&#x20;
{% endhint %}

This example is with minimum required CLI Parameters. All available CLI Parameters can be found in the table below.

```bash
##Minimum required CLI parameters
npx slnodejs uploadReports \
  --token <token> \
  --buildSessionId <id> \
  --file <reportfile> \
  --filesFolder <filesfolder>
```

#### All CLI Parameters

<table><thead><tr><th width="214.14453125" valign="top">CLI Parameter</th><th width="214.9453125" valign="top">Legacy Alias</th><th valign="top">Description</th></tr></thead><tbody><tr><td valign="top"><code>--token</code></td><td valign="top"><code>--token</code></td><td valign="top">Access token generated from the Sealights server.</td></tr><tr><td valign="top"><code>--tokenFile</code></td><td valign="top"><code>--tokenfile</code></td><td valign="top">Path to file containing access token generated from the SeaLights server.</td></tr><tr><td valign="top"><code>--buildSessionId</code></td><td valign="top"><code>--buildsessionid</code></td><td valign="top">(Optional) A user provided session ID (case-sensitive).</td></tr><tr><td valign="top"><code>--buildSessionIdFile</code></td><td valign="top"><code>--buildsessionidfile</code></td><td valign="top">Path to file containing the Session ID of configuration created.</td></tr><tr><td valign="top"><code>--labId</code></td><td valign="top"><code>--labid</code></td><td valign="top">Unique ID for a set of test labs in case multiple labs are running simultaneously or for an Integration Build.<br>This needs to be done during the instrumentation process when using the <code>instrumentForBrowsers</code> option.</td></tr><tr><td valign="top"><code>--testStage</code></td><td valign="top"><code>--teststage</code></td><td valign="top">Name of the test stage.</td></tr><tr><td valign="top"><code>--appName</code></td><td valign="top"><code>--appname</code></td><td valign="top">Name of the application.</td></tr><tr><td valign="top"><code>--branchName</code></td><td valign="top"><code>--branch</code></td><td valign="top">The source branch of the application.</td></tr><tr><td valign="top"><code>--buildName</code></td><td valign="top"><code>--build</code></td><td valign="top">The build label of the current build.</td></tr><tr><td valign="top"><code>--failOnError</code></td><td valign="top"><code>--failbuild</code></td><td valign="top">Flag indicating whether the command should exit with status code <code>1</code> if the command fails (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--skipUpgrade</code></td><td valign="top"><code>--skipupgrade</code></td><td valign="top">Prevents the agent from attempting automatic upgrades (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--overrideServer</code></td><td valign="top"><code>--overrideserver</code></td><td valign="top">Overrides the server URL used by the agent for connectivity. Example use case: using the Collector as a proxy.</td></tr><tr><td valign="top"><code>--file</code></td><td valign="top"><code>--reportfile</code></td><td valign="top">Path to report file. This argument can be declared multiple times in order to upload multiple files (Default: <code>[]</code>).</td></tr><tr><td valign="top"><code>--filesFolder</code></td><td valign="top"><code>--reportfilesfolder</code></td><td valign="top"><p>Path to folder that contains nothing but report files. All files in folder will be uploaded.<br>This argument can be declared multiple times in order to upload multiple files from multiple folders containing report files.</p><p>Note: all files in the folder will be uploaded.</p></td></tr><tr><td valign="top"><code>--source</code></td><td valign="top"><code>--source</code></td><td valign="top">Source of test framework (Default: <code>Mocha</code>).</td></tr><tr><td valign="top"><code>--type</code></td><td valign="top"><code>--type</code></td><td valign="top">Type of test report (Default: <code>JUnitReport</code>).</td></tr><tr><td valign="top"><code>--hasMoreRequests</code></td><td valign="top"><code>--hasmorerequests</code></td><td valign="top">Indicats whether or not to stop execution after upload (Default: <code>true</code>).</td></tr><tr><td valign="top"><code>--proxy</code></td><td valign="top"><code>--proxy</code></td><td valign="top">Address of proxy to run connection through.</td></tr><tr><td valign="top"><code>--help</code></td><td valign="top"><code>--help</code></td><td valign="top">Show Help message and exit.</td></tr></tbody></table>

### Test Listener - Upload Coverage Files (`nycReport`) <a href="#ending-a-test-stage" id="ending-a-test-stage"></a>

{% hint style="warning" %}
The coverage file must be in JSON format, created by the [Istanbuljs/nyc](https://istanbul.js.org/) framework.
{% endhint %}

This example is with minimum required CLI Parameters. All available CLI Parameters can be found in the table below.

```bash
npx slnodejs nycReport \
  --token <token> \
  --buildSessionId <id> \
  --labId <labid> \ 
  --report <report> \
  --projectRoot <projectroot>
```

#### All CLI Parameters

<table><thead><tr><th width="214.14453125" valign="top">CLI Parameter</th><th width="214.9453125" valign="top">Legacy Alias</th><th valign="top">Description</th></tr></thead><tbody><tr><td valign="top"><code>--token</code></td><td valign="top"><code>--token</code></td><td valign="top">Access token generated from the Sealights server.</td></tr><tr><td valign="top"><code>--tokenFile</code></td><td valign="top"><code>--tokenfile</code></td><td valign="top">Path to file containing access token generated from the SeaLights server.</td></tr><tr><td valign="top"><code>--buildSessionId</code></td><td valign="top"><code>--buildsessionid</code></td><td valign="top">(Optional) A user provided session ID (case-sensitive).</td></tr><tr><td valign="top"><code>--buildSessionIdFile</code></td><td valign="top"><code>--buildsessionidfile</code></td><td valign="top">Path to file containing the Session ID of configuration created.</td></tr><tr><td valign="top"><code>--labId</code></td><td valign="top"><code>--labid</code></td><td valign="top">Unique ID for a set of test labs in case multiple labs are running simultaneously or for an Integration Build.<br>This needs to be done during the instrumentation process when using the <code>instrumentForBrowsers</code> option.</td></tr><tr><td valign="top"><code>--testStage</code></td><td valign="top"><code>--teststage</code></td><td valign="top">Name of the test stage.</td></tr><tr><td valign="top"><code>--appName</code></td><td valign="top"><code>--appname</code></td><td valign="top">Name of the application.</td></tr><tr><td valign="top"><code>--branchName</code></td><td valign="top"><code>--branch</code></td><td valign="top">The source branch of the application.</td></tr><tr><td valign="top"><code>--buildName</code></td><td valign="top"><code>--build</code></td><td valign="top">The build label of the current build.</td></tr><tr><td valign="top"><code>--failOnError</code></td><td valign="top"><code>--failbuild</code></td><td valign="top">Flag indicating whether the command should exit with status code <code>1</code> if the command fails (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--skipUpgrade</code></td><td valign="top"><code>--skipupgrade</code></td><td valign="top">Prevents the agent from attempting automatic upgrades (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--overrideServer</code></td><td valign="top"><code>--overrideserver</code></td><td valign="top">Overrides the server URL used by the agent for connectivity. Example use case: using the Collector as a proxy.</td></tr><tr><td valign="top"><code>--report</code></td><td valign="top"><code>--report</code></td><td valign="top">Path to the relevant nyc json report. This command needs an open execution to work. Passing a test-stage using the <code>--testStage</code> will automatically open an execution. (Default: <code>"/Users/username/coverage/coverage-final.json"</code>)</td></tr><tr><td valign="top"><code>--projectRoot</code></td><td valign="top"><code>--projectroot</code></td><td valign="top">Determines the root directory of a project (Default: current working directory).</td></tr><tr><td valign="top"><code>--proxy</code></td><td valign="top"><code>--proxy</code></td><td valign="top">Address of proxy to run connection through.</td></tr><tr><td valign="top"><code>--help</code></td><td valign="top"><code>--help</code></td><td valign="top">Show Help message and exit.</td></tr></tbody></table>

### Test Listener - Closing a Test Stage (`end`) <a href="#starting-a-test-stage" id="starting-a-test-stage"></a>

This example is with minimum required CLI Parameters. All available CLI Parameters can be found in the table below.

```bash
##Minimum required CLI parameters
npx slnodejs end \
  --token <token> \
  --buildSessionId <id> \
  --labId <labid>
```

#### All CLI Parameters

<table><thead><tr><th width="214.14453125" valign="top">CLI Parameter</th><th width="214.9453125" valign="top">Legacy Alias</th><th valign="top">Description</th></tr></thead><tbody><tr><td valign="top"><code>--token</code></td><td valign="top"><code>--token</code></td><td valign="top">Access token generated from the Sealights server.</td></tr><tr><td valign="top"><code>--tokenFile</code></td><td valign="top"><code>--tokenfile</code></td><td valign="top">Path to file containing access token generated from the SeaLights server.</td></tr><tr><td valign="top"><code>--buildSessionId</code></td><td valign="top"><code>--buildsessionid</code></td><td valign="top">(Optional) A user provided session ID (case-sensitive).</td></tr><tr><td valign="top"><code>--buildSessionIdFile</code></td><td valign="top"><code>--buildsessionidfile</code></td><td valign="top">Path to file containing the Session ID of configuration created.</td></tr><tr><td valign="top"><code>--labId</code></td><td valign="top"><code>--labid</code></td><td valign="top">Unique ID for a set of test labs in case multiple labs are running simultaneously or for an Integration Build.<br>This needs to be done during the instrumentation process when using the <code>instrumentForBrowsers</code> option.</td></tr><tr><td valign="top"><code>--appName</code></td><td valign="top"><code>--appname</code></td><td valign="top">Name of the application.</td></tr><tr><td valign="top"><code>--branchName</code></td><td valign="top"><code>--branch</code></td><td valign="top">The source branch of the application.</td></tr><tr><td valign="top"><code>--buildName</code></td><td valign="top"><code>--build</code></td><td valign="top">The build label of the current build.</td></tr><tr><td valign="top"><code>--failOnError</code></td><td valign="top"><code>--failbuild</code></td><td valign="top">Flag indicating whether the command should exit with status code <code>1</code> if the command fails (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--skipUpgrade</code></td><td valign="top"><code>--skipupgrade</code></td><td valign="top">Prevents the agent from attempting automatic upgrades (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--overrideServer</code></td><td valign="top"><code>--overrideserver</code></td><td valign="top">Overrides the server URL used by the agent for connectivity. Example use case: using the Collector as a proxy.</td></tr><tr><td valign="top"><code>--proxy</code></td><td valign="top"><code>--proxy</code></td><td valign="top">Address of proxy to run connection through.</td></tr><tr><td valign="top"><code>--help</code></td><td valign="top"><code>--help</code></td><td valign="top">Show Help message and exit.</td></tr></tbody></table>

### Running Tests via Mocha (`mocha`) <a href="#ending-a-test-stage" id="ending-a-test-stage"></a>

This example is with minimum required CLI Parameters. All available CLI Parameters can be found in the table below.

```bash
##Minimum required CLI parameters
npx slnodejs mocha \
  --token <token> \
  --buildSessionId <id> \
  --labId <labid> \
  --testStage <teststage>
```

#### All CLI Parameters

<table><thead><tr><th width="214.14453125" valign="top">CLI Parameter</th><th width="214.9453125" valign="top">Legacy Alias</th><th valign="top">Description</th></tr></thead><tbody><tr><td valign="top"><code>--token</code></td><td valign="top"><code>--token</code></td><td valign="top">Access token generated from the Sealights server.</td></tr><tr><td valign="top"><code>--tokenFile</code></td><td valign="top"><code>--tokenfile</code></td><td valign="top">Path to file containing access token generated from the SeaLights server.</td></tr><tr><td valign="top"><code>--buildSessionId</code></td><td valign="top"><code>--buildsessionid</code></td><td valign="top">(Optional) A user provided session ID (case-sensitive).</td></tr><tr><td valign="top"><code>--buildSessionIdFile</code></td><td valign="top"><code>--buildsessionidfile</code></td><td valign="top">Path to file containing the Session ID of configuration created.</td></tr><tr><td valign="top"><code>--labId</code></td><td valign="top"><code>--labid</code></td><td valign="top">Unique ID for a set of test labs in case multiple labs are running simultaneously or for an Integration Build.<br>This needs to be done during the instrumentation process when using the <code>instrumentForBrowsers</code> option.</td></tr><tr><td valign="top"><code>--testStage</code></td><td valign="top"><code>--teststage</code></td><td valign="top">Name of the test stage.</td></tr><tr><td valign="top"><code>--appName</code></td><td valign="top"><code>--appname</code></td><td valign="top">Name of the application.</td></tr><tr><td valign="top"><code>--branchName</code></td><td valign="top"><code>--branch</code></td><td valign="top">The source branch of the application.</td></tr><tr><td valign="top"><code>--buildName</code></td><td valign="top"><code>--build</code></td><td valign="top">The build label of the current build.</td></tr><tr><td valign="top"><code>--failOnError</code></td><td valign="top"><code>--failbuild</code></td><td valign="top">Flag indicating whether the command should exit with status code <code>1</code> if the command fails (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--skipUpgrade</code></td><td valign="top"><code>--skipupgrade</code></td><td valign="top">Prevents the agent from attempting automatic upgrades (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--overrideServer</code></td><td valign="top"><code>--overrideserver</code></td><td valign="top">Overrides the server URL used by the agent for connectivity. Example use case: using the Collector as a proxy.</td></tr><tr><td valign="top"><code>--useBranchCoverage</code></td><td valign="top"></td><td valign="top">Enables branch coverage collection (Default: <code>false</code>). </td></tr><tr><td valign="top"><code>--httpServerColoring</code></td><td valign="top"></td><td valign="top">Enables server-side coloring propagation  (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--httpClientColoring</code></td><td valign="top"></td><td valign="top">Enables client-side coloring propagation (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--projectRoot</code></td><td valign="top"><code>--projectRoot</code></td><td valign="top">Path to the root of the project. Usually where the src folder resides.</td></tr><tr><td valign="top"><code>--es6Modules</code></td><td valign="top"><code>--es6Modules</code></td><td valign="top">Enables ES6 module handling during scan or run (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--testGroupId</code></td><td valign="top"><code>--testgroupid</code></td><td valign="top">The test group id.</td></tr><tr><td valign="top"><code>--testProjectId</code></td><td valign="top"><code>--testprojectid</code></td><td valign="top">The test project id.</td></tr><tr><td valign="top"><code>--resolveWithoutHash</code></td><td valign="top"></td><td valign="top">Resolves mappings without using hashes (Default: <code>true</code>).</td></tr><tr><td valign="top"><code>--disableTia</code></td><td valign="top"><code>--enforcefullrun</code>, <code>--tiadisabled</code></td><td valign="top">Disables Test Optimization and runs the full test suite.</td></tr><tr><td valign="top"><code>--prId</code></td><td valign="top"><code>--prid</code></td><td valign="top">The PR id.</td></tr><tr><td valign="top"><code>--proxy</code></td><td valign="top"><code>--proxy</code></td><td valign="top">Address of proxy to run connection through.</td></tr><tr><td valign="top"><code>--help</code></td><td valign="top"><code>--help</code></td><td valign="top">Show Help message and exit.</td></tr></tbody></table>

### Running Tests via Jasmine (`jasmine`) <a href="#ending-a-test-stage" id="ending-a-test-stage"></a>

This example is with minimum required CLI Parameters. All available CLI Parameters can be found in the table below.

```bash
##Minimum required CLI parameters
npx slnodejs jasmine \
  --token <token> \
  --buildSessionId <id> \
  --labId <labid> \
  --testStage <teststage>
```

#### All CLI Parameters

<table><thead><tr><th width="214.14453125" valign="top">CLI Parameter</th><th width="214.9453125" valign="top">Legacy Alias</th><th valign="top">Description</th></tr></thead><tbody><tr><td valign="top"><code>--token</code></td><td valign="top"><code>--token</code></td><td valign="top">Access token generated from the Sealights server.</td></tr><tr><td valign="top"><code>--tokenFile</code></td><td valign="top"><code>--tokenfile</code></td><td valign="top">Path to file containing access token generated from the SeaLights server.</td></tr><tr><td valign="top"><code>--buildSessionId</code></td><td valign="top"><code>--buildsessionid</code></td><td valign="top">(Optional) A user provided session ID (case-sensitive).</td></tr><tr><td valign="top"><code>--buildSessionIdFile</code></td><td valign="top"><code>--buildsessionidfile</code></td><td valign="top">Path to file containing the Session ID of configuration created.</td></tr><tr><td valign="top"><code>--labId</code></td><td valign="top"><code>--labid</code></td><td valign="top">Unique ID for a set of test labs in case multiple labs are running simultaneously or for an Integration Build.<br>This needs to be done during the instrumentation process when using the <code>instrumentForBrowsers</code> option.</td></tr><tr><td valign="top"><code>--testStage</code></td><td valign="top"><code>--teststage</code></td><td valign="top">Name of the test stage.</td></tr><tr><td valign="top"><code>--failOnError</code></td><td valign="top"><code>--failbuild</code></td><td valign="top">Flag indicating whether the command should exit with status code <code>1</code> if the command fails (Default: <code>false</code>).</td></tr><tr><td valign="top"><code>--proxy</code></td><td valign="top"><code>--proxy</code></td><td valign="top">Address of proxy to run connection through.</td></tr><tr><td valign="top"><code>--help</code></td><td valign="top"><code>--help</code></td><td valign="top">Show Help message and exit.</td></tr></tbody></table>

## Logging <a href="#logging" id="logging"></a>

To **enable logs,** you can set the `NODE_DEBUG` environment variable to a value defining the output per the table below:

| Linux                  | Powershell             |
| ---------------------- | ---------------------- |
| `export NODE_DEBUG=sl` | `$env:NODE_DEBUG="sl"` |

| Value     | Description                                                    |
| --------- | -------------------------------------------------------------- |
| `sl`      | Display log output to the console                              |
| `sl-file` | Export the log information to a log file named '`sl.node.log`' |

Furthermore, you can **set the logging level** using the `SL_LOG_LEVEL` environment variable with one of the following options: `info` (default) or `debug`.

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

```bash
export NODE_DEBUG=sl
export SL_LOG_LEVEL=debug
```

{% endcode %}

To write the log to a specific directory, use `SL_LOG_OUTPUT_FILE` and ensure that the directory has a write permissions.

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

```bash
export NODE_DEBUG=sl-file
export SL_LOG_LEVEL=debug
export SL_LOG_OUTPUT_FILE=/var/log/my-custom.log
```

{% endcode %}

To **disable logs**, unset the `NODE_DEBUG` variable.

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

```
export NODE_DEBUG=
```

{% endcode %}

{% hint style="info" %}
The above examples are for Linux shells; for Windows CMD prompt, use the `set` command.
{% 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/command-reference.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.
