# Sentry Prevent CLI

## [Installation](https://docs.sentry.io/product/test-analytics/sentry-prevent-cli.md#installation)

While the snippets below can be used to download and use the CLI directly, it is highly recommended to perform signature and SHASUM verification to ensure integrity of the CLI before use. See [Integrity Checking the Uploader](https://docs.sentry.io/product/test-analytics/sentry-prevent-cli.md#integrity-checking-the-cli) below for more information.

For `Python`, install the Sentry Prevent CLI using `pip install sentry-prevent-cli`. You need to have `Python3` as the default.

```bash
pip install sentry-prevent-cli
```

For `binary platforms`, use the following commands to download the latest version of the Sentry Prevent CLI.

```bash
curl -L https://github.com/getsentry/prevent-cli/releases/latest/download/sentry-prevent-cli-macos -o sentry-prevent-cli_macos
chmod +x sentry-prevent-cli_macos
```

## [Uploading Test Results](https://docs.sentry.io/product/test-analytics/sentry-prevent-cli.md#uploading-test-results)

To upload test results, use the following command:

```bash
sentry-prevent-cli upload --report-type test-results --token <PREVENT_TOKEN>
```

## [Integrity Checking the CLI](https://docs.sentry.io/product/test-analytics/sentry-prevent-cli.md#integrity-checking-the-cli)

GitHub releases also includes the SHA for each asset. You can run

```bash
shasum -a 256 <filename>
```

or

```bash
sha256sum <filename>
```

and compare the checksum generated with that from GitHub releases.
