You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 22, 2026. It is now read-only.
- Introduced `git pkgs sbom` command to export dependencies as a Software Bill of Materials (SBOM).
- Supported output formats: CycloneDX (default) and SPDX, with options for JSON and XML.
- Enhanced dependency enrichment to include package URLs, versions, licenses, and integrity hashes.
- Updated documentation to reflect new SBOM command and its options.
- Modified package and version models to store supplier information and enrich from external API.
- Improved license enrichment logic to prioritize version-level licenses over package-level.
- Added tests for SBOM command, including various output formats and enrichment scenarios.
- Updated database schema to accommodate new supplier fields.
Copy file name to clipboardExpand all lines: docs/enrichment.md
+63-3Lines changed: 63 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
Most git-pkgs commands work entirely from your git history. Your manifests and lockfiles tell us which packages you depend on, who added them, and when. But some questions require data that isn't in your repository: what's the latest version available? what license does this package use? has a security vulnerability been disclosed?
4
4
5
-
The `outdated`and `licenses` commands fetch this external metadata from the [ecosyste.ms Packages API](https://packages.ecosyste.ms/), which aggregates data from npm, RubyGems, PyPI, and other registries. See also [vulns.md](vulns.md) for vulnerability scanning via OSV.
5
+
The `outdated`, `licenses`, and `sbom` commands fetch this external metadata from the [ecosyste.ms Packages API](https://packages.ecosyste.ms/), which aggregates data from npm, RubyGems, PyPI, and other registries. See also [vulns.md](vulns.md) for vulnerability scanning via OSV.
Copyleft licenses (flagged with `--copyleft` or `--permissive`):
153
153
GPL-2.0, GPL-3.0, LGPL-2.1, LGPL-3.0, AGPL-3.0, MPL-2.0 (and their variant identifiers)
154
154
155
+
## sbom
156
+
157
+
Export dependencies as a Software Bill of Materials (SBOM) in SPDX or CycloneDX format.
158
+
159
+
```
160
+
$ git pkgs sbom
161
+
{
162
+
"spdxVersion": "SPDX-2.3",
163
+
"name": "my-project",
164
+
"packages": [
165
+
{
166
+
"name": "lodash",
167
+
"versionInfo": "4.17.21",
168
+
"licenseConcluded": "MIT",
169
+
"externalRefs": [
170
+
{
171
+
"referenceType": "purl",
172
+
"referenceLocator": "pkg:npm/lodash@4.17.21"
173
+
}
174
+
]
175
+
}
176
+
]
177
+
}
178
+
```
179
+
180
+
### Options
181
+
182
+
```
183
+
-t, --type=TYPE SBOM type: cyclonedx (default) or spdx
184
+
-f, --format=FORMAT Output format: json (default) or xml
185
+
-n, --name=NAME Project name (default: repository directory name)
186
+
-e, --ecosystem=NAME Filter by ecosystem
187
+
-r, --ref=REF Git ref to export (default: HEAD)
188
+
--skip-enrichment Skip fetching license data from registries
189
+
--stateless Parse manifests directly without database
190
+
```
191
+
192
+
### Examples
193
+
194
+
CycloneDX format:
195
+
196
+
```
197
+
$ git pkgs sbom --type cyclonedx
198
+
```
199
+
200
+
XML output:
201
+
202
+
```
203
+
$ git pkgs sbom -f xml
204
+
```
205
+
206
+
Skip license enrichment for faster output:
207
+
208
+
```
209
+
$ git pkgs sbom --skip-enrichment
210
+
```
211
+
212
+
The SBOM includes package URLs (purls), versions, licenses (from registry lookup), and integrity hashes (from lockfiles when available).
213
+
155
214
## Data Source
156
215
157
-
Both commands fetch package metadata from [ecosyste.ms](https://packages.ecosyste.ms/), which aggregates data from npm, RubyGems, PyPI, Cargo, and other package registries.
216
+
These commands fetch package metadata from [ecosyste.ms](https://packages.ecosyste.ms/), which aggregates data from npm, RubyGems, PyPI, Cargo, and other package registries.
158
217
159
218
## Caching
160
219
@@ -169,11 +228,12 @@ The cache stores:
169
228
170
229
## Stateless Mode
171
230
172
-
Both commands support `--stateless` mode, which parses manifest files directly from git without requiring a database. This is useful in CI environments where you don't want to run `git pkgs init` first.
231
+
All three commands support `--stateless` mode, which parses manifest files directly from git without requiring a database. This is useful in CI environments where you don't want to run `git pkgs init` first.
173
232
174
233
```
175
234
$ git pkgs outdated --stateless
176
235
$ git pkgs licenses --stateless --permissive
236
+
$ git pkgs sbom --stateless
177
237
```
178
238
179
239
In stateless mode, package metadata is fetched fresh each time and cached only in memory for the duration of the command.
0 commit comments