Using Go agent - Command Reference
Every command and option listed below is documented via the agent's --help option.
Usage:
slcli [command]
Available Commands:
completion Generate the autocompletion script for the specified shell
config configuration command
help Help about any command
integration-build
scan scans the code
test
test-sessions
Flags:
-h, --help help for slcli
-v, --version version for slcli
Use "slcli [command] --help" for more information about a command.Initializing the Go Agent Configuration
./slcli config init --lang go --token ./sltoken.txtParameter | Description |
|---|---|
| Access token generated from the Sealights server |
| Path to file containing access token generated from the SeaLights server |
|
|
| Show Help message and exit. |
Usage:
slcli config [flags]
slcli config [command]
Available Commands:
create-bsid command creates new build session id
create-pr-bsid A brief description of your command
init Create SL configuration file
verify verify backend server and proxyGenerating a session ID
Standard Session ID
slcli config create-bsid {--token <token> | --tokenfile <file>} --appname <appname> --branchname <branch> --buildname <build> --workspacepath <path> [--include <include>] [--exclude <exclude>] [--buildsessionid <buildsessionid>] [--proxy <proxy>] [--help]Parameter | Description |
|---|---|
| Access token generated from the Sealights server |
| Path to file containing access token generated from the SeaLights server |
| Name of the application |
| The source branch of the application |
| The build label of the current build |
| Path to the workspace where the source code exists |
| Include only files whose paths match one of these patterns. |
| Omit files whose paths match one of these patterns. |
| Optional: A user provided session ID (case-sensitive) |
| Address of proxy to run connection through |
| Show Help message and exit. |
slcli config create-bsid [flags]
Flags:
--app string
--branch string
--bsid-save-location string
--build string
--custom-bsid string
--fail-build
-h, --help help for create-bsidPull Request Session ID
slcli config create-pr-bsid {--token <token> | --tokenfile <file>} --appname <appname> --targetbranch <branch> --latestcommit <commit_sha> --pullrequestnumber <number> --repourl <url> --workspacepath <path> [--include <include>] [--exclude <exclude>] [--buildsessionid <buildsessionid>] [--proxy <proxy>] [--help]Parameter | Description |
|---|---|
| Access token generated from the Sealights server |
| Path to file containing access token generated from the SeaLights server |
| Name of the application |
| The branch to which this PR will be merged into (already reported to SeaLights) |
| The full SHA of the last commit made to the Pull Request |
| he number assigned to the Pull Request from the source control |
| The pull request URL for the PR to be scanned, up until the section before the pullRequestNumber value |
| Path to the workspace where the source code exists |
| Include only files whose paths match one of these patterns. |
| Omit files whose paths match one of these patterns. |
| Optional: A user provided session ID (case-sensitive) |
| Address of proxy to run connection through |
| Show Help message and exit. |
Usage:
slcli config create-pr-bsid [flags]
Flags:
--app string
--bsid-save-location string
--custom-bsid string
--fail-build
-h, --help help for create-pr-bsid
--latest-commit string
--packages-included string
--pull-request-number int
--repository-url string
--target-branch stringScanning a build
slcli scan {--token <token> | --tokenfile <file>} {--buildsessionid <id> | --buildsessionidfile <file>} --scm {git|none} [--scmBaseUrl <url> --scmProvider {github|gitlab|bitbucket} [--scmVersion <version>] [--proxy <proxy>] [--help]Parameter | Description |
|---|---|
| Access token generated from the SeaLights server |
| Path to file containing access token generated from the SeaLights server |
| Session ID of configuration created |
| Path to file containing the Session ID of configuration created |
| Path to the executable of the golang agent. It should refer to the executable file and not to its folder. |
| Default |
| Default |
| Source control used Current options are: git, none |
| The provider name of your Source Control Management (SCM) tool. |
| The URL to the repository which contains the code. If not provided, the url of the remote GIT origin will be used Example: |
| 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. |
| Address of proxy to run connection through |
| Show Help message and exit. |
Usage:
slcli scan [flags]
Flags:
--bsid string (default "./buildSessionId.txt")
--collector-url string
--debug
--disable-on-init
--disable-token-save
--enable-ginkgo
--fail-build
--gomodfile string
-h, --help help for scan
--light-mode
--packages-excluded string
--packages-included string
--path-to-scanner string (default "./build-scanner")
--scm string
--scmBaseUrl string
--scmProvider string
--scmVersion string
--tests-runner
--workspacepath string (default "./")Test Listener
Instrument your Tests running with Ginkgo
These commands will be documented soon, please refer to their --help option via the command below
slcli scan --tests-runner --enable-ginkgoStarting a test stage
slcli test start-stage {--token <token> | --tokenfile <file>} {--buildsessionid <id> | --buildsessionidfile <file>} --teststage <teststage> [--labid <labid>] [--proxy <proxy>] [--help]Parameter | Description |
|---|---|
| Access token generated from the SeaLights server |
| Path to file containing access token generated from the SeaLights server |
| Session ID of configuration created |
| Path to file containing the Session ID of configuration created |
| Name of the test stage |
| Unique ID for a set of test labs in case multiple labs are running simultaneously |
| Address of proxy to run connection through |
Upload report files
Report files must be JUnit style XML reports
slcli test upload-reports {--token <token> | --tokenfile <file>} {--buildsessionid <id> | --buildsessionidfile <file>} {--reportfile <reportFile> | --reportfilesfolder <reportFilesFolder>} [--hasmorerequests {False|True}] [--labid <labid>] [--source <source>] [--type <type>] [--proxy <proxy>] [--help]Parameter | Description |
|---|---|
| Access token generated from the SeaLights server |
| Path to file containing access token generated from the SeaLights server |
| Session ID of configuration created |
| Path to file containing the Session ID of configuration created |
| Path to report file. This argument can be declared multiple times in order to upload multiple files. |
| Path to folder that contains nothing but report files. All files in folder will be uploaded. Note: all files in the folder will be uploaded |
| Set to ‘True’ if test results contains multiple reports (Default: ‘False’). |
| Unique ID for a set of test labs in case multiple labs are running simultaneously (case-sensitive) |
| The reports provider. If not set, the default will be 'Junit xml report'. |
| Name of testing framework type. The report type. If not set, the default will be 'JunitReport'
|
| Address of proxy to run connection through |
| Show Help message and exit. |
Ending a test stage
slcli test end-stage {--token <token> | --tokenfile <file>} {--buildsessionid <id> | --buildsessionidfile <file>} [--labid <labid>] [--proxy <proxy>] [--failbuild {true|false}]Parameter | Description |
|---|---|
| Access token generated from the SeaLights server |
| Path to file containing access token generated from the SeaLights server |
| Session ID of configuration created |
| Path to file containing the Session ID of configuration created |
| Unique ID for a set of test labs in case multiple labs are running simultaneously |
| Address of proxy to run connection through |
| Show Help message and exit. |
Logging
The Sealights Go agent supports only console output and does not support file logging. To enable logging, set the following environment variable:
export SL_DEBUG=trueYou can refine the logging level using the SEALIGHTS_LOG_LEVEL environment variable, which accepts five values (from least to most verbose): none, error, warn, info (default level), and debug. Note that none is equivalent to disabling logging.
export SEALIGHTS_LOG_LEVEL=infoEnvironment Variables
You can define or override some agent parameters using the environment variables below.
Environment Variable Name | Default Value | Description | Scope |
|---|---|---|---|
|
| You need to set this env variable to false to enable sealights when running the scan with | Runtime |
|
| If you do not run the scan with | Runtime |
| ““ | Setting Collector URL in light mode (for lambda apps) | Runtime |
| BuildSession Id | Setting Lab Id | Runtime, Testing |
| ““ | Proxy URL for connection to server |
|
|
| Enable/Disable agent mode in light mode (for lambda apps) | Runtime |
| - | Name of the test stage to appear in the dashboard. | Testing |
| - | Session ID of configuration created |
|
| - | Access token generated from the SeaLights server |
|
|
| Disable integration with the | Testing |