Quick Start Guide
Last updated
Was this helpful?
Last updated
Was this helpful?
Running your first scan using Safety CLI takes less than a minute and can be performed via our or through the . Below we detail , , and .
To learn more about upgrading from Safety 2.x to Safety CLI please check out our .
Begin by installing Safety on your development machine.
Open your Terminal
Run the following command to install:
1. Once installed, try to run your first scan using the following command:
2. If you are already logged in, Safety will perform the scan. If you are not already authenticated, Safety CLI will prompt you to or using existing credentials.
In both cases, a browser window will open with clear instructions on how to log in or create a new account. Once logged in, Safety CLI will show that you are authenticated and can proceed with the next step.
Using the Terminal, navigate to a project, e.g. cd my/project/
. (This root folder would normally contain files such as composer.lock
, requirements.txt
, READMEs
, Pipfile.lock
, pyproject.toml
, .gitignores
etc.)
Run the safety scan
command.
Safety will now perform a scan of the current project directory, detecting all Python installations and requirements files. The output of the scan will be presented in the Terminal window.
For users who prefer a more interactive environment, we also provide a Jupyter Notebook Quickstart guide. This notebook offers step-by-step instructions for running Safety CLI within a Jupyter environment, making it easier to explore the functionality and perform your first scan in a familiar interface.
safety --help
accesses Help and displays all available commands, utility commands, and options.
safety auth
starts the authentication flow if not logged in and displays authentication status if logged in.
safety scan
performs a vulnerability scan in the current directory.
safety system-scan
performs a vulnerability scan across the entire development machine.
safety scan --apply-fixes
performs a scan and automatically updates vulnerable dependencies to the next secure version.
You will be unable to perform vulnerability scans unless you are authenticated. If you require assistance, please email .
You can access the quickstart notebook here: .
The following are the most commonly used commands. .
If you are unsure whether your organization uses either of these options, please contact your administrator or email .
The quickest way to test Safety CLI in CI/CD is by using our , new in Safety CLI 3. Full is available here:
If you require assistance, please email .