@vibgrate/cli 2026.709.1 → 2026.710.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/DOCS.md CHANGED
@@ -11,35 +11,44 @@ For a quick overview, see the [README](./README.md). This document covers everyt
11
11
  - [How It Works](#how-it-works)
12
12
  - [Choosing a rollout model: one-off vs CI](#choosing-a-rollout-model-one-off-vs-ci)
13
13
  - [Commands Reference](#commands-reference)
14
- - [vg init](#vg-init)
15
- - [vg scan](#vg-scan)
16
- - [Vulnerabilities and exposure attribution](#vulnerabilities-and-exposure-attribution)
17
- - [vg why](#vg-why)
14
+ - [vg baseline](#vg-baseline)
18
15
  - [vg bisect](#vg-bisect)
16
+ - [vg drift](#vg-drift)
17
+ - [vg dsn create](#vg-dsn-create)
19
18
  - [vg fix](#vg-fix)
20
- - [vg baseline](#vg-baseline)
19
+ - [vg init](#vg-init)
20
+ - [vg login](#vg-login)
21
+ - [vg logout](#vg-logout)
22
+ - [vg push](#vg-push)
21
23
  - [vg report](#vg-report)
22
24
  - [vg sbom](#vg-sbom)
23
- - [vg push](#vg-push)
24
- - [vg dsn create](#vg-dsn-create)
25
+ - [vg scan](#vg-scan)
26
+ - [Vulnerabilities and exposure attribution](#vulnerabilities-and-exposure-attribution)
25
27
  - [vg update](#vg-update)
28
+ - [vg why](#vg-why)
26
29
  - [Code Graph Commands](#code-graph-commands)
27
- - [vg build](#vg-build)
28
- - [vg show](#vg-show)
29
30
  - [vg ask](#vg-ask)
31
+ - [vg benchmark](#vg-benchmark)
32
+ - [vg build](#vg-build)
33
+ - [vg bundle](#vg-bundle)
34
+ - [vg embed](#vg-embed)
35
+ - [vg export](#vg-export)
36
+ - [vg facts](#vg-facts)
37
+ - [vg guide](#vg-guide)
30
38
  - [vg impact](#vg-impact)
31
- - [vg path](#vg-path)
32
- - [vg tree](#vg-tree)
33
- - [vg map / vg hubs / vg areas / vg oddities](#vg-map--vg-hubs--vg-areas--vg-oddities)
39
+ - [vg install](#vg-install)
34
40
  - [vg lib](#vg-lib)
41
+ - [vg map / vg hubs / vg areas / vg oddities](#vg-map--vg-hubs--vg-areas--vg-oddities)
42
+ - [vg models](#vg-models)
43
+ - [vg path](#vg-path)
44
+ - [vg savings](#vg-savings)
35
45
  - [vg serve](#vg-serve)
36
- - [vg install](#vg-install)
37
46
  - [vg share](#vg-share)
47
+ - [vg show](#vg-show)
38
48
  - [vg status](#vg-status)
39
- - [vg facts](#vg-facts)
40
49
  - [vg tests](#vg-tests)
41
- - [vg embed](#vg-embed)
42
- - [vg export](#vg-export)
50
+ - [vg tree](#vg-tree)
51
+ - [vg unknowns](#vg-unknowns)
43
52
  - [DriftScore](#driftscore)
44
53
  - [Drift Baselines & Fitness Functions](#drift-baselines--fitness-functions)
45
54
  - [How the Score Is Calculated](#how-the-score-is-calculated)
@@ -160,138 +169,76 @@ Expected results:
160
169
 
161
170
  ## Commands Reference
162
171
 
163
- ### vg init
172
+ ### vg baseline
164
173
 
165
- Initialise Vibgrate in a project.
174
+ Create a drift baseline snapshot for delta comparison.
166
175
 
167
176
  ```bash
168
- vg init [path] [--baseline] [--yes]
177
+ vg baseline [path]
169
178
  ```
170
179
 
171
- | Flag | Description |
172
- | ------------ | ------------------------------------------- |
173
- | `--baseline` | Create an initial drift baseline after init |
174
- | `--yes` | Skip confirmation prompts |
175
-
176
- Creates:
177
-
178
- - `.vibgrate/` directory
179
- - `vibgrate.config.ts` with sensible defaults
180
+ Runs a full scan and saves the result to `.vibgrate/baseline.json`. Use this as the starting point for tracking drift over time.
180
181
 
181
182
  ---
182
183
 
183
- ### vg scan
184
+ ### vg bisect
184
185
 
185
- The primary command. Scans your project for upgrade drift.
186
+ Pinpoint the commit where a dependency crossed a version line. Where `vg why` narrates every version change, `vg bisect` answers one targeted question: *when did we cross this line?* — for example, when a vulnerable dependency was finally patched past the fixed version, or when a major was adopted.
186
187
 
187
188
  ```bash
188
- vg scan [path] [--vulns] [--full] [--format text|json|sarif|md] [--out <file>] [--fail-on warn|error] [--offline] [--package-manifest <file>] [--no-local-artifacts] [--max-privacy] [--baseline <file>] [--drift-budget <score>] [--drift-worsening <percent>] [--changed-only] [--concurrency <n>]
189
+ vg bisect <package> <constraint>
189
190
  ```
190
191
 
191
- | Flag | Default | Description |
192
- |------|---------|-------------|
193
- | `--vulns` | — | Also detect known vulnerabilities (OSV online; offline via `--package-manifest` advisories) |
194
- | `--full` | — | Comprehensive scan: enables `--vulns` and reports banned dependencies when a standards policy exists |
195
- | `--format` | `text` | Output format: `text`, `json`, `sarif`, or `md` |
196
- | `--out <file>` | — | Write output to a file |
197
- | `--fail-on <level>` | — | Exit with code 2 if findings at this level exist |
198
- | `--baseline <file>` | — | Compare against a previous baseline |
199
- | `--changed-only` | — | Only scan changed files |
200
- | `--concurrency <n>` | `8` | Max concurrent npm registry calls |
201
- | `--drift-budget <score>` | — | Fitness gate: fail if drift score is above this budget |
202
- | `--drift-worsening <percent>` | — | Fitness gate: fail if drift worsens by more than % vs baseline |
203
- | `--push` | — | Upload scan artifact to Vibgrate Cloud after a successful scan |
204
- | `--dsn <dsn>` | `VIBGRATE_DSN` env | DSN used for `--push` authentication |
205
- | `--region <region>` | — | Override data residency (`us`, `eu`) during push |
206
- | `--strict` | — | Fail scan command if push fails |
207
- | `--ui-purpose` | — | Enable optional UI-purpose evidence extraction |
208
- | `--offline` | — | Disable network calls and disable upload/push behavior |
209
- | `--package-manifest <file>` | — | JSON or ZIP package-version manifest used for offline/latest lookups (latest bundle: `https://github.com/vibgrate/manifests/latest-packages.zip`) |
210
- | `--no-local-artifacts` | — | Do not write `.vibgrate/*.json` scan artifacts to disk |
211
- | `--max-privacy` | — | Hardened privacy mode with minimal scanners and no local artifacts |
212
-
213
- By default, the scan writes `.vibgrate/scan_result.json`. Use `--no-local-artifacts` or `--max-privacy` to suppress local JSON artifact files.
192
+ `<constraint>` is a version or a semver range. A bare version means "reached or surpassed" — `vg bisect lodash 4.17.21` is the same as `vg bisect lodash '>=4.17.21'`. It reads the same lockfile history `vg why` uses (npm / pnpm / yarn, pip / poetry, cargo, composer, bundler, go, pub, hex, NuGet, and Maven/Gradle), offline and without checking out any commit.
214
193
 
215
- For offline drift scoring, pass `--package-manifest <file>` with a downloaded manifest bundle such as `https://github.com/vibgrate/manifests/latest-packages.zip`.
194
+ It reports the commit that first reached the constraint — author, date, and the version before and after or tells you the line was never crossed and shows the latest version in history (so an unadopted fix is obvious). Later flips, such as a downgrade that re-introduced the old version, are listed too.
216
195
 
217
- Examples:
196
+ Add `--assert` to turn it into a CI gate: the command exits non-zero when the current version does not satisfy the constraint, so a pipeline step can block a merge until the fix is adopted.
218
197
 
219
198
  ```bash
220
- # Standard text scan
221
- vg scan
222
-
223
- # JSON output for automation
224
- vg scan --format json --out scan.json
225
-
226
- # CI gate with baseline regression protection
227
- vg scan --baseline .vibgrate/baseline.json --drift-budget 40 --drift-worsening 5 --fail-on error
228
-
229
- # Upload result in the same command
230
- vg scan --push --strict
199
+ vg bisect lodash 4.17.21 --assert # fails the build until lodash is patched to >= 4.17.21
231
200
  ```
232
201
 
233
- Expected results:
234
-
235
- - Clear score/risk output in terminal (or JSON/SARIF when selected).
236
- - Exit code `2` when configured quality gates are exceeded.
237
- - When `--push` is enabled, artifact upload is attempted after scan completion.
202
+ Exit codes: `0` when the query resolves, `2` when `--assert` finds the constraint unsatisfied, `3` when the package has no version history, `5` for an invalid version or range.
238
203
 
239
204
  ---
240
205
 
241
- ### Vulnerabilities and exposure attribution
242
-
243
- `vg scan --vulns` matches your installed dependencies against the public OSV database and records each known vulnerability — advisory id and CVE, severity, CVSS, and the fixing version — in the scan artifact, as findings, and in SARIF. Supply advisories in a `--package-manifest` bundle to run it offline.
244
-
245
- In a git repository the scan also attributes each finding: the commit, author, and date that introduced the vulnerable version, and how long you have been exposed. These exposure windows aggregate into remediation metrics framed around the EU Cyber Resilience Act (CRA): open counts by severity, mean and maximum time exposed, and per-severity SLA breaches (defaults: critical 7 days, high 30, moderate 90, low 180). The metrics are descriptive — they show whether remediation keeps pace; they are not a compliance certification.
246
-
247
- The scan also reconstructs **closed** exposure windows from history — a vulnerable version that was later bumped out of the affected range or removed from the lockfile entirely — and reports real remediation time (MTTR) from them: measured, not estimated. Offline, a package-version manifest extends this to advisories that are fully fixed today, so a dependency that is clean now but was once vulnerable still counts toward your remediation record.
206
+ ### vg drift
248
207
 
249
- Detection and attribution read each project's lockfile, so they cover npm / pnpm / yarn, pip / poetry / pipenv, cargo, composer, bundler, go, pub, hex, NuGet, and Maven/Gradle.
208
+ What is outdated across your dependencies a fast, offline currency check.
250
209
 
251
210
  ```bash
252
- # Online detection against OSV
253
- vg scan --vulns
254
-
255
- # Air-gapped: advisories supplied in the manifest bundle
256
- vg scan --vulns --offline --package-manifest ./package-versions.zip
257
-
258
- # Everything in one run: drift + vulnerabilities + a banned-dependency report
259
- vg scan --full
211
+ vg drift
260
212
  ```
261
213
 
262
- ---
263
-
264
- ### vg why
265
-
266
- Explain a dependency from git history: who added it, every version since, and any open vulnerabilities it carries.
214
+ Reads each project's lockfile and reports which dependencies have drifted behind their latest known version. Offline by default (uses the last-known catalog); add `--online` to check live registries for current latest versions.
267
215
 
268
- ```bash
269
- vg why <package>
270
- ```
216
+ | Flag | Description |
217
+ |------|-------------|
218
+ | `--online` | Check live registries for the latest versions instead of the offline catalog |
219
+ | `--fail-on <level>` | CI gate: exit non-zero when drift is found at this level (`major`, `minor`, or `standards`) |
271
220
 
272
- `vg why` reads your lockfile's history, so it works across npm / pnpm / yarn, pip / poetry, cargo, composer, bundler, go, pub, hex, NuGet, and Maven/Gradle projects. For Maven/Gradle the history comes from a resolved `gradle.lockfile`, or a `pom.xml`'s pinned direct-dependency versions (versions managed by a BOM/`dependencyManagement` aren't resolved). Open vulnerabilities and their introduction attribution come from your most recent `vg scan --vulns`.
221
+ Add `--json` for machine-readable output.
273
222
 
274
223
  ---
275
224
 
276
- ### vg bisect
225
+ ### vg dsn create
277
226
 
278
- Pinpoint the commit where a dependency crossed a version line. Where `vg why` narrates every version change, `vg bisect` answers one targeted question: *when did we cross this line?* — for example, when a vulnerable dependency was finally patched past the fixed version, or when a major was adopted.
227
+ Generate an HMAC-signed DSN token for API authentication.
279
228
 
280
229
  ```bash
281
- vg bisect <package> <constraint>
230
+ vg dsn create --workspace <id|new> [--region <region>] [--ingest <url>] [--write <path>]
282
231
  ```
283
232
 
284
- `<constraint>` is a version or a semver range. A bare version means "reached or surpassed" — `vg bisect lodash 4.17.21` is the same as `vg bisect lodash '>=4.17.21'`. It reads the same lockfile history `vg why` uses (npm / pnpm / yarn, pip / poetry, cargo, composer, bundler, go, pub, hex, NuGet, and Maven/Gradle), offline and without checking out any commit.
285
-
286
- It reports the commit that first reached the constraint — author, date, and the version before and after — or tells you the line was never crossed and shows the latest version in history (so an unadopted fix is obvious). Later flips, such as a downgrade that re-introduced the old version, are listed too.
287
-
288
- Add `--assert` to turn it into a CI gate: the command exits non-zero when the current version does not satisfy the constraint, so a pipeline step can block a merge until the fix is adopted.
289
-
290
- ```bash
291
- vg bisect lodash 4.17.21 --assert # fails the build until lodash is patched to >= 4.17.21
292
- ```
233
+ | Flag | Default | Description |
234
+ | ------------- | ---------- | --------------------------------------------------------------------------- |
235
+ | `--workspace` | _required_ | Your workspace ID, or `new` to auto-generate a workspace |
236
+ | `--region` | `us` | Data residency region (`us`, `eu`) |
237
+ | `--ingest` | — | Custom ingest API URL (overrides `--region`) |
238
+ | `--write` | — | Write DSN to a file (add to `.gitignore`!) |
293
239
 
294
- Exit codes: `0` when the query resolves, `2` when `--assert` finds the constraint unsatisfied, `3` when the package has no version history, `5` for an invalid version or range.
240
+ When using `--workspace new`, the CLI auto-generates a workspace ID and provisions the DSN
241
+ with the Vibgrate API. Rate limited to 1 new DSN per 5 minutes per IP address.
295
242
 
296
243
  ---
297
244
 
@@ -380,53 +327,50 @@ advisory at or above the threshold or an apply step fails.
380
327
 
381
328
  ---
382
329
 
383
- ### vg baseline
330
+ ### vg init
384
331
 
385
- Create a drift baseline snapshot for delta comparison.
332
+ Initialise Vibgrate in a project.
386
333
 
387
334
  ```bash
388
- vg baseline [path]
335
+ vg init [path] [--baseline] [--yes]
389
336
  ```
390
337
 
391
- Runs a full scan and saves the result to `.vibgrate/baseline.json`. Use this as the starting point for tracking drift over time.
338
+ | Flag | Description |
339
+ | ------------ | ------------------------------------------- |
340
+ | `--baseline` | Create an initial drift baseline after init |
341
+ | `--yes` | Skip confirmation prompts |
342
+
343
+ Creates:
344
+
345
+ - `.vibgrate/` directory
346
+ - `vibgrate.config.ts` with sensible defaults
392
347
 
393
348
  ---
394
349
 
395
- ### vg report
350
+ ### vg login
396
351
 
397
- Generate a human-readable report from a scan artifact.
352
+ Authenticate the CLI with your Vibgrate workspace through the browser. Credentials are stored locally so `vg fix` and `vg push` can reach the hosted planner and Vibgrate Cloud.
398
353
 
399
354
  ```bash
400
- vg report [--in <file>] [--format md|text|json]
355
+ vg login
401
356
  ```
402
357
 
403
- | Flag | Default | Description |
404
- | ---------- | ---------------------------- | -------------------------------------- |
405
- | `--in` | `.vibgrate/scan_result.json` | Input artifact file |
406
- | `--format` | `text` | Output format: `md`, `text`, or `json` |
358
+ | Flag | Default | Description |
359
+ |------|---------|-------------|
360
+ | `--region <region>` | `us` | Data-residency region (`us`, `eu`) |
361
+ | `--ingest <url>` | | Custom ingest API URL (overrides `--region`) |
362
+ | `--no-browser` | — | Print the URL to open instead of launching a browser (headless / SSH) |
407
363
 
408
364
  ---
409
365
 
410
- ### vg sbom
366
+ ### vg logout
411
367
 
412
- Export SBOMs from an existing scan artifact or compare two artifacts.
368
+ Clear stored Vibgrate login credentials from this machine.
413
369
 
414
370
  ```bash
415
- vg sbom export [--in <file>] [--format cyclonedx|spdx] [--out <file>]
416
- vg sbom delta --from <file> --to <file> [--out <file>]
417
- vg sbom vex [--from <file>] [--statement <json>...] [--product <ref>] [--out <file>]
371
+ vg logout
418
372
  ```
419
373
 
420
- | Command | Description |
421
- |---------|-------------|
422
- | `vg sbom export` | Emit CycloneDX or SPDX JSON from a scan artifact |
423
- | `vg sbom delta` | Compare dependencies between two artifacts (added/removed/changed + drift delta) |
424
- | `vg sbom vex` | Emit a spec-compliant OpenVEX document (exploitability statements) for attestation |
425
-
426
- Use this to treat SBOMs as operational intelligence instead of static compliance output.
427
-
428
- `vg sbom vex` is input-agnostic: it assembles a complete OpenVEX document from the statements you supply (`--from <file>` and/or repeatable `--statement`), so it works regardless of which scanner flagged the components. A zero-statement document is valid and honest — it asserts no known affected components.
429
-
430
374
  ---
431
375
 
432
376
  ### vg push
@@ -448,103 +392,167 @@ Upload is always optional. Best-effort by default — use `--strict` in CI if yo
448
392
 
449
393
  ---
450
394
 
451
- ### vg dsn create
395
+ ### vg report
452
396
 
453
- Generate an HMAC-signed DSN token for API authentication.
397
+ Generate a human-readable report from a scan artifact.
454
398
 
455
399
  ```bash
456
- vg dsn create --workspace <id|new> [--region <region>] [--ingest <url>] [--write <path>]
400
+ vg report [--in <file>] [--format md|text|json]
457
401
  ```
458
402
 
459
- | Flag | Default | Description |
460
- | ------------- | ---------- | --------------------------------------------------------------------------- |
461
- | `--workspace` | _required_ | Your workspace ID, or `new` to auto-generate a workspace |
462
- | `--region` | `us` | Data residency region (`us`, `eu`) |
463
- | `--ingest` | — | Custom ingest API URL (overrides `--region`) |
464
- | `--write` | — | Write DSN to a file (add to `.gitignore`!) |
465
-
466
- When using `--workspace new`, the CLI auto-generates a workspace ID and provisions the DSN
467
- with the Vibgrate API. Rate limited to 1 new DSN per 5 minutes per IP address.
403
+ | Flag | Default | Description |
404
+ | ---------- | ---------------------------- | -------------------------------------- |
405
+ | `--in` | `.vibgrate/scan_result.json` | Input artifact file |
406
+ | `--format` | `text` | Output format: `md`, `text`, or `json` |
468
407
 
469
408
  ---
470
409
 
471
- ### vg update
410
+ ### vg sbom
472
411
 
473
- Check for and install updates.
412
+ Export SBOMs from an existing scan artifact or compare two artifacts.
474
413
 
475
414
  ```bash
476
- vg update [--check] [--pm <manager>]
415
+ vg sbom export [--in <file>] [--format cyclonedx|spdx] [--out <file>]
416
+ vg sbom delta --from <file> --to <file> [--out <file>]
417
+ vg sbom vex [--from <file>] [--statement <json>...] [--product <ref>] [--out <file>]
477
418
  ```
478
419
 
479
- | Flag | Description |
480
- | --------- | ------------------------------------------------------ |
481
- | `--check` | Only check for updates, don't install |
482
- | `--pm` | Force a package manager (`npm`, `pnpm`, `yarn`, `bun`) |
483
-
484
- ---
485
-
486
- ---
487
-
488
- ## Code Graph Commands
489
-
490
- Vibgrate includes a full code graph engine — call trees, impact surfaces, semantic search, and AI Context serving. All graph commands read from (or write to) a local graph artifact at `.vibgrate/graph.json`. Build the map once with `vg build`, then query it offline indefinitely.
420
+ | Command | Description |
421
+ |---------|-------------|
422
+ | `vg sbom export` | Emit CycloneDX or SPDX JSON from a scan artifact |
423
+ | `vg sbom delta` | Compare dependencies between two artifacts (added/removed/changed + drift delta) |
424
+ | `vg sbom vex` | Emit a spec-compliant OpenVEX document (exploitability statements) for attestation |
491
425
 
492
- **Global options available on every graph command:**
426
+ Use this to treat SBOMs as operational intelligence instead of static compliance output.
493
427
 
494
- | Flag | Description |
495
- |------|-------------|
496
- | `--cwd <dir>` | Working directory (default: current) |
497
- | `--graph <file>` | Path to graph file (default: `.vibgrate/graph.json`) |
498
- | `--json` | Machine-readable JSON output |
499
- | `--quiet` | Suppress non-error output |
500
- | `--local` | Offline mode — no network calls or downloads |
501
- | `--client <name>` | Identify the AI client (e.g. `claude`) so navigation calls are counted in `vg savings` |
502
- | `--deep` | Enable deep derivation (for `vg facts`, `vg build`) |
503
- | `--no-cache` | Skip and clear cached data |
428
+ `vg sbom vex` is input-agnostic: it assembles a complete OpenVEX document from the statements you supply (`--from <file>` and/or repeatable `--statement`), so it works regardless of which scanner flagged the components. A zero-statement document is valid and honest — it asserts no known affected components.
504
429
 
505
430
  ---
506
431
 
507
- ### vg build
432
+ ### vg scan
508
433
 
509
- Build or update the code map incrementally.
434
+ The primary command. Scans your project for upgrade drift.
510
435
 
511
436
  ```bash
512
- vg build [paths...]
437
+ vg scan [path] [--vulns] [--full] [--format text|json|sarif|md] [--out <file>] [--fail-on warn|error] [--offline] [--package-manifest <file>] [--no-local-artifacts] [--max-privacy] [--baseline <file>] [--drift-budget <score>] [--drift-worsening <percent>] [--changed-only] [--concurrency <n>]
513
438
  ```
514
439
 
515
- Maps source code into a graph artifact, enabling all downstream queries (`vg show`, `vg ask`, `vg impact`, etc.).
516
-
517
440
  | Flag | Default | Description |
518
441
  |------|---------|-------------|
519
- | `[paths...]` | `.` | Folders or files to map |
520
- | `--only <langs>` | — | Restrict to languages (e.g. `ts,py,go`) |
521
- | `--exclude <glob>` | | Extra ignore glob (repeatable) |
522
- | `--jobs <n>` | auto | Worker count (`1` = single-threaded) |
523
- | `--scip <file>` | auto-detect | Ingest a SCIP index for precise resolution |
524
- | `--no-scip` | — | Ignore any SCIP index |
525
- | `--no-tsc` | — | Skip the TypeScript resolver (heuristic floor only) |
526
- | `--no-html` | | Do not write `graph.html` |
527
- | `--no-report` | — | Do not write `GRAPH_REPORT.md` |
528
- | `--no-warm` | — | Do not warm the semantic index after building |
529
- | `--grammars <dir>` | — | Grammar `.wasm` directory for offline/air-gapped use |
530
- | `-o, --export <file>` | | Also write the map to a file (format from extension) |
442
+ | `--vulns` | | Also detect known vulnerabilities (OSV online; offline via `--package-manifest` advisories) |
443
+ | `--full` | — | Comprehensive scan: enables `--vulns` and reports banned dependencies when a standards policy exists |
444
+ | `--format` | `text` | Output format: `text`, `json`, `sarif`, or `md` |
445
+ | `--out <file>` | | Write output to a file |
446
+ | `--fail-on <level>` | | Exit with code 2 if findings at this level exist |
447
+ | `--baseline <file>` | — | Compare against a previous baseline |
448
+ | `--changed-only` | — | Only scan changed files |
449
+ | `--concurrency <n>` | `8` | Max concurrent npm registry calls |
450
+ | `--drift-budget <score>` | — | Fitness gate: fail if drift score is above this budget |
451
+ | `--drift-worsening <percent>` | — | Fitness gate: fail if drift worsens by more than % vs baseline |
452
+ | `--push` | — | Upload scan artifact to Vibgrate Cloud after a successful scan |
453
+ | `--dsn <dsn>` | `VIBGRATE_DSN` env | DSN used for `--push` authentication |
454
+ | `--region <region>` | — | Override data residency (`us`, `eu`) during push |
455
+ | `--strict` | — | Fail scan command if push fails |
456
+ | `--ui-purpose` | — | Enable optional UI-purpose evidence extraction |
457
+ | `--offline` | — | Disable network calls and disable upload/push behavior |
458
+ | `--package-manifest <file>` | — | JSON or ZIP package-version manifest used for offline/latest lookups (latest bundle: `https://github.com/vibgrate/manifests/latest-packages.zip`) |
459
+ | `--no-local-artifacts` | — | Do not write `.vibgrate/*.json` scan artifacts to disk |
460
+ | `--max-privacy` | — | Hardened privacy mode with minimal scanners and no local artifacts |
461
+
462
+ By default, the scan writes `.vibgrate/scan_result.json`. Use `--no-local-artifacts` or `--max-privacy` to suppress local JSON artifact files.
463
+
464
+ For offline drift scoring, pass `--package-manifest <file>` with a downloaded manifest bundle such as `https://github.com/vibgrate/manifests/latest-packages.zip`.
465
+
466
+ Examples:
467
+
468
+ ```bash
469
+ # Standard text scan
470
+ vg scan
471
+
472
+ # JSON output for automation
473
+ vg scan --format json --out scan.json
474
+
475
+ # CI gate with baseline regression protection
476
+ vg scan --baseline .vibgrate/baseline.json --drift-budget 40 --drift-worsening 5 --fail-on error
477
+
478
+ # Upload result in the same command
479
+ vg scan --push --strict
480
+ ```
481
+
482
+ Expected results:
483
+
484
+ - Clear score/risk output in terminal (or JSON/SARIF when selected).
485
+ - Exit code `2` when configured quality gates are exceeded.
486
+ - When `--push` is enabled, artifact upload is attempted after scan completion.
531
487
 
532
488
  ---
533
489
 
534
- ### vg show
490
+ ### Vulnerabilities and exposure attribution
535
491
 
536
- Explain a single node: what it is, what it calls, what calls it.
492
+ `vg scan --vulns` matches your installed dependencies against the public OSV database and records each known vulnerability — advisory id and CVE, severity, CVSS, and the fixing version — in the scan artifact, as findings, and in SARIF. Supply advisories in a `--package-manifest` bundle to run it offline.
493
+
494
+ In a git repository the scan also attributes each finding: the commit, author, and date that introduced the vulnerable version, and how long you have been exposed. These exposure windows aggregate into remediation metrics framed around the EU Cyber Resilience Act (CRA): open counts by severity, mean and maximum time exposed, and per-severity SLA breaches (defaults: critical 7 days, high 30, moderate 90, low 180). The metrics are descriptive — they show whether remediation keeps pace; they are not a compliance certification.
495
+
496
+ The scan also reconstructs **closed** exposure windows from history — a vulnerable version that was later bumped out of the affected range or removed from the lockfile entirely — and reports real remediation time (MTTR) from them: measured, not estimated. Offline, a package-version manifest extends this to advisories that are fully fixed today, so a dependency that is clean now but was once vulnerable still counts toward your remediation record.
497
+
498
+ Detection and attribution read each project's lockfile, so they cover npm / pnpm / yarn, pip / poetry / pipenv, cargo, composer, bundler, go, pub, hex, NuGet, and Maven/Gradle.
537
499
 
538
500
  ```bash
539
- vg show <name>
501
+ # Online detection against OSV
502
+ vg scan --vulns
503
+
504
+ # Air-gapped: advisories supplied in the manifest bundle
505
+ vg scan --vulns --offline --package-manifest ./package-versions.zip
506
+
507
+ # Everything in one run: drift + vulnerabilities + a banned-dependency report
508
+ vg scan --full
540
509
  ```
541
510
 
511
+ ---
512
+
513
+ ### vg update
514
+
515
+ Check for and install updates.
516
+
517
+ ```bash
518
+ vg update [--check] [--pm <manager>]
519
+ ```
520
+
521
+ | Flag | Description |
522
+ | --------- | ------------------------------------------------------ |
523
+ | `--check` | Only check for updates, don't install |
524
+ | `--pm` | Force a package manager (`npm`, `pnpm`, `yarn`, `bun`) |
525
+
526
+ ---
527
+
528
+ ### vg why
529
+
530
+ Explain a dependency from git history: who added it, every version since, and any open vulnerabilities it carries.
531
+
532
+ ```bash
533
+ vg why <package>
534
+ ```
535
+
536
+ `vg why` reads your lockfile's history, so it works across npm / pnpm / yarn, pip / poetry, cargo, composer, bundler, go, pub, hex, NuGet, and Maven/Gradle projects. For Maven/Gradle the history comes from a resolved `gradle.lockfile`, or a `pom.xml`'s pinned direct-dependency versions (versions managed by a BOM/`dependencyManagement` aren't resolved). Open vulnerabilities and their introduction attribution come from your most recent `vg scan --vulns`.
537
+
538
+ ---
539
+
540
+ ## Code Graph Commands
541
+
542
+ Vibgrate includes a full code graph engine — call trees, impact surfaces, semantic search, and AI Context serving. All graph commands read from (or write to) a local graph artifact at `.vibgrate/graph.json`. Build the map once with `vg build`, then query it offline indefinitely.
543
+
544
+ **Global options available on every graph command:**
545
+
542
546
  | Flag | Description |
543
547
  |------|-------------|
544
- | `<name>` | Qualified name, short name, `file:line`, glob, or id |
545
- | `--pick <n>` | Pick the nth candidate when ambiguous |
546
-
547
- Outputs the qualified name, kind, file location, signature, importance score, area, extends relationships, callees, and callers.
548
+ | `--cwd <dir>` | Working directory (default: current) |
549
+ | `--graph <file>` | Path to graph file (default: `.vibgrate/graph.json`) |
550
+ | `--json` | Machine-readable JSON output |
551
+ | `--quiet` | Suppress non-error output |
552
+ | `--local` | Offline mode — no network calls or downloads |
553
+ | `--client <name>` | Identify the AI client (e.g. `claude`) so navigation calls are counted in `vg savings` |
554
+ | `--deep` | Enable deep derivation (for `vg facts`, `vg build`) |
555
+ | `--no-cache` | Skip and clear cached data |
548
556
 
549
557
  ---
550
558
 
@@ -571,6 +579,139 @@ Before answering, `ask` checks whether files changed since the map was last buil
571
579
 
572
580
  ---
573
581
 
582
+ ### vg benchmark
583
+
584
+ A reproducible build + memory + token-reduction benchmark for this repository — honest, self-measured estimates you can re-run.
585
+
586
+ ```bash
587
+ vg benchmark
588
+ ```
589
+
590
+ | Flag | Default | Description |
591
+ |------|---------|-------------|
592
+ | `--budget <n>` | `2000` | Approx token budget used when estimating context savings |
593
+
594
+ Add `--json` for machine-readable output.
595
+
596
+ ---
597
+
598
+ ### vg build
599
+
600
+ Build or update the code map incrementally.
601
+
602
+ ```bash
603
+ vg build [paths...]
604
+ ```
605
+
606
+ Maps source code into a graph artifact, enabling all downstream queries (`vg show`, `vg ask`, `vg impact`, etc.).
607
+
608
+ | Flag | Default | Description |
609
+ |------|---------|-------------|
610
+ | `[paths...]` | `.` | Folders or files to map |
611
+ | `--only <langs>` | — | Restrict to languages (e.g. `ts,py,go`) |
612
+ | `--exclude <glob>` | — | Extra ignore glob (repeatable) |
613
+ | `--jobs <n>` | auto | Worker count (`1` = single-threaded) |
614
+ | `--scip <file>` | auto-detect | Ingest a SCIP index for precise resolution |
615
+ | `--no-scip` | — | Ignore any SCIP index |
616
+ | `--no-tsc` | — | Skip the TypeScript resolver (heuristic floor only) |
617
+ | `--no-html` | — | Do not write `graph.html` |
618
+ | `--no-report` | — | Do not write `GRAPH_REPORT.md` |
619
+ | `--no-warm` | — | Do not warm the semantic index after building |
620
+ | `--grammars <dir>` | — | Grammar `.wasm` directory for offline/air-gapped use |
621
+ | `-o, --export <file>` | — | Also write the map to a file (format from extension) |
622
+
623
+ ---
624
+
625
+ ### vg bundle
626
+
627
+ Build an air-gapped bundle — grammars, the code graph, and the library catalog — for use on a machine with no network.
628
+
629
+ ```bash
630
+ vg bundle
631
+ ```
632
+
633
+ | Flag | Default | Description |
634
+ |------|---------|-------------|
635
+ | `--offline` | — | Build using only locally-available assets |
636
+ | `-o, --out <dir>` | `vg-bundle` | Output directory for the bundle |
637
+
638
+ Add `--json` for machine-readable output.
639
+
640
+ ---
641
+
642
+ ### vg embed
643
+
644
+ Precompute the semantic index so the next `vg ask` is instant.
645
+
646
+ ```bash
647
+ vg embed
648
+ ```
649
+
650
+ Local ONNX model downloaded once into a shared cache (`~/.cache/vibgrate/models`). Per-repo vectors stored in `.vibgrate/cache/`.
651
+
652
+ | Flag | Description |
653
+ |------|-------------|
654
+ | `--where` | Show where the model is cached and its size |
655
+ | `--clear` | Remove the downloaded model from shared cache |
656
+
657
+ ---
658
+
659
+ ### vg export
660
+
661
+ Export the code map in various formats.
662
+
663
+ ```bash
664
+ vg export [file]
665
+ ```
666
+
667
+ Format is inferred from the file extension. Use `-` for stdout.
668
+
669
+ | Extension | Format |
670
+ |-----------|--------|
671
+ | `.json` | JSON |
672
+ | `.ndjson` | Newline-delimited JSON |
673
+ | `.graphml` | GraphML |
674
+ | `.dot` | Graphviz DOT |
675
+ | `.cypher` | Neo4j Cypher |
676
+ | `.md` | Markdown |
677
+ | `.html` | HTML visualization |
678
+ | `.cdx.json` | CycloneDX SBOM / AI-BOM |
679
+ | `.spdx.json` | SPDX |
680
+
681
+ ---
682
+
683
+ ### vg facts
684
+
685
+ Deterministic open facts for a node (contract, invariant, characterization).
686
+
687
+ ```bash
688
+ vg facts <name>
689
+ ```
690
+
691
+ Epistemic-typed: declared/static → observed/derived. Requires `--deep` for derived facts beyond basic declarations.
692
+
693
+ | Flag | Description |
694
+ |------|-------------|
695
+ | `<name>` | Node to inspect |
696
+ | `--pick <n>` | Pick the nth candidate when ambiguous |
697
+
698
+ ---
699
+
700
+ ### vg guide
701
+
702
+ Cited, relevant standards and practices for a node — the free standards pack.
703
+
704
+ ```bash
705
+ vg guide <name>
706
+ ```
707
+
708
+ | Flag | Description |
709
+ |------|-------------|
710
+ | `<name>` | Node to inspect |
711
+ | `--pick <n>` | Pick the nth candidate when ambiguous |
712
+
713
+ ---
714
+
574
715
  ### vg impact
575
716
 
576
717
  What breaks if you change it — deterministic structural blast radius.
@@ -591,39 +732,58 @@ Reverse reachability with decay confidence. With `--tests`, returns exactly the
591
732
 
592
733
  ---
593
734
 
594
- ### vg path
735
+ ### vg install
595
736
 
596
- Show how A connects to Bshortest path in the call graph.
737
+ Add Vibgrate AI Context to your AI assistant(s) skill, MCP wiring, and advisory nudge.
597
738
 
598
739
  ```bash
599
- vg path <a> <b>
740
+ vg install [tools...]
741
+ vg uninstall <tools...>
600
742
  ```
601
743
 
744
+ Idempotent and repo-local (changes can be committed and shared with your team).
745
+
746
+ **Supported assistants:** `claude`, `cursor`, `windsurf`, `vscode`, `codex`, `gemini`
747
+
602
748
  | Flag | Description |
603
749
  |------|-------------|
604
- | `<a>` | Source node |
605
- | `<b>` | Target node |
606
- | `--pick-a <n>` | Pick the nth candidate for A |
607
- | `--pick-b <n>` | Pick the nth candidate for B |
750
+ | `[tools...]` | Assistant ids to install for |
751
+ | `--all` | Install for every supported assistant |
752
+ | `--list` | Show the support matrix and exit |
753
+ | `--no-hook` | Skip the advisory nudge |
754
+
755
+ **`vg uninstall` flags:**
756
+
757
+ | Flag | Description |
758
+ |------|-------------|
759
+ | `<tools...>` | Assistant ids to remove (required) |
760
+ | `--purge` | Also delete the skill file |
608
761
 
609
762
  ---
610
763
 
611
- ### vg tree
764
+ ### vg lib
612
765
 
613
- The call tree rooted at a node.
766
+ Version-correct library docs from the hosted catalog or local ingestion.
614
767
 
615
768
  ```bash
616
- vg tree <name>
769
+ vg lib # List the catalog
770
+ vg lib <name> # Show docs for a library (pinned to your lockfile version)
771
+ vg lib add <source> # Ingest docs from a local source
772
+ vg lib publish <name> # Upload private library docs to the hosted catalog
773
+ vg lib resolve <name> # Resolve name → catalog id + version
774
+ vg lib refresh # Re-ingest all local sources
617
775
  ```
618
776
 
619
- Callees by default; `--callers` to invert. Depth-bounded and cycle-safe.
620
-
621
777
  | Flag | Default | Description |
622
778
  |------|---------|-------------|
623
- | `<name>` | — | Root node |
624
- | `--callers` | — | Show callers instead of callees |
625
- | `--depth <n>` | `3` | Max depth |
626
- | `--pick <n>` | | Pick the nth candidate when ambiguous |
779
+ | `--name <name>` | — | Library name (for `add`) |
780
+ | `--version <v>` | — | Pin the doc version (for `add`/`publish`) |
781
+ | `-b, --budget <n>` | | Trim docs to ~N tokens |
782
+ | `--readme <path>` | `./README.md` | README path (for `publish`) |
783
+ | `--dts <path>` | — | TypeScript declaration path (for `publish`) |
784
+ | `--language <lang>` | — | Primary language (for `publish`) |
785
+ | `--region <region>` | `us` | Data-residency region for the hosted catalog |
786
+ | `--ingest <url>` | — | Hosted catalog URL override (wins over `--region`) |
627
787
 
628
788
  ---
629
789
 
@@ -646,29 +806,50 @@ vg oddities # Surprising cross-area links (architectural smells)
646
806
 
647
807
  ---
648
808
 
649
- ### vg lib
809
+ ### vg models
650
810
 
651
- Version-correct library docsfrom the hosted catalog or local ingestion.
811
+ The local model fleet Ollama, LM Studio, and on-disk `gguf` models — discovered entirely offline.
652
812
 
653
813
  ```bash
654
- vg lib # List the catalog
655
- vg lib <name> # Show docs for a library (pinned to your lockfile version)
656
- vg lib add <source> # Ingest docs from a local source
657
- vg lib publish <name> # Upload private library docs to the hosted catalog
658
- vg lib resolve <name> # Resolve name → catalog id + version
659
- vg lib refresh # Re-ingest all local sources
814
+ vg models
815
+ ```
816
+
817
+ Lists the local inference backends and models Vibgrate can see, so you know what is available without any network calls. Add `--json` for machine-readable output.
818
+
819
+ ---
820
+
821
+ ### vg path
822
+
823
+ Show how A connects to B — shortest path in the call graph.
824
+
825
+ ```bash
826
+ vg path <a> <b>
827
+ ```
828
+
829
+ | Flag | Description |
830
+ |------|-------------|
831
+ | `<a>` | Source node |
832
+ | `<b>` | Target node |
833
+ | `--pick-a <n>` | Pick the nth candidate for A |
834
+ | `--pick-b <n>` | Pick the nth candidate for B |
835
+
836
+ ---
837
+
838
+ ### vg savings
839
+
840
+ A local, privacy-safe report of the tokens and dollars saved by querying the map instead of grepping and reading whole files.
841
+
842
+ ```bash
843
+ vg savings
660
844
  ```
661
845
 
846
+ Reads the counts-only usage ledger recorded when you run `vg serve --savings` (or pass `--client` on CLI navigation calls). Nothing leaves your machine — the figures are estimates.
847
+
662
848
  | Flag | Default | Description |
663
849
  |------|---------|-------------|
664
- | `--name <name>` | | Library name (for `add`) |
665
- | `--version <v>` | — | Pin the doc version (for `add`/`publish`) |
666
- | `-b, --budget <n>` | — | Trim docs to ~N tokens |
667
- | `--readme <path>` | `./README.md` | README path (for `publish`) |
668
- | `--dts <path>` | — | TypeScript declaration path (for `publish`) |
669
- | `--language <lang>` | — | Primary language (for `publish`) |
670
- | `--region <region>` | `us` | Data-residency region for the hosted catalog |
671
- | `--ingest <url>` | — | Hosted catalog URL override (wins over `--region`) |
850
+ | `--days <n>` | `30` | Reporting window in days |
851
+
852
+ Add `--json` for machine-readable output.
672
853
 
673
854
  ---
674
855
 
@@ -710,35 +891,6 @@ All tools are read-only. The server is local-first: it always answers from your
710
891
 
711
892
  ---
712
893
 
713
- ### vg install
714
-
715
- Add Vibgrate AI Context to your AI assistant(s) — skill, MCP wiring, and advisory nudge.
716
-
717
- ```bash
718
- vg install [tools...]
719
- vg uninstall <tools...>
720
- ```
721
-
722
- Idempotent and repo-local (changes can be committed and shared with your team).
723
-
724
- **Supported assistants:** `claude`, `cursor`, `windsurf`, `vscode`, `codex`, `gemini`
725
-
726
- | Flag | Description |
727
- |------|-------------|
728
- | `[tools...]` | Assistant ids to install for |
729
- | `--all` | Install for every supported assistant |
730
- | `--list` | Show the support matrix and exit |
731
- | `--no-hook` | Skip the advisory nudge |
732
-
733
- **`vg uninstall` flags:**
734
-
735
- | Flag | Description |
736
- |------|-------------|
737
- | `<tools...>` | Assistant ids to remove (required) |
738
- | `--purge` | Also delete the skill file |
739
-
740
- ---
741
-
742
894
  ### vg share
743
895
 
744
896
  Make the code map committable and auto-updating for your team.
@@ -756,32 +908,32 @@ Installs a pre-commit hook, deterministic merge driver, and `.gitignore` so the
756
908
 
757
909
  ---
758
910
 
759
- ### vg status
911
+ ### vg show
760
912
 
761
- Graph freshness, counts, and staleness compared against the working tree.
913
+ Explain a single node: what it is, what it calls, what calls it.
762
914
 
763
915
  ```bash
764
- vg status
916
+ vg show <name>
765
917
  ```
766
918
 
767
- Outputs: map path, generation timestamp, node/edge/area counts, languages, cluster method, resolver rungs used, cache status, and stale file count. When a build has run on this machine, staleness is exact (per-file stat + content hash against the last build's snapshot — edits, adds, and removes); otherwise it falls back to comparing the file set.
919
+ | Flag | Description |
920
+ |------|-------------|
921
+ | `<name>` | Qualified name, short name, `file:line`, glob, or id |
922
+ | `--pick <n>` | Pick the nth candidate when ambiguous |
923
+
924
+ Outputs the qualified name, kind, file location, signature, importance score, area, extends relationships, callees, and callers.
768
925
 
769
926
  ---
770
927
 
771
- ### vg facts
928
+ ### vg status
772
929
 
773
- Deterministic open facts for a node (contract, invariant, characterization).
930
+ Graph freshness, counts, and staleness compared against the working tree.
774
931
 
775
932
  ```bash
776
- vg facts <name>
933
+ vg status
777
934
  ```
778
935
 
779
- Epistemic-typed: declared/static observed/derived. Requires `--deep` for derived facts beyond basic declarations.
780
-
781
- | Flag | Description |
782
- |------|-------------|
783
- | `<name>` | Node to inspect |
784
- | `--pick <n>` | Pick the nth candidate when ambiguous |
936
+ Outputs: map path, generation timestamp, node/edge/area counts, languages, cluster method, resolver rungs used, cache status, and stale file count. When a build has run on this machine, staleness is exact (per-file stat + content hash against the last build's snapshot — edits, adds, and removes); otherwise it falls back to comparing the file set.
785
937
 
786
938
  ---
787
939
 
@@ -805,44 +957,40 @@ vg tests <name>
805
957
 
806
958
  ---
807
959
 
808
- ### vg embed
960
+ ### vg tree
809
961
 
810
- Precompute the semantic index so the next `vg ask` is instant.
962
+ The call tree rooted at a node.
811
963
 
812
964
  ```bash
813
- vg embed
965
+ vg tree <name>
814
966
  ```
815
967
 
816
- Local ONNX model downloaded once into a shared cache (`~/.cache/vibgrate/models`). Per-repo vectors stored in `.vibgrate/cache/`.
968
+ Callees by default; `--callers` to invert. Depth-bounded and cycle-safe.
817
969
 
818
- | Flag | Description |
819
- |------|-------------|
820
- | `--where` | Show where the model is cached and its size |
821
- | `--clear` | Remove the downloaded model from shared cache |
970
+ | Flag | Default | Description |
971
+ |------|---------|-------------|
972
+ | `<name>` | | Root node |
973
+ | `--callers` | | Show callers instead of callees |
974
+ | `--depth <n>` | `3` | Max depth |
975
+ | `--pick <n>` | — | Pick the nth candidate when ambiguous |
822
976
 
823
977
  ---
824
978
 
825
- ### vg export
979
+ ### vg unknowns
826
980
 
827
- Export the code map in various formats.
981
+ What the graph cannot resolve, ranked by blast radius — the unresolved references most worth teaching the map about.
828
982
 
829
983
  ```bash
830
- vg export [file]
984
+ vg unknowns
831
985
  ```
832
986
 
833
- Format is inferred from the file extension. Use `-` for stdout.
987
+ Surfaces the symbols and imports the resolver could not tie to a definition, ordered by how much depends on them, so you can see where a SCIP index or a targeted `--only` language pass would most improve resolution.
834
988
 
835
- | Extension | Format |
836
- |-----------|--------|
837
- | `.json` | JSON |
838
- | `.ndjson` | Newline-delimited JSON |
839
- | `.graphml` | GraphML |
840
- | `.dot` | Graphviz DOT |
841
- | `.cypher` | Neo4j Cypher |
842
- | `.md` | Markdown |
843
- | `.html` | HTML visualization |
844
- | `.cdx.json` | CycloneDX SBOM / AI-BOM |
845
- | `.spdx.json` | SPDX |
989
+ | Flag | Default | Description |
990
+ |------|---------|-------------|
991
+ | `-n, --limit <n>` | `20` | How many to show |
992
+
993
+ Add `--json` for machine-readable output.
846
994
 
847
995
  ---
848
996