Available Commands and Inputs
The available commands and options within Safety CLI Scanner are detailed below. These can also be found within Safety CLI by typing safety --help
or safety [command] --help
.
Authentication
safety auth --help | Command/Option | Description |
---|---|---|
Commands |
| Authenticate with Safety CLI to perform scans. Your default browser will automatically open to https://platform.safetycli.com unless already authenticated.
Example: |
| Log out from the current Safety CLI session.
Example: | |
| Show the current authentication status.
Example: | |
Options |
| Install shell-specific completion scripts.
Example: |
| Show shell completion scripts for manual setup.
Example: | |
| Show detailed help information for commands and options.
Example: |
Commands
safety --help | Command/Option | Description |
---|---|---|
Commands |
| Authenticate Safety CLI to perform scans. Your default browser will automatically open to https://platform.safetycli.com.
Example: |
| Run vulnerability scans on a Python project directory.
Example: | |
| Run a comprehensive scan for packages and vulnerabilities across your entire machine/environment.
Example: | |
Other Commands |
| [Deprecated] Create GitHub Pull Requests from scan results. Being replaced by newer features.
Example: |
| [Deprecated] Find vulnerabilities in target files/environments. Now replaced by safety scan.
Example: | |
| Check for updates to the Safety CLI.
Example: | |
| Set up global configurations for Safety CLI, including proxy settings and organization details.
Example: | |
| Generate a standard Safety CLI policy file to establish baseline policies for scans.
Example: | |
| Check if your local Safety CLI policy file is valid.
Example: | |
Options |
| Assign a development lifecycle stage to your scan (default: development).
Example: |
| Use an API key for scans in CI/CD or Production (default: none).
For Development scans, unset the API key and authenticate using safety auth.
Example: | |
| Specify a proxy host for network communications.
Example: | |
| Set the proxy port (default: 80).
Note: proxy details can be set globally in a config file. See safety configure --help.
Example: | |
| Choose the proxy protocol (default: https).
Note: proxy details can be set globally in a config file. See safety configure --help.
Example: | |
| Opt-out of sending optional telemetry for privacy. Anonymized telemetry data will remain.
Example: | |
| Enable debug mode for detailed output in addition to standard output.
Example: | |
| Display the installed version of Safety CLI.
Example: | |
| Show detailed help information for commands and options.
Example: |
Safety Scan Options
safety scan --help | Command/Option | Description |
---|---|---|
Options |
| Define a specific project path for scanning.
Example: |
| Set the format for scan results (default: screen) using Screen, JSON, HTML, or SPDX.
Example: | |
--detailed-output | Enable a verbose scan report for detailed insights.
Example: | |
| Save scan results in different formats, including text, json, html, and spdx.
Example: | |
| Use a local policy file for scanning.
Example: | |
| Install command-line completion for easier use.
Example: | |
| Display shell completion scripts for customization.
Example: | |
| Automatically apply updates to requirements files for identified vulnerabilities in accordance with the parameters set in the config file.
Example: |
Environment Variables
Env Var | Default Value | Description |
---|---|---|
SAFETY_REQUEST_TIMEOUT | 30 seconds | Allows setting a custom request timeout for Safety CLI when pulling vulnerability and license JSON data from servers. If set, this value takes priority over the default hardcoded value. |
Last updated