Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.

Commit 63acade

Browse files
committed
Add vulns commands to the main readme
1 parent 5ab9123 commit 63acade

File tree

1 file changed

+30
-3
lines changed

1 file changed

+30
-3
lines changed

README.md

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ git pkgs history rails # track a specific package
4545
git pkgs why rails # why was this added?
4646
git pkgs diff --from=HEAD~10 # what changed recently?
4747
git pkgs diff --from=main --to=feature # compare branches
48+
git pkgs vulns # scan for known CVEs
49+
git pkgs vulns blame # who introduced each vulnerability
4850
```
4951

5052
## Commands
@@ -261,15 +263,40 @@ Shows dependencies sorted by how long since they were last changed in your repo.
261263

262264
### Vulnerability scanning
263265

266+
Scan dependencies for known CVEs using the [OSV database](https://osv.dev). Because git-pkgs tracks the full history of every dependency change, it provides context that static scanners can't: who introduced a vulnerability, when it was fixed, and how long you were exposed.
267+
264268
```bash
265-
git pkgs vulns # scan current dependencies for known CVEs
269+
git pkgs vulns # scan current dependencies
270+
git pkgs vulns v1.0.0 # scan at a tag, branch, or commit
266271
git pkgs vulns -s high # only critical and high severity
272+
git pkgs vulns -e npm # filter by ecosystem
273+
git pkgs vulns -f sarif # output for GitHub code scanning
274+
```
275+
276+
Subcommands for historical analysis:
277+
278+
```bash
267279
git pkgs vulns blame # who introduced each vulnerability
280+
git pkgs vulns blame --all-time # include fixed vulnerabilities
268281
git pkgs vulns praise # who fixed vulnerabilities
269-
git pkgs vulns exposure --all-time --summary # remediation metrics
282+
git pkgs vulns praise --summary # author leaderboard
283+
git pkgs vulns exposure # remediation metrics (CRA compliance)
284+
git pkgs vulns diff main feature # compare vulnerability state between refs
285+
git pkgs vulns log # commits that introduced or fixed vulns
286+
git pkgs vulns history lodash # vulnerability timeline for a package
287+
git pkgs vulns show CVE-2024-1234 # details about a specific CVE
288+
```
289+
290+
Output formats: `text` (default), `json`, and `sarif`. SARIF integrates with GitHub Advanced Security:
291+
292+
```yaml
293+
- run: git pkgs vulns --stateless -f sarif > results.sarif
294+
- uses: github/codeql-action/upload-sarif@v3
295+
with:
296+
sarif_file: results.sarif
270297
```
271298
272-
Uses the [OSV database](https://osv.dev) to check your dependencies against known security advisories. Because git-pkgs tracks the full history, it can show who introduced and fixed each vulnerability. See [docs/vulns.md](docs/vulns.md) for full documentation.
299+
Vulnerability data is cached locally and refreshed automatically when stale (>24h). Use `git pkgs vulns sync --refresh` to force an update. See [docs/vulns.md](docs/vulns.md) for full documentation.
273300

274301
### Diff between commits
275302

0 commit comments

Comments
 (0)