Skip to main content

Overview

Once installed, you can invoke the CLI using sl:

sl [global options] command [command options] [arguments...]

Windows PowerShell users can invoke the CLI as follows:

# Be sure to execute this command from the directory where you
# saved the sl executable. Alternatively, you can provide the
# relative path (i.e., `<path>\sl.exe`)

sl.exe [global options] command [command options] [arguments...]

The CLI accepts the following commands:

CommandDescription
analyzeAnalyze applications using preZero
authAuthenticates the CLI with your Qwiet preZero account and associates your applications with your organization
check-analysisCheck analysis results against pre-defined build rules
check-environmentCheck local environment to ensure connectivity and installation of required tools
count-linesCount the lines of code in a given directory
ocularStart Ocular
policyManage custom policies
remediationSuppress findings
subscriptionGet subscription information
updateUpdate CLI components

Global options

You can use the following global options with any sl command.

For easy reuse in future analyses, you can store some command-related information as environment variables (we've provided the specific environment variable below). Note that the values for options set via environment variables override those set in a configuration file (which, in turn, are overridden by those specified via command-line flags).

OptionEnvironment variableDescription
--diagnosticSHIFTLEFT_DIAGNOSTICAllows the submission of diagnostic data to Qwiet
--help, -hList CLI commands and accepted options
--no-auto-updateSHIFTLEFT_NO_AUTO_UPDATE=trueDisables automatic updating of the CLI
--no-diagnosticSHIFTLEFT_NO_DIAGNOSTIC=trueDisables the submission of diagnostic data; this is the default setting
--sl-home <path>SHIFTLEFT_HOME=<path>The Qwiet home path for general config and artifacts. Defaults to $HOME/.shiftleft when $HOME exists, and to /etc/shiftleft if $HOME does not exist
--updates-download-timeout <timeout>SHIFTLEFT_UPDATES_DOWNLOAD_TIMEOUT=<timeout>Timeout (e.g. '15m') userd when downloading updates; if this isn't set, the CLI applies no timeouts
--updates-read-timeout <timeout>SHIFTLEFT_UPDATES_READ_TIMEOUT=<timeout>Idle timeout (e.g. '30s') used when downloading data updates; if this isn't set, the CLI applies no timeouts. Default: 3 minutes (3m0s)
--verboseSHIFTLEFT_VERBOSE=trueVerbose mode
--version, -vDisplays the Qwiet CLI version
https_proxy=<proxy>Proxy configuration
--strictSHIFTLEFT_STRICT=trueTreat failures (including a timeout) as errors and exit with an error code accordingly

Response codes

The sl command returns exit code 0 unless:

  • check-analysis determines that a build rule fails;
  • There are issues with the configuration file (e.g., invalid configuration, corrupted file);
  • There is an error of any type (e.g., missing access token, missing artifact), and the user passes in the --strict flag.

If any of the above conditions exist, sl exits and returns error code 1.