# 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

<table><thead><tr><th width="188.33333333333331">safety auth --help</th><th width="239">Command/Option</th><th>Description</th></tr></thead><tbody><tr><td>Commands</td><td><code>login</code></td><td>Authenticate with Safety CLI to perform scans. Your default browser will automatically open to <a href="https://platform.safetycli.com/">https://platform.safetycli.com</a> unless already authenticated.<br><strong>Example: <code>safety auth login</code></strong></td></tr><tr><td></td><td><code>logout</code></td><td>Log out from the current Safety CLI session.<br><strong>Example: <code>safety auth logout</code></strong></td></tr><tr><td></td><td><code>status</code></td><td>Show the current authentication status.<br><strong>Example: <code>safety auth status</code></strong></td></tr><tr><td>Options</td><td><code>--install-completion</code></td><td>Install shell-specific completion scripts.<br><strong>Example: <code>safety auth --install-completion fish</code></strong></td></tr><tr><td></td><td><code>--show-completion</code></td><td>Show shell completion scripts for manual setup.<br><strong>Example: <code>safety auth --show-completion fish</code></strong></td></tr><tr><td></td><td><code>--help</code></td><td>Show detailed help information for commands and options.<br><strong>Example: <code>safety auth --help</code></strong></td></tr></tbody></table>

## Commands

<table><thead><tr><th width="189.33333333333331">safety --help</th><th width="251">Command/Option</th><th>Description</th></tr></thead><tbody><tr><td>Commands</td><td><code>auth</code></td><td>Authenticate Safety CLI to perform scans. Your default browser will automatically open to <a href="https://platform.safetycli.com/">https://platform.safetycli.com</a>.<br><strong>Example: <code>safety auth login</code></strong></td></tr><tr><td></td><td><code>scan</code></td><td>Run vulnerability scans on a Python project directory.<br><strong>Example: <code>safety scan</code></strong></td></tr><tr><td></td><td><code>system-scan</code></td><td>Run a comprehensive scan for packages and vulnerabilities across your entire machine/environment.<br><strong>Example: <code>safety system-scan</code></strong></td></tr><tr><td>Other Commands</td><td><code>alert</code></td><td>[Deprecated] Create GitHub Pull Requests from scan results. Being replaced by newer features.<br><strong>Example: <code>safety alert</code></strong></td></tr><tr><td></td><td><code>check</code></td><td>[Deprecated] Find vulnerabilities in target files/environments. Now replaced by safety scan.<br><strong>Example: <code>safety check /path/to/requirements.txt</code></strong></td></tr><tr><td></td><td><code>check-updates</code></td><td>Check for updates to the Safety CLI.<br><strong>Example: <code>safety check-updates</code></strong></td></tr><tr><td></td><td><code>configure</code></td><td>Set up global configurations for Safety CLI, including proxy settings and organization details.<br><strong>Example: <code>safety configure --proxy-host 192.168.0.1</code></strong></td></tr><tr><td></td><td><code>generate</code></td><td>Generate a standard Safety CLI policy file to establish baseline policies for scans.<br><strong>Example: <code>safety generate policy_file</code></strong></td></tr><tr><td></td><td><code>validate</code></td><td>Check if your local Safety CLI policy file is valid.<br><strong>Example: <code>safety validate /path/to/policy.yml</code></strong></td></tr><tr><td>Options</td><td><code>--stage</code></td><td>Assign a development lifecycle stage to your scan (default: development).<br><strong>Example: <code>safety --stage production scan</code></strong></td></tr><tr><td></td><td><code>--key</code></td><td>Use an API key for scans in CI/CD or Production (default: none).<br>For Development scans, unset the API key and authenticate using safety auth.<br><strong>Example: <code>safety --key 'your_api_key' scan</code></strong></td></tr><tr><td></td><td><code>--proxy-host</code></td><td>Specify a proxy host for network communications.<br><strong>Example: <code>safety configure --proxy-host 'proxy.example.com'</code></strong></td></tr><tr><td></td><td><code>--proxy-port</code></td><td>Set the proxy port (default: 80).<br>Note: proxy details can be set globally in a config file. See safety configure --help.<br><strong>Example: <code>safety configure --proxy-port 8080</code></strong></td></tr><tr><td></td><td><code>--proxy-protocol</code></td><td>Choose the proxy protocol (default: https).<br>Note: proxy details can be set globally in a config file. See safety configure --help.<br><strong>Example: <code>safety configure --proxy-protocol https</code></strong></td></tr><tr><td></td><td><code>--disable-optional-telemetry-data</code></td><td>Opt-out of sending optional telemetry for privacy. Anonymized telemetry data will remain.<br><strong>Example: <code>safety --disable-optional-telemetry-data scan</code></strong></td></tr><tr><td></td><td><code>--debug</code></td><td>Enable debug mode for detailed output in addition to standard output.<br><strong>Example: <code>safety --debug scan</code></strong></td></tr><tr><td></td><td><code>--version</code></td><td>Display the installed version of Safety CLI.<br><strong>Example: <code>safety --version</code></strong></td></tr><tr><td></td><td><code>--help</code></td><td>Show detailed help information for commands and options.<br><strong>Example: <code>safety --help</code></strong></td></tr></tbody></table>

## Safety Scan Options

<table><thead><tr><th width="192.33333333333331">safety scan --help</th><th width="252">Command/Option</th><th>Description</th></tr></thead><tbody><tr><td>Options</td><td><code>--target</code></td><td>Define a specific project path for scanning.<br><strong>Example: <code>safety scan --target /path/to/project</code></strong></td></tr><tr><td></td><td><code>--output</code></td><td>Set the format for scan results (default: screen) using Screen, JSON, HTML, or SPDX.<br><strong>Example: <code>safety scan --output json</code></strong></td></tr><tr><td></td><td><strong>--detailed-output</strong></td><td>Enable a verbose scan report for detailed insights.<br><strong>Example: <code>safety scan --detailed-output</code></strong></td></tr><tr><td></td><td><code>--save-as</code></td><td>Save scan results in different formats, including text, json, html, and spdx.<br><strong>Example: <code>safety scan --save-as json results.json</code></strong></td></tr><tr><td></td><td><code>--policy-file</code></td><td>Use a local policy file for scanning.<br><strong>Example: <code>safety scan --policy-file /path/to/policy.yml</code></strong></td></tr><tr><td></td><td><code>--install-completion</code></td><td>Install command-line completion for easier use.<br><strong>Example: <code>safety --install-completion bash</code></strong></td></tr><tr><td></td><td><code>--show-completion</code></td><td>Display shell completion scripts for customization.<br><strong>Example: <code>safety --show-completion zsh</code></strong></td></tr><tr><td></td><td><code>--apply-fixes</code></td><td>Automatically apply updates to requirements files for identified vulnerabilities in accordance with the parameters set in the config file.<br><strong>Example: <code>safety scan --apply-fixes</code></strong></td></tr></tbody></table>

## 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. |
|                          |               |                                                                                                                                                                                           |
|                          |               |                                                                                                                                                                                           |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.safetycli.com/safety-docs/safety-cli/scanning-for-vulnerable-and-malicious-packages/available-commands-and-inputs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
