How to install, configure and run a standalone Signal scan from the command line and view results in a SARIF report.
Contents
Prerequisites
- An API Key for the LLM that Signal will use.
- A Signal Enterprise or Developer subscription.
For more information about available Signal flags, see Signal Reference Guide.
Install the binary
Follow the steps to scan your code with Signal CLI standalone:
Configure the LLM connection
Signal requires an LLM endpoint URI and an API key. You can provide them using either of the following methods:
Option A: Provide the values directly on the CLI
signal --llm-uri https://llm.core.blackduck.com \
--llm-key YOUR_API_KEY \
srcTo avoid storing the key in your shell history, you can assign it to an environment variable:
Linux or macOS using Bash or Zsh
export MY_LLM_KEY=YOUR_API_KEY
signal --llm-uri https://llm.core.blackduck.com \
--llm-key "$MY_LLM_KEY" \
srcWindows PowerShell
$env:MY_LLM_KEY = "YOUR_API_KEY"
signal --llm-uri https://llm.core.blackduck.com `
--llm-key $env:MY_LLM_KEY `
srcOption B: Use a .signal configuration file
You can set the LLM key using the configuration file, but if the same setting appears in both the configuration file and the command line, the explicit CLI flag takes precedence.
For more details, see Signal config file.
Run a scan
After installing and configuring Signal, follow the steps to run a scan:
For per-agent model overrides, including
--llm-model-agent and --llm-model-sca, and for all other available flags, see the Signal Reference Guide.Review the results
To review the results, open
results.sarif file in a SARIF-compatible viewer. Some examples you could use are:- Visual Studio Code: Install the SARIF Viewer extension, and then open
results.sarif. - Visual Studio: Open the file with the Microsoft SARIF Viewer extension.
- GitHub code scanning: Upload the SARIF file through the code-scanning API or a GitHub Actions workflow.