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.txt
token
Access token generated from the Sealights server
tokenfile
Path to file containing access token generated from the SeaLights server
lang
help
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 proxy
Generating 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]
token
Access token generated from the Sealights server
tokenfile
Path to file containing access token generated from the SeaLights server
appname
Name of the application
branchname
The source branch of the application
buildname
The build label of the current build
workspacepath
Path to the workspace where the source code exists
include
Include only files whose paths match one of these patterns. Accepts shell-style wildcards, which must be quoted. If you want to provide multiple patterns, please use a comma between each quoted pattern. For example, "pattern1", "pattern2".
exclude
Omit files whose paths match one of these patterns. Accepts shell-style wildcards, which must be quoted. If you want to provide multiple patterns, please use a comma between each quoted pattern. For example, "pattern1", "pattern2".
buildsessionid
Optional: A user provided session ID (case-sensitive)
proxy
Address of proxy to run connection through
help
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-bsid
Pull 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]
token
Access token generated from the Sealights server
tokenfile
Path to file containing access token generated from the SeaLights server
appname
Name of the application
targetbranch
The branch to which this PR will be merged into (already reported to SeaLights)
latestcommit
The full SHA of the last commit made to the Pull Request
pullrequestnumber
he number assigned to the Pull Request from the source control
repourl
The pull request URL for the PR to be scanned, up until the section before the pullRequestNumber value
workspacepath
Path to the workspace where the source code exists
include
Include only files whose paths match one of these patterns. Accepts shell-style wildcards, which must be quoted.
exclude
Omit files whose paths match one of these patterns. Accepts shell-style wildcards, which must be quoted.
buildsessionid
Optional: A user provided session ID (case-sensitive)
proxy
Address of proxy to run connection through
help
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 string
Scanning 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]
token
Access token generated from the SeaLights server
tokenfile
Path to file containing access token generated from the SeaLights server
buildsessionid
Session ID of configuration created
buildsessionidfile
Path to file containing the Session ID of configuration created
path-to-scanner
Path to the executable of the golang agent. It should refer to the executable file and not to its folder.
disable-on-init
Default false
disable-token-save
Default false
scm
Source control used
Current options are: git, none
scmprovider
The provider name of your Source Control Management (SCM) tool. Values: Github, Bitbucket and Gitlab (Default is Github)
scmbaseurl
The URL to the repository which contains the code.
If not provided, the url of the remote GIT origin will be used
Example: https://my.
bitbucket.com/projects/ABCD/repos/XYZ/browse/A1
scmversion
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.
proxy
Address of proxy to run connection through
help
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 further documented soon, please refer to their --help
option via the command below
slcli scan --tests-runner --enable-ginkgo
Starting a test stage
slcli test start-stage {--token <token> | --tokenfile <file>} {--buildsessionid <id> | --buildsessionidfile <file>} --teststage <teststage> [--labid <labid>] [--proxy <proxy>] [--help]
token
Access token generated from the SeaLights server
tokenfile
Path to file containing access token generated from the SeaLights server
buildsessionid
Session ID of configuration created
buildsessionidfile
Path to file containing the Session ID of configuration created
teststage
Name of the test stage
labid
Unique ID for a set of test labs in case multiple labs are running simultaneously
proxy
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]
token
Access token generated from the SeaLights server
tokenfile
Path to file containing access token generated from the SeaLights server
buildsessionid
Session ID of configuration created
buildsessionidfile
Path to file containing the Session ID of configuration created
reportfile
Path to report file. This argument can be declared multiple times in order to upload multiple files.
reportfilesfolder
Path to folder that contains nothing but report files. All files in folder will be uploaded. This argument can be declared multiple times in order to upload multiple files from multiple folders containing report files.
Note: all files in the folder will be uploaded
hasmorerequests
Set to ‘True’ if test results contains multiple reports (Default: ‘False’).
labid
Unique ID for a set of test labs in case multiple labs are running simultaneously (case-sensitive)
source
The reports provider. If not set, the default will be 'Junit xml report'.
type
Name of testing framework type. The report type. If not set, the default will be 'JunitReport'
JUnitReport - For uploading JUnit test report files
commitLog - For uploading git style commit logs
proxy
Address of proxy to run connection through
help
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}]
token
Access token generated from the SeaLights server
tokenfile
Path to file containing access token generated from the SeaLights server
buildsessionid
Session ID of configuration created
buildsessionidfile
Path to file containing the Session ID of configuration created
labid
Unique ID for a set of test labs in case multiple labs are running simultaneously
proxy
Address of proxy to run connection through
help
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=true
To disable logging, simply set the variable to false
.
You 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=info
Environment Variables
You can define or override some agent parameters using the environment variables below.
SEALIGHTS_DISABLE_ON_INIT
TRUE
You need to set this env variable to false to enable sealights when running the scan with --disable-on-init true
Runtime
SEALIGHTS_DISABLE
FALSE
If you do not run the scan with --disable-on-init true
, then use this flag to disable Sealights. (For instance in production)
Runtime
SEALIGHTS_COLLECTOR_URL
““
Setting Collector URL in light mode (for lambda apps)
Runtime
SEALIGHTS_LAB_ID
BuildSession Id
Setting Lab Id
Runtime, Testing
SEALIGHTS_PROXY_URL
““
Proxy URL for connection to server
SEALIGHTS_LIGHT_MODE
FALSE
Enable/Disable agent mode in light mode (for lambda apps)
Runtime
SEALIGHTS_TEST_STAGE
-
Name of the test stage to appear in the dashboard.
Testing
SEALIGHTS_BUILD_SESSION_ID
-
Session ID of configuration created
SEALIGHTS_AGENT_TOKEN
-
Access token generated from the SeaLights server
SEALIGHTS_IGNORE_GO_TESTS
false
Disable integration with the testing.T
type for Go tests. It is commonly used with Ginkgo integration.
Testing
Last updated
Was this helpful?