# keryn sca collect

Describes Keryn 0.5.2 and keryn-rules 0.8.0.

> keryn sca collect: OSV-Scanner execution, SCA report intake with completion receipts, complete-package inventory, offline advisory assessment, Deno inventory, SBOM-to-files comparison

Source: https://keryn.dev/docs/reference/cli/sca-collect/

> **Caution: Next release: keryn sca collect**
> On main; not in Keryn 0.5.2, the latest release.

OSV-Scanner execution, SCA report intake with completion receipts, complete-package inventory, offline advisory assessment, Deno inventory, SBOM-to-files comparison.

```text
keryn sca collect <target> --out <new-directory> [--context <deployment.json>|--bindings <bindings.json>] [--snapshot <snapshot.json>] [--online]
```

## Options

```text
keryn sca collect <target> --out <new-directory> [--bindings <JSON> | --context <deployment-JSON>] [--snapshot <JSON>] [--as-of <UTC ISO>] [--online] [--executable <path>] [--timeout <seconds>] [--json]
```

## Examples

```sh
# Collect every OSV package and advisory in one offline invocation.
keryn sca collect . --out out/sca
```

## Exit codes

| Code | Meaning |
|---|---|
| 0 | pass |
| 1 | findings or a requested change gate |
| 2 | usage error or invalid input |
| 3 | incomplete or unknown completion |
| 4 | execution or normalization failure |

## Environment

| Variable | Meaning | Default |
|---|---|---|
| `GITHUB_TOKEN` | Token for keryn decide export --github. There is no flag for it. | unset |
| `GITLAB_TOKEN` | Token for keryn decide export --gitlab. There is no flag for it. | unset |
