# keryn sbom

Describes Keryn 0.5.2 and keryn-rules 0.8.0.

> dependency SBOM: every locked package with purl, licence and graph, CycloneDX 1.6 or SPDX 2.3 (no rules, offline)

Source: https://keryn.dev/docs/reference/cli/sbom/

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

Dependency SBOM: every locked package with purl, licence and graph, CycloneDX 1.6 or SPDX 2.3 (no rules, offline).

```text
keryn sbom [path]
```

## Options

```text
Usage: keryn sbom [path] [--format cyclonedx|spdx] [-o <file>] [--subject <name>] [--revision <id>] [--timestamp <iso|now>] [--no-ignore] [-q]
  Lists the tree as keryn scan does (.gitignore honoured, .git and node_modules skipped), reads only the lockfiles and the
  package metadata that carries licences, and writes every locked package (purl, version, scope, direct, licence as an SPDX
  expression where one is declared, the lockfiles) and the dependency graph each lockfile records. CycloneDX 1.6 JSON by
  default, SPDX 2.3 JSON with --format spdx; stdout unless -o. The AI-BOM (keryn bom) lists AI components only.
  No rules run, no advisory is matched, nothing is sent. Lockfiles up to 64 MiB are read. A full keryn scan writes
  the same document as one of its outputs (keryn scan --help, Outputs).
  Exit 0 written; 3 no lockfile found, or a lockfile too large to read (the SBOM is written, but incomplete); 2 usage.
```

## Examples

```sh
# CycloneDX 1.6 SBOM of every locked dependency.
keryn sbom . -o sbom.cdx.json

# The same as SPDX 2.3.
keryn sbom . --format spdx -o sbom.spdx.json
```

## Exit codes

| Code | Meaning |
|---|---|
| 0 | written |
| 2 | usage error |
| 3 | no lockfile found, or a lockfile too large to read: the SBOM is incomplete |
