@vibgrate/cli 2026.722.2 → 2026.727.2

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.
Files changed (145) hide show
  1. package/DOCS.md +418 -213
  2. package/README.md +34 -8
  3. package/dist/baseline-TG4ATZGZ.js +8 -0
  4. package/dist/{baseline-BD3A7EXD.js.map → baseline-TG4ATZGZ.js.map} +1 -1
  5. package/dist/chunk-2MBL43EJ.js +82 -0
  6. package/dist/chunk-2MBL43EJ.js.map +1 -0
  7. package/dist/chunk-2XQDMLKB.js +465 -0
  8. package/dist/chunk-2XQDMLKB.js.map +1 -0
  9. package/dist/{chunk-PY3DNX5H.js → chunk-3Q7QBWFW.js} +13 -2
  10. package/dist/chunk-3Q7QBWFW.js.map +1 -0
  11. package/dist/chunk-3V24O47U.js +478 -0
  12. package/dist/chunk-3V24O47U.js.map +1 -0
  13. package/dist/chunk-5I4VSBWQ.js +764 -0
  14. package/dist/chunk-5I4VSBWQ.js.map +1 -0
  15. package/dist/{chunk-WNIIKCNF.js → chunk-6ABXHZRN.js} +59 -311
  16. package/dist/chunk-6ABXHZRN.js.map +1 -0
  17. package/dist/chunk-6AYDFFP5.js +136 -0
  18. package/dist/chunk-6AYDFFP5.js.map +1 -0
  19. package/dist/chunk-6UQMXIAG.js +122 -0
  20. package/dist/chunk-6UQMXIAG.js.map +1 -0
  21. package/dist/chunk-7N4Y3E47.js +108 -0
  22. package/dist/chunk-7N4Y3E47.js.map +1 -0
  23. package/dist/chunk-BPF3YX2U.js +64 -0
  24. package/dist/chunk-BPF3YX2U.js.map +1 -0
  25. package/dist/chunk-BWPBB45M.js +88 -0
  26. package/dist/chunk-BWPBB45M.js.map +1 -0
  27. package/dist/{chunk-6CXTPC74.js → chunk-CY4WKXB2.js} +27 -6
  28. package/dist/chunk-CY4WKXB2.js.map +1 -0
  29. package/dist/chunk-DGUM43GV.js +10 -0
  30. package/dist/chunk-DGUM43GV.js.map +1 -0
  31. package/dist/{chunk-NONYJLOJ.js → chunk-EX4PQT6W.js} +3 -3
  32. package/dist/{chunk-NONYJLOJ.js.map → chunk-EX4PQT6W.js.map} +1 -1
  33. package/dist/chunk-IS7VTH2Q.js +627 -0
  34. package/dist/chunk-IS7VTH2Q.js.map +1 -0
  35. package/dist/chunk-IZDH67DX.js +289 -0
  36. package/dist/chunk-IZDH67DX.js.map +1 -0
  37. package/dist/chunk-J4RFRKZH.js +2496 -0
  38. package/dist/chunk-J4RFRKZH.js.map +1 -0
  39. package/dist/chunk-J7LKEB2R.js +51 -0
  40. package/dist/chunk-J7LKEB2R.js.map +1 -0
  41. package/dist/chunk-JIBOJTGS.js +313 -0
  42. package/dist/chunk-JIBOJTGS.js.map +1 -0
  43. package/dist/chunk-K3MZIVZW.js +88 -0
  44. package/dist/chunk-K3MZIVZW.js.map +1 -0
  45. package/dist/chunk-K7REHDQS.js +776 -0
  46. package/dist/chunk-K7REHDQS.js.map +1 -0
  47. package/dist/{chunk-2O5YZVZV.js → chunk-KCKYKDMS.js} +23 -19
  48. package/dist/chunk-KCKYKDMS.js.map +1 -0
  49. package/dist/{chunk-3MXNNBLI.js → chunk-KNELIQJO.js} +1647 -2042
  50. package/dist/chunk-KNELIQJO.js.map +1 -0
  51. package/dist/chunk-KSBHGWRV.js +613 -0
  52. package/dist/chunk-KSBHGWRV.js.map +1 -0
  53. package/dist/chunk-LKVMI67M.js +1695 -0
  54. package/dist/chunk-LKVMI67M.js.map +1 -0
  55. package/dist/chunk-NDMDSPFX.js +69 -0
  56. package/dist/chunk-NDMDSPFX.js.map +1 -0
  57. package/dist/{chunk-CS37OBE3.js → chunk-OFUC6RYN.js} +791 -783
  58. package/dist/chunk-OFUC6RYN.js.map +1 -0
  59. package/dist/chunk-OOIG3RUM.js +276 -0
  60. package/dist/chunk-OOIG3RUM.js.map +1 -0
  61. package/dist/chunk-PMYWZRRS.js +62 -0
  62. package/dist/chunk-PMYWZRRS.js.map +1 -0
  63. package/dist/chunk-PXHNTC6D.js +382 -0
  64. package/dist/chunk-PXHNTC6D.js.map +1 -0
  65. package/dist/{chunk-I7GY7MVN.js → chunk-RNP3SMTV.js} +60 -12
  66. package/dist/chunk-RNP3SMTV.js.map +1 -0
  67. package/dist/chunk-TCDAZZNP.js +843 -0
  68. package/dist/chunk-TCDAZZNP.js.map +1 -0
  69. package/dist/{chunk-5BDHQ7DD.js → chunk-WGUL45AV.js} +24 -17
  70. package/dist/chunk-WGUL45AV.js.map +1 -0
  71. package/dist/cli.d.ts +3 -0
  72. package/dist/cli.js +3373 -617
  73. package/dist/cli.js.map +1 -1
  74. package/dist/execution-env-ZU45JZ4G.js +4 -0
  75. package/dist/execution-env-ZU45JZ4G.js.map +1 -0
  76. package/dist/federation-SZWZIFZ7.js +7 -0
  77. package/dist/federation-SZWZIFZ7.js.map +1 -0
  78. package/dist/{fs-IPY4FJKH.js → fs-B5HZ2MIU.js} +3 -2
  79. package/dist/fs-B5HZ2MIU.js.map +1 -0
  80. package/dist/{fs-KCABDURV.js → fs-O5IQYXHO.js} +3 -2
  81. package/dist/fs-O5IQYXHO.js.map +1 -0
  82. package/dist/git-ref-XDXB6JP5.js +4 -0
  83. package/dist/git-ref-XDXB6JP5.js.map +1 -0
  84. package/dist/graph-backend-73URGTFY.js +11 -0
  85. package/dist/graph-backend-73URGTFY.js.map +1 -0
  86. package/dist/index.d.ts +472 -137
  87. package/dist/index.js +15 -7
  88. package/dist/index.js.map +1 -1
  89. package/dist/{interactive-A4DISSIW.js → interactive-372NLI5C.js} +186 -226
  90. package/dist/interactive-372NLI5C.js.map +1 -0
  91. package/dist/llm-host-7GWDO6IX.js +9 -0
  92. package/dist/llm-host-7GWDO6IX.js.map +1 -0
  93. package/dist/load-I333TGNI.js +8 -0
  94. package/dist/load-I333TGNI.js.map +1 -0
  95. package/dist/local-runtime-5O2NN3GA.js +5 -0
  96. package/dist/local-runtime-5O2NN3GA.js.map +1 -0
  97. package/dist/mcp-tools-I7JK3S2M.js +4 -0
  98. package/dist/{mcp-tools-I6PME3AV.js.map → mcp-tools-I7JK3S2M.js.map} +1 -1
  99. package/dist/model-execution-profile-TFBKCNJG.js +4 -0
  100. package/dist/model-execution-profile-TFBKCNJG.js.map +1 -0
  101. package/dist/model-orchestrator-TVONAUPS.js +9 -0
  102. package/dist/model-orchestrator-TVONAUPS.js.map +1 -0
  103. package/dist/parse-worker.d.ts +1 -1
  104. package/dist/parse-worker.js +2 -1
  105. package/dist/parse-worker.js.map +1 -1
  106. package/dist/paths-2RAH3GME.js +6 -0
  107. package/dist/paths-2RAH3GME.js.map +1 -0
  108. package/dist/resolve-gguf-VPL4YQ6J.js +8 -0
  109. package/dist/resolve-gguf-VPL4YQ6J.js.map +1 -0
  110. package/dist/runtime-session-JRKCQUHY.js +18 -0
  111. package/dist/runtime-session-JRKCQUHY.js.map +1 -0
  112. package/dist/session-ITPYQ5XI.js +11 -0
  113. package/dist/{session-POJUDFPH.js.map → session-ITPYQ5XI.js.map} +1 -1
  114. package/dist/session-store-WFBX7HXL.js +4 -0
  115. package/dist/{session-store-W5RZZHA3.js.map → session-store-WFBX7HXL.js.map} +1 -1
  116. package/dist/{stream-json-Q2JGWPHB.js → stream-json-SLMDKLXP.js} +17 -6
  117. package/dist/stream-json-SLMDKLXP.js.map +1 -0
  118. package/dist/{types-Jl6RJ175.d.ts → types-7AHBUbFm.d.ts} +8 -2
  119. package/dist/ui-Q6DJ3GCU.js +5 -0
  120. package/dist/ui-Q6DJ3GCU.js.map +1 -0
  121. package/dist/vgd-7JV5KCNJ.js +17 -0
  122. package/dist/vgd-7JV5KCNJ.js.map +1 -0
  123. package/package.json +9 -6
  124. package/dist/baseline-BD3A7EXD.js +0 -7
  125. package/dist/chunk-2O5YZVZV.js.map +0 -1
  126. package/dist/chunk-3MXNNBLI.js.map +0 -1
  127. package/dist/chunk-5BDHQ7DD.js.map +0 -1
  128. package/dist/chunk-6CXTPC74.js.map +0 -1
  129. package/dist/chunk-CS37OBE3.js.map +0 -1
  130. package/dist/chunk-GGJZA3Q6.js +0 -961
  131. package/dist/chunk-GGJZA3Q6.js.map +0 -1
  132. package/dist/chunk-I7GY7MVN.js.map +0 -1
  133. package/dist/chunk-JBXNQCGE.js +0 -484
  134. package/dist/chunk-JBXNQCGE.js.map +0 -1
  135. package/dist/chunk-PY3DNX5H.js.map +0 -1
  136. package/dist/chunk-WNIIKCNF.js.map +0 -1
  137. package/dist/fs-IPY4FJKH.js.map +0 -1
  138. package/dist/fs-KCABDURV.js.map +0 -1
  139. package/dist/interactive-A4DISSIW.js.map +0 -1
  140. package/dist/mcp-tools-I6PME3AV.js +0 -3
  141. package/dist/session-POJUDFPH.js +0 -6
  142. package/dist/session-store-W5RZZHA3.js +0 -3
  143. package/dist/stream-json-Q2JGWPHB.js.map +0 -1
  144. package/dist/ui-HOVOPWMX.js +0 -4
  145. package/dist/ui-HOVOPWMX.js.map +0 -1
package/DOCS.md CHANGED
@@ -14,30 +14,31 @@ For a quick overview, see the [README](./README.md). This document covers everyt
14
14
  - [vg baseline](#vg-baseline)
15
15
  - [vg bisect](#vg-bisect)
16
16
  - [vg drift](#vg-drift)
17
- - [vg dsn create](#vg-dsn-create)
18
17
  - [vg evidence](#vg-evidence)
19
18
  - [vg fix](#vg-fix)
20
19
  - [vg init](#vg-init)
21
- - [vg login](#vg-login)
22
- - [vg logout](#vg-logout)
23
- - [vg push](#vg-push)
24
20
  - [vg report](#vg-report)
25
21
  - [vg sbom](#vg-sbom)
26
22
  - [vg scan](#vg-scan)
27
23
  - [Vulnerabilities and exposure attribution](#vulnerabilities-and-exposure-attribution)
28
24
  - [vg update](#vg-update)
29
25
  - [vg why](#vg-why)
26
+ - [Workspace auth & cloud upload](#workspace-auth--cloud-upload)
27
+ - [vg dsn create](#vg-dsn-create)
28
+ - [vg login](#vg-login)
29
+ - [vg logout](#vg-logout)
30
+ - [vg push](#vg-push)
30
31
  - [Code Graph Commands](#code-graph-commands)
31
32
  - [vg ask](#vg-ask)
32
- - [vg benchmark](#vg-benchmark)
33
33
  - [vg build](#vg-build)
34
34
  - [vg bundle](#vg-bundle)
35
+ - [vg code](#vg-code)
35
36
  - [vg embed](#vg-embed)
36
37
  - [vg export](#vg-export)
37
38
  - [vg facts](#vg-facts)
38
39
  - [vg guide](#vg-guide)
39
40
  - [vg impact](#vg-impact)
40
- - [vg install](#vg-install)
41
+ - [vg install / vg uninstall](#vg-install)
41
42
  - [vg lib](#vg-lib)
42
43
  - [vg map / vg hubs / vg areas / vg oddities](#vg-map--vg-hubs--vg-areas--vg-oddities)
43
44
  - [vg models](#vg-models)
@@ -50,6 +51,11 @@ For a quick overview, see the [README](./README.md). This document covers everyt
50
51
  - [vg tests](#vg-tests)
51
52
  - [vg tree](#vg-tree)
52
53
  - [vg unknowns](#vg-unknowns)
54
+ - [Diagnostics, IDE & runtime](#diagnostics-ide--runtime)
55
+ - [vg daemon](#vg-daemon)
56
+ - [vg doctor](#vg-doctor)
57
+ - [vg lsp](#vg-lsp)
58
+ - [vg policy](#vg-policy)
53
59
  - [DriftScore](#driftscore)
54
60
  - [Drift Baselines & Fitness Functions](#drift-baselines--fitness-functions)
55
61
  - [How the Score Is Calculated](#how-the-score-is-calculated)
@@ -171,6 +177,10 @@ Expected results:
171
177
 
172
178
  ## Commands Reference
173
179
 
180
+ Drift scoring, baselines, reports, supply-chain evidence, and related local tooling.
181
+
182
+ **Typical path:** `vg init` → `vg scan` → `vg baseline` → `vg report` → `vg fix`
183
+
174
184
  ### vg baseline
175
185
 
176
186
  Create a drift baseline snapshot for delta comparison.
@@ -183,6 +193,7 @@ Runs a full scan and saves the result to `.vibgrate/baseline.json`. Use this as
183
193
 
184
194
  ---
185
195
 
196
+
186
197
  ### vg bisect
187
198
 
188
199
  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.
@@ -205,6 +216,7 @@ Exit codes: `0` when the query resolves, `2` when `--assert` finds the constrain
205
216
 
206
217
  ---
207
218
 
219
+
208
220
  ### vg drift
209
221
 
210
222
  What is outdated across your dependencies — a fast, offline currency check.
@@ -224,25 +236,6 @@ Add `--json` for machine-readable output.
224
236
 
225
237
  ---
226
238
 
227
- ### vg dsn create
228
-
229
- Generate an HMAC-signed DSN token for API authentication.
230
-
231
- ```bash
232
- vg dsn create --workspace <id|new> [--region <region>] [--ingest <url>] [--write <path>]
233
- ```
234
-
235
- | Flag | Default | Description |
236
- | ------------- | ---------- | --------------------------------------------------------------------------- |
237
- | `--workspace` | _required_ | Your workspace ID, or `new` to auto-generate a workspace |
238
- | `--region` | `us` | Data residency region (`us`, `eu`) |
239
- | `--ingest` | — | Custom ingest API URL (overrides `--region`) |
240
- | `--write` | — | Write DSN to a file (add to `.gitignore`!) |
241
-
242
- When using `--workspace new`, the CLI auto-generates a workspace ID and provisions the DSN
243
- with the Vibgrate API. Rate limited to 1 new DSN per 5 minutes per IP address.
244
-
245
- ---
246
239
 
247
240
  ### vg evidence
248
241
 
@@ -293,6 +286,7 @@ No language model touches any figure in the evidence path, and every determinati
293
286
 
294
287
  ---
295
288
 
289
+
296
290
  ### vg fix
297
291
 
298
292
  Turn a drift scan into ranked, risk-tiered upgrade plans and **apply** the one
@@ -378,6 +372,7 @@ advisory at or above the threshold or an apply step fails.
378
372
 
379
373
  ---
380
374
 
375
+
381
376
  ### vg init
382
377
 
383
378
  Initialise Vibgrate in a project.
@@ -398,50 +393,6 @@ Creates:
398
393
 
399
394
  ---
400
395
 
401
- ### vg login
402
-
403
- 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.
404
-
405
- ```bash
406
- vg login
407
- ```
408
-
409
- | Flag | Default | Description |
410
- |------|---------|-------------|
411
- | `--region <region>` | `us` | Data-residency region (`us`, `eu`) |
412
- | `--ingest <url>` | — | Custom ingest API URL (overrides `--region`) |
413
- | `--no-browser` | — | Print the URL to open instead of launching a browser (headless / SSH) |
414
-
415
- ---
416
-
417
- ### vg logout
418
-
419
- Clear stored Vibgrate login credentials from this machine.
420
-
421
- ```bash
422
- vg logout
423
- ```
424
-
425
- ---
426
-
427
- ### vg push
428
-
429
- Upload scan results to the Vibgrate Cloud API.
430
-
431
- ```bash
432
- vg push [--dsn <dsn>] [--file <file>] [--region <region>] [--strict]
433
- ```
434
-
435
- | Flag | Default | Description |
436
- | ---------- | ---------------------------- | ------------------------------------------- |
437
- | `--dsn` | `VIBGRATE_DSN` env | DSN token for authentication |
438
- | `--file` | `.vibgrate/scan_result.json` | Scan artifact to upload |
439
- | `--region` | — | Override data residency region (`us`, `eu`) |
440
- | `--strict` | — | Fail hard on upload errors |
441
-
442
- Upload is always optional. Best-effort by default — use `--strict` in CI if you want the pipeline to fail on upload errors.
443
-
444
- ---
445
396
 
446
397
  ### vg report
447
398
 
@@ -458,6 +409,7 @@ vg report [--in <file>] [--format md|text|json]
458
409
 
459
410
  ---
460
411
 
412
+
461
413
  ### vg sbom
462
414
 
463
415
  Export [SBOMs](https://vibgrate.com/glossary/sbom) from an existing scan artifact or compare two artifacts.
@@ -480,6 +432,7 @@ Use this to treat SBOMs as operational intelligence instead of static compliance
480
432
 
481
433
  ---
482
434
 
435
+
483
436
  ### vg scan
484
437
 
485
438
  The primary command. Scans your project for upgrade drift.
@@ -561,6 +514,7 @@ vg scan --full
561
514
 
562
515
  ---
563
516
 
517
+
564
518
  ### vg update
565
519
 
566
520
  Check for and install updates.
@@ -576,6 +530,7 @@ vg update [--check] [--pm <manager>]
576
530
 
577
531
  ---
578
532
 
533
+
579
534
  ### vg why
580
535
 
581
536
  Explain a dependency from git history: who added it, every version since, and any open vulnerabilities it carries.
@@ -588,25 +543,88 @@ vg why <package>
588
543
 
589
544
  ---
590
545
 
591
- ## Code Graph Commands
592
546
 
593
- 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.
547
+ ## Workspace auth & cloud upload
594
548
 
595
- **Global options available on every graph command:**
549
+ Sign in to Vibgrate Cloud, manage DSN tokens for CI, and push scan results. Local drift scoring does not require this — nothing leaves your machine until you push.
596
550
 
597
- | Flag | Description |
598
- |------|-------------|
599
- | `--cwd <dir>` | Working directory (default: current) |
600
- | `--graph <file>` | Path to graph file (default: `.vibgrate/graph.json`) |
601
- | `--json` | Machine-readable JSON output |
602
- | `--quiet` | Suppress non-error output |
603
- | `--local` | Offline mode — no network calls or downloads |
604
- | `--client <name>` | Identify the AI client (e.g. `claude`) so navigation calls are counted in `vg savings` |
605
- | `--deep` | Enable deep derivation (for `vg facts`, `vg build`) |
606
- | `--no-cache` | Skip and clear cached data |
551
+ **Typical path:** `vg login` → `vg dsn create` → `vg push` → `vg logout`
552
+
553
+ ### vg dsn create
554
+
555
+ Generate an HMAC-signed DSN token for API authentication.
556
+
557
+ ```bash
558
+ vg dsn create --workspace <id|new> [--region <region>] [--ingest <url>] [--write <path>]
559
+ ```
560
+
561
+ | Flag | Default | Description |
562
+ | ------------- | ---------- | --------------------------------------------------------------------------- |
563
+ | `--workspace` | _required_ | Your workspace ID, or `new` to auto-generate a workspace |
564
+ | `--region` | `us` | Data residency region (`us`, `eu`) |
565
+ | `--ingest` | — | Custom ingest API URL (overrides `--region`) |
566
+ | `--write` | — | Write DSN to a file (add to `.gitignore`!) |
567
+
568
+ When using `--workspace new`, the CLI auto-generates a workspace ID and provisions the DSN
569
+ with the Vibgrate API. Rate limited to 1 new DSN per 5 minutes per IP address.
607
570
 
608
571
  ---
609
572
 
573
+
574
+ ### vg login
575
+
576
+ 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.
577
+
578
+ ```bash
579
+ vg login
580
+ ```
581
+
582
+ | Flag | Default | Description |
583
+ |------|---------|-------------|
584
+ | `--region <region>` | `us` | Data-residency region (`us`, `eu`) |
585
+ | `--ingest <url>` | — | Custom ingest API URL (overrides `--region`) |
586
+ | `--no-browser` | — | Print the URL to open instead of launching a browser (headless / SSH) |
587
+
588
+ ---
589
+
590
+
591
+ ### vg logout
592
+
593
+ Clear stored Vibgrate login credentials from this machine.
594
+
595
+ ```bash
596
+ vg logout
597
+ ```
598
+
599
+ ---
600
+
601
+
602
+ ### vg push
603
+
604
+ Upload scan results to the Vibgrate Cloud API.
605
+
606
+ ```bash
607
+ vg push [--dsn <dsn>] [--file <file>] [--region <region>] [--strict]
608
+ ```
609
+
610
+ | Flag | Default | Description |
611
+ | ---------- | ---------------------------- | ------------------------------------------- |
612
+ | `--dsn` | `VIBGRATE_DSN` env | DSN token for authentication |
613
+ | `--file` | `.vibgrate/scan_result.json` | Scan artifact to upload |
614
+ | `--region` | — | Override data residency region (`us`, `eu`) |
615
+ | `--strict` | — | Fail hard on upload errors |
616
+
617
+ Upload is always optional. Best-effort by default — use `--strict` in CI if you want the pipeline to fail on upload errors.
618
+
619
+ ---
620
+
621
+
622
+ ## Code Graph Commands
623
+
624
+ Build and query the deterministic code map.
625
+
626
+ **Typical path:** `vg build` → `vg status` → `vg ask` → `vg impact` → `vg share`
627
+
610
628
  ### vg ask
611
629
 
612
630
  Ask the code map a question using hybrid lexical + structural + semantic search.
@@ -630,22 +648,6 @@ Before answering, `ask` checks whether files changed since the map was last buil
630
648
 
631
649
  ---
632
650
 
633
- ### vg benchmark
634
-
635
- A reproducible build + memory + token-reduction benchmark for this repository — honest, self-measured estimates you can re-run.
636
-
637
- ```bash
638
- vg benchmark
639
- ```
640
-
641
- | Flag | Default | Description |
642
- |------|---------|-------------|
643
- | `--budget <n>` | `2000` | Approx token budget used when estimating context savings |
644
-
645
- Add `--json` for machine-readable output.
646
-
647
- ---
648
-
649
651
  ### vg build
650
652
 
651
653
  Build or update the code map incrementally.
@@ -692,6 +694,129 @@ Add `--json` for machine-readable output.
692
694
 
693
695
  ---
694
696
 
697
+ ### vg code
698
+
699
+ Propose a code edit for a plain-language instruction, grounded in the deterministic code graph. `vg code` is **dry-run by default**: it prints the proposed diff and writes nothing.
700
+
701
+ ```bash
702
+ vg code "add a --timeout flag to the scan command"
703
+ ```
704
+
705
+ **Agentic sessions.** With a real model, `vg code` is a coding *agent*, not just a one-shot editor: the model is given tools and works in steps — **search the code graph**, read files, check a symbol's blast radius, edit, create/delete files, and run your tests or build — until the task is done. Every mutating step (an edit or a command) is **governed**: you approve it, or run autonomously with `--auto`. Read-only steps (search/read/list/impact) run without prompting. `--single` forces the old one-shot diff; `--max-steps <n>` caps the loop.
706
+
707
+ **Guided mode.** Run `vg code` with no instruction at an interactive terminal and it walks you through everything: it builds the code map, then asks where the model should run — a local model, or one of the current top providers (Claude, GPT, Grok, Gemini, …) surfaced live from the catalog — and which model, with an "enter a slug myself" option at every step. Before pulling any local model it runs a memory pre-flight (estimated footprint vs free RAM/VRAM and already-loaded models) and won't pull a model your machine can't run; then it drops into an agent session where you describe tasks and approve each change. For scripts and CI, pass an instruction with `--auto` (or `--mock`) — the agent only prompts at a TTY, so automation never blocks.
708
+
709
+ While a session is active, Vibgrate Graph (`vg serve`) runs as a separate process for the life of the session and is stopped when you exit. Every graph-backed call is attributed to VG Code and the model in use, so `vg savings` reports token/$ savings **per model**.
710
+
711
+ **A full local session (no cloud):**
712
+
713
+ ```bash
714
+ # one-time: a local coding model (or: vg models install)
715
+ vg models pull qwen2.5-coder:7b
716
+
717
+ # start a guided agent session — pick "Local model" → qwen2.5-coder:7b
718
+ vg code
719
+ ```
720
+
721
+ ```text
722
+ VG Code · graph-grounded coding · v2026.x
723
+
724
+ ✔ Code map built
725
+ ✔ Model catalog loaded
726
+ ? Where should the model run?
727
+ ❯ Local model (on your machine) 1 found
728
+ Anthropic (Claude) via OpenRouter
729
+
730
+ ✔ qwen2.5-coder:7b
731
+ ◆ Ready — ollama/qwen2.5-coder:7b · graph 48213. Describe a task; empty line to exit.
732
+
733
+ code › add a --timeout flag to the scan command and use it
734
+
735
+ → search_code(query: --timeout flag scan command)
736
+ scanCommand (function) src/commands/scan.ts:12
737
+ → read_file(path: src/commands/scan.ts)
738
+ src/commands/scan.ts (40 lines): …
739
+ → graph_impact(symbol: runScan)
740
+ 3 symbol(s) depend on runScan: …
741
+ I'll add the option and thread it through.
742
+ → edit_file(path: src/commands/scan.ts, …)
743
+ --- a/src/commands/scan.ts
744
+ +++ b/src/commands/scan.ts
745
+ @@ …
746
+ + .option('--timeout <ms>', 'abort the scan after <ms> milliseconds')
747
+ ? Apply edit to src/commands/scan.ts? [Y/n] y
748
+ ✔ edited src/commands/scan.ts
749
+ → run_command(command: npm test -- scan)
750
+ ? Run `npm test -- scan`? [y/N] y
751
+ ✔ exit 0 … 12 passing
752
+ → finish(summary: added a --timeout flag to scan and covered it with tests)
753
+
754
+ ✔ added a --timeout flag to scan and covered it with tests
755
+ +6 -1 across 1 file(s) · via ollama/qwen2.5-coder:7b
756
+ ```
757
+
758
+ Run it non-interactively with `vg code "add a --timeout flag to scan" --provider ollama --model qwen2.5-coder:7b --auto`, or against a hosted model with `--provider openrouter --model anthropic/claude-3.5-sonnet` (set `OPENROUTER_API_KEY`).
759
+
760
+ **In a session** you can type slash-commands: `/undo` reverts the last change, `/diff` shows it, `/model` switches model, `/cost` shows the running token/$ cost, `/help` lists them, `/exit` quits.
761
+
762
+ **More session controls:**
763
+
764
+ - `--stream` streams the model's output live as it's generated.
765
+ - `--verify [command]` runs your tests after the agent finishes and, if they fail, feeds the failures back so it fixes them (uses the `testCommand` from config if you don't name one).
766
+ - `--continue` resumes your most recent session — it recaps what was already done for the model and restores `/undo`.
767
+ - A live **token/$ meter** shows after each task and via `/cost` (cost is shown when the model's price is known; local models are free).
768
+ - **External MCP tools:** list servers under `mcpServers` in `.vibgrate/code.json` and the agent can call their tools (namespaced `mcp__<server>__<tool>`); read-only tools run freely, anything else is approved like a built-in mutating tool. VG Code also **adopts the standard MCP config files** already in your repo — `.mcp.json` (Claude Code), `.cursor/mcp.json` (Cursor), and `.vscode/mcp.json` (VS Code) — and merges them with your `.vibgrate/code.json` (which wins on any name clash), so servers you've already configured for another tool work here with no extra setup. Both local (`command`) and remote (`url`) servers are supported.
769
+
770
+ **Tools the agent has:** searching is the code graph (`search_code`) — not a grep — plus `read_file`, `list_files`, `graph_impact` (blast radius), **`library_docs`** (version-correct docs for a dependency you actually have installed, so the model uses the right API for your version), `edit_file`, `create_file`, `delete_file`, and `run_command`.
771
+
772
+ **Safety.** The agent never sends a secrets file (`.env`, keys, credentials) to the model, and redacts stray credential shapes from any file it reads. Under `--auto`, a denylist blocks catastrophic commands (filesystem wipes, `curl … | sh`, force-push, …); interactively you see and approve each command yourself.
773
+
774
+ **Configure once** in `.vibgrate/code.json` so you can then just run `vg code` (flags still override):
775
+
776
+ ```json
777
+ {
778
+ "provider": "ollama",
779
+ "model": "qwen2.5-coder:7b",
780
+ "testCommand": "npm test",
781
+ "auto": false,
782
+ "denyCommands": ["deploy", "kubectl\\s+delete"],
783
+ "maxSteps": 24,
784
+ "mcpServers": {
785
+ "playwright": { "command": "npx", "args": ["-y", "@playwright/mcp"] }
786
+ }
787
+ }
788
+ ```
789
+
790
+ It assembles a small, high-signal context from the map (the relevant symbols, their relations, the blast radius of changing them, and any hard constraints), asks the model you choose for a minimal edit, and applies that edit through a deterministic merge so the change lands exactly where it was meant to.
791
+
792
+ Writing is opt-in and confirmed. `--apply` walks the full inspect → assess → dry-run → approve → execute → verify → log lifecycle, and still requires your explicit `--yes` (or an interactive confirmation) — there is no write-without-consent path.
793
+
794
+ ```bash
795
+ vg code "rename readCfg to readConfig everywhere it is called" --apply --yes
796
+ ```
797
+
798
+ Pick a backend with `--provider` and `--model`. No model is bundled, and nothing is installed until you first use a backend that needs it:
799
+
800
+ - **Local** — `--provider ollama` or `--provider lmstudio` (or `--local` to force on-device only, no network).
801
+ - **Hosted** — any OpenAI-compatible endpoint: `--provider openrouter` / `litellm` / `openai` / `together`. API keys are read from the environment only (e.g. `OPENROUTER_API_KEY`), never passed as flags.
802
+
803
+ With no `--provider`, `vg code` chooses from what you have already configured (a hosted key, or a locally-pulled model) and never dials a cloud endpoint you didn't set up.
804
+
805
+ | Flag | Default | Description |
806
+ |------|---------|-------------|
807
+ | `<instruction>` | — | What to change, in plain language |
808
+ | `--provider <id>` | auto | `ollama`, `lmstudio`, `openrouter`, `litellm`, `openai`, `together`, `llama-cpp` |
809
+ | `--model <id>` | — | Model id (or set `VG_CODE_MODEL`) |
810
+ | `--file <path>` | — | Restrict the edit surface to this file (repeatable) |
811
+ | `--budget <n>` | `3000` | Approx context token budget |
812
+ | `--apply` | — | Write the change (still requires `--yes` or a confirmation) |
813
+ | `--yes` | — | Consent to write, or to a first-use package install, non-interactively |
814
+ | `--local` | — | On-device backends only; never touch the network |
815
+
816
+ Add `--json` for the full machine-readable result (proposed changes, diffs, and the verification summary), or `--out <file>` to write it for CI. Requires a map — run `vg` first if you have not built one.
817
+
818
+ ---
819
+
695
820
  ### vg embed
696
821
 
697
822
  Precompute the semantic index so the next `vg ask` is instant.
@@ -791,17 +916,24 @@ Add Vibgrate AI Context to your AI assistant(s) — skill, MCP wiring, and advis
791
916
 
792
917
  ```bash
793
918
  vg install [tools...]
919
+ vg install --all
920
+ vg install --detect
921
+ vg install --list
794
922
  vg uninstall <tools...>
923
+ vg uninstall cursor --purge
795
924
  ```
796
925
 
797
926
  Idempotent and repo-local (changes can be committed and shared with your team).
798
927
 
799
- **Supported assistants:** `claude`, `cursor`, `windsurf`, `vscode`, `codex`, `gemini`
928
+ **Supported assistant ids:** `claude`, `cursor`, `windsurf`, `vscode`, `codex`, `gemini`, `grok`, `opencode`, `kilo`, `aider`, `factory`, `trae`, `kiro`, `amp`, `kimi`, `codebuddy`, `copilot-cli`, `pi`, `devin`, `hermes`, `openclaw`, `agents`
929
+
930
+ Run `vg install --list` for the live support matrix (ids can grow over time).
800
931
 
801
932
  | Flag | Description |
802
933
  |------|-------------|
803
934
  | `[tools...]` | Assistant ids to install for |
804
935
  | `--all` | Install for every supported assistant |
936
+ | `--detect` | Detect assistants in use (repo footprint, home config, PATH) and install for those; with `--list`, only report what was detected |
805
937
  | `--list` | Show the support matrix and exit |
806
938
  | `--no-hook` | Skip the advisory nudge |
807
939
 
@@ -812,6 +944,8 @@ Idempotent and repo-local (changes can be committed and shared with your team).
812
944
  | `<tools...>` | Assistant ids to remove (required) |
813
945
  | `--purge` | Also delete the skill file |
814
946
 
947
+ `vg uninstall` only removes AI-assistant wiring. To remove the CLI package from the machine, use your package manager (`npm uninstall -g @vibgrate/cli`, etc.).
948
+
815
949
  ---
816
950
 
817
951
  ### vg lib
@@ -859,150 +993,101 @@ vg oddities # Surprising cross-area links (architectural smells)
859
993
 
860
994
  ---
861
995
 
862
- ### vg models
863
-
864
- The local model fleet — Ollama, LM Studio, and on-disk `gguf` models — discovered entirely offline.
865
-
866
- ```bash
867
- vg models
868
- ```
869
-
870
- 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.
996
+ ### vg llm-host
871
997
 
872
- To fetch a model through your Ollama runtime, use the `pull` subcommand. **No model is ever downloaded by default** the download only happens when you pass `--yes`; without it, `pull` just prints the plan.
998
+ Thin **enterprise inference process** (ADR-005). Code Modes and install stay on `vg models`; this host only loads weights and decodes over a local socket when isolation is `process`.
873
999
 
874
1000
  ```bash
875
- vg models pull qwen2.5-coder:7b --yes
1001
+ vg llm-host status
1002
+ vg llm-host serve # listen on the default runtime socket
1003
+ vg llm-host serve --socket /tmp/vg-llm.sock --yes
876
1004
  ```
877
1005
 
878
- | Flag | Default | Description |
879
- |------|---------|-------------|
880
- | `<name>` | — | Model to pull, e.g. `qwen2.5-coder:7b` |
881
- | `--runtime <id>` | `ollama` | Runtime to pull with |
882
- | `--yes` | — | Actually download (without this it only prints the plan) |
1006
+ Default isolation is **embedded** (same process as the agent). Set `VIBGRATE_INFERENCE_ISOLATION=process` to use the host. Management never moves into the host process.
883
1007
 
884
- ---
885
-
886
- ### vg code
1008
+ **First-party weights.** For catalogued GGUF refs (e.g. Spark’s llama.cpp fallback), `vg models install` can download into the Vibgrate weight store under the cache directory (HTTPS hosts allowlisted, including Hugging Face LFS/Xet CDNs). Catalog entries carry **sha256 pins**; a download that does not match is rejected. Ollama remains the default pull channel for Code Mode packs that list `ollama` as primary.
887
1009
 
888
- Propose a code edit for a plain-language instruction, grounded in the deterministic code graph. `vg code` is **dry-run by default**: it prints the proposed diff and writes nothing.
1010
+ **Foundry Local.** On Windows (or any host running Microsoft Foundry Local), use `--provider foundry-local --model <id>` with the OpenAI-compatible server (default `http://127.0.0.1:5272/v1`, override with `FOUNDRY_LOCAL_BASE_URL`). `vg models status` lists models when the server responds.
889
1011
 
890
- ```bash
891
- vg code "add a --timeout flag to the scan command"
892
- ```
1012
+ **Warm local inference (Approach B default).** Code Mode packs (channel 2026.07.3) install first-party GGUF weights when fit allows; Ollama is the fallback adapter. When a GGUF is on disk (weight store or `~/models`), `vg code` prefers embedded llama.cpp automatically. Set `VG_PREFER_OLLAMA=1` to force Ollama first. Spark constrained decoding is **fail-closed**: if the binding cannot attach a PatchIR grammar, generation errors instead of free-text (opt-in raw string GBNF only via `VG_ALLOW_GRAMMAR_STRING_FALLBACK=1`).
893
1013
 
894
- **Agentic sessions.** With a real model, `vg code` is a coding *agent*, not just a one-shot editor: the model is given tools and works in steps **search the code graph**, read files, check a symbol's blast radius, edit, create/delete files, and run your tests or build — until the task is done. Every mutating step (an edit or a command) is **governed**: you approve it, or run autonomously with `--auto`. Read-only steps (search/read/list/impact) run without prompting. `--single` forces the old one-shot diff; `--max-steps <n>` caps the loop.
1014
+ **Identifier enforce (before apply).** Edits and `apply_patch` that invent identifiers not present in the code graph are **blocked** (not merely annotated). Identifiers already in the target file (locals, params, existing helpers) and tokens only in comments/strings are allowed. After an approved edit, the session trie updates so new symbols become legal.
895
1015
 
896
- **Guided mode.** Run `vg code` with no instruction at an interactive terminal and it walks you through everything: it builds the code map, then asks where the model should run a local model, or one of the current top providers (Claude, GPT, Grok, Gemini, …) surfaced live from the catalog and which model, with an "enter a slug myself" option at every step. Before pulling any local model it runs a memory pre-flight (estimated footprint vs free RAM/VRAM and already-loaded models) and won't pull a model your machine can't run; then it drops into an agent session where you describe tasks and approve each change. For scripts and CI, pass an instruction with `--auto` (or `--mock`) — the agent only prompts at a TTY, so automation never blocks.
1016
+ **Native logit mask (P1).** When node-llama-cpp exposes `TokenBias`, the warm host **boosts** tokens for graph identifiers and can **suppress** vocabulary tokens that are complete identifiers absent from the graph. Bias is cached per session/trie. Without `TokenBias`, generation still runs (post-scan annotation + enforce-before-apply remain).
897
1017
 
898
- While a session is active, Vibgrate Graph (`vg serve`) runs as a separate process for the life of the session and is stopped when you exit. Every graph-backed call is attributed to VG Code and the model in use, so `vg savings` reports token/$ savings **per model**.
1018
+ **Dynamic open-identifier sampler (P2).** When enabled (`VG_LLM_ON_TOKEN=1` or `VG_LLM_CUSTOM_SAMPLER=1`, or a binding that declares the hook), the host tracks whether generation is inside a code identifier and rejects tokens that invent graph-unknown names mid-decode. Composed with grammar + TokenBias on the same `prompt()` call.
899
1019
 
900
- **A full local session (no cloud):**
1020
+ **Warm KV prefix reuse (P1/P2).** Prompt segments are content-hashed; after the first turn, stable system/capsule blocks are warm. A multi-turn **cursor** skips already-evaluated leading blocks and only re-evaluates the delta when the binding supports evaluate-without-generate, so multi-turn TTFT does not re-prefill the full capsule every step.
901
1021
 
902
- ```bash
903
- # one-time: a local coding model (nothing is downloaded by default)
904
- vg models pull qwen2.5-coder:7b --yes
1022
+ **Speculative drafts (P2).** Graph-verbatim draft candidates are **ranked** against the user ask; the host tries accept in score order (evaluate-without-generate when available).
905
1023
 
906
- # start a guided agent session — pick "Local model" qwen2.5-coder:7b
907
- vg code
908
- ```
1024
+ **Shared host in vgd.** The daemon protocol includes `host-status`, `host-load`, `host-unload`, and `host-generate` so a long-lived process can keep a warm model for CLI and IDE clients (same session pool as embedded). Clients may pass a **client id** on load so unload is **refcounted** CLI and VS Code can share one warm model without the first exit killing the session.
909
1025
 
910
- ```text
911
- VG Code · graph-grounded coding · v2026.x
1026
+ **Hardware default mode.** `vg models mode --apply-recommend` pins the Code Mode recommended from free RAM/VRAM and repo size when no default is set. `vg doctor` surfaces the same recommendation under `localInference`.
912
1027
 
913
- Code map built
914
- ✔ Model catalog loaded
915
- ? Where should the model run?
916
- ❯ Local model (on your machine) 1 found
917
- Anthropic (Claude) via OpenRouter
918
-
919
- ✔ qwen2.5-coder:7b
920
- ◆ Ready — ollama/qwen2.5-coder:7b · graph 48213. Describe a task; empty line to exit.
1028
+ **Coding metrics (release).** `vg models coding-metrics` builds a `coding-metrics/0` report: host-bench arms + gates + offline Fusion FCS/ZNS trajectory pack. Default host mode is **simulate** (no GPU). CI runs simulate+gate on PRs; CLI publish opens a website data PR under `data/benchmarks-coding/` (human review before public claims), same pattern as CLI release benchmarks.
921
1029
 
922
- code add a --timeout flag to the scan command and use it
1030
+ **Host bench (P3).** `vg models host-bench` runs Approach B measurement arms (Ollama baseline, embedded warm, grammar, identifier enforce, TokenBias, dynamic sampler, KV delta). Default **simulate** exercises the warm host without a GPU; `--mock` is registry shells only; `--live --model-path <gguf>` is operator hardware. Add `--gate` to evaluate release gates (exit code **2** on hard failure). Use `--json` for CI artifacts.
923
1031
 
924
- → search_code(query: --timeout flag scan command)
925
- scanCommand (function) src/commands/scan.ts:12
926
- → read_file(path: src/commands/scan.ts)
927
- src/commands/scan.ts (40 lines): …
928
- → graph_impact(symbol: runScan)
929
- 3 symbol(s) depend on runScan: …
930
- I'll add the option and thread it through.
931
- → edit_file(path: src/commands/scan.ts, …)
932
- --- a/src/commands/scan.ts
933
- +++ b/src/commands/scan.ts
934
- @@ …
935
- + .option('--timeout <ms>', 'abort the scan after <ms> milliseconds')
936
- ? Apply edit to src/commands/scan.ts? [Y/n] y
937
- ✔ edited src/commands/scan.ts
938
- → run_command(command: npm test -- scan)
939
- ? Run `npm test -- scan`? [y/N] y
940
- ✔ exit 0 … 12 passing
941
- → finish(summary: added a --timeout flag to scan and covered it with tests)
942
-
943
- ✔ added a --timeout flag to scan and covered it with tests
944
- +6 -1 across 1 file(s) · via ollama/qwen2.5-coder:7b
945
- ```
946
-
947
- Run it non-interactively with `vg code "add a --timeout flag to scan" --provider ollama --model qwen2.5-coder:7b --auto`, or against a hosted model with `--provider openrouter --model anthropic/claude-3.5-sonnet` (set `OPENROUTER_API_KEY`).
948
-
949
- **In a session** you can type slash-commands: `/undo` reverts the last change, `/diff` shows it, `/model` switches model, `/cost` shows the running token/$ cost, `/help` lists them, `/exit` quits.
950
-
951
- **More session controls:**
1032
+ ---
952
1033
 
953
- - `--stream` streams the model's output live as it's generated.
954
- - `--verify [command]` runs your tests after the agent finishes and, if they fail, feeds the failures back so it fixes them (uses the `testCommand` from config if you don't name one).
955
- - `--continue` resumes your most recent session — it recaps what was already done for the model and restores `/undo`.
956
- - A live **token/$ meter** shows after each task and via `/cost` (cost is shown when the model's price is known; local models are free).
957
- - **External MCP tools:** list servers under `mcpServers` in `.vibgrate/code.json` and the agent can call their tools (namespaced `mcp__<server>__<tool>`); read-only tools run freely, anything else is approved like a built-in mutating tool. VG Code also **adopts the standard MCP config files** already in your repo — `.mcp.json` (Claude Code), `.cursor/mcp.json` (Cursor), and `.vscode/mcp.json` (VS Code) — and merges them with your `.vibgrate/code.json` (which wins on any name clash), so servers you've already configured for another tool work here with no extra setup. Both local (`command`) and remote (`url`) servers are supported.
1034
+ ### vg models
958
1035
 
959
- **Tools the agent has:** searching is the code graph (`search_code`) not a grep plus `read_file`, `list_files`, `graph_impact` (blast radius), **`library_docs`** (version-correct docs for a dependency you actually have installed, so the model uses the right API for your version), `edit_file`, `create_file`, `delete_file`, and `run_command`.
1036
+ **Code Modes** (Spark / Flow / Forge) for VG Code, plus the **local model fleet** (Ollama, LM Studio, and on-disk `gguf` files). The default view is outcome-oriented: which mode fits this machine and repo, which pack backs it, and whether it is ready.
960
1037
 
961
- **Safety.** The agent never sends a secrets file (`.env`, keys, credentials) to the model, and redacts stray credential shapes from any file it reads. Under `--auto`, a denylist blocks catastrophic commands (filesystem wipes, `curl | sh`, force-push, …); interactively you see and approve each command yourself.
1038
+ **Named install commands run by default** (same polarity as the rest of `vg`: the command does what it says). Pass `--dry-run` to print the plan only. Status/resolve never download. Destructive `rm` confirms on a TTY; non-interactive remove needs `--yes`.
962
1039
 
963
- **Configure once** in `.vibgrate/code.json` so you can then just run `vg code` (flags still override):
1040
+ `install` / `pull` install the **full provider dependency closure** for the pack (e.g. runtime npm deps for llama-cpp, then weight download for Ollama). Third-party apps such as Ollama itself are never auto-installed — install them separately if the plan lists them as blocked.
964
1041
 
965
- ```json
966
- {
967
- "provider": "ollama",
968
- "model": "qwen2.5-coder:7b",
969
- "testCommand": "npm test",
970
- "auto": false,
971
- "denyCommands": ["deploy", "kubectl\\s+delete"],
972
- "maxSteps": 24,
973
- "mcpServers": {
974
- "playwright": { "command": "npx", "args": ["-y", "@playwright/mcp"] }
975
- }
976
- }
1042
+ ```bash
1043
+ vg models # Code Modes status + fleet summary
1044
+ vg models --raw # local models only
1045
+ vg models status
1046
+ vg models mode [spark|flow|forge]
1047
+ vg models resolve [mode] # pack + model + fit (no download)
1048
+ vg models install [mode] # install the pack (add --dry-run to preview)
1049
+ vg models pin <packId>
1050
+ vg models unpin <mode>
1051
+ vg models packs
1052
+ vg models pull <name> # download (add --dry-run to preview)
1053
+ vg models uninstall <name> # uninstall (TTY confirm; --yes for CI; --dry-run to preview)
1054
+ vg models host-bench # Approach B measurement arms (default: simulate, no GPU)
1055
+ vg models coding-metrics # host-bench + Fusion FCS/ZNS report (coding-metrics/0)
1056
+ vg models catalog
977
1057
  ```
978
1058
 
979
- It assembles a small, high-signal context from the map (the relevant symbols, their relations, the blast radius of changing them, and any hard constraints), asks the model you choose for a minimal edit, and applies that edit through a deterministic merge so the change lands exactly where it was meant to.
980
-
981
- Writing is opt-in and confirmed. `--apply` walks the full inspect → assess → dry-run → approve → execute → verify → log lifecycle, and still requires your explicit `--yes` (or an interactive confirmation) — there is no write-without-consent path.
1059
+ | Mode | Intent |
1060
+ |------|--------|
1061
+ | **Spark** | Fast, small footprint quick edits and tight memory |
1062
+ | **Flow** | Balanced default for day-to-day coding |
1063
+ | **Forge** | Heavier pack when you have headroom and want more capacity |
1064
+
1065
+ | Subcommand / flag | Description |
1066
+ |-------------------|-------------|
1067
+ | `--raw` | Skip Code Modes; list discovered local models only |
1068
+ | `mode [spark\|flow\|forge]` | Show or set the default Code Mode (`--auto` clears a fixed default) |
1069
+ | `resolve [mode]` | Resolve pack + underlying model + fit without downloading |
1070
+ | `install [mode]` | Resolve and install the pack (`--dry-run` for plan only) |
1071
+ | `pin <packId>` / `unpin <mode>` | Pin or clear a reproducible pack (e.g. `flow@2026.07.1`) |
1072
+ | `packs` | List qualified Code Mode packs |
1073
+ | `pull <name>` | Download via local runtime (default Ollama; `--dry-run` for plan only) |
1074
+ | `uninstall <name>` | Uninstall a local model (`--dry-run` plan; TTY confirm or `--yes`) |
1075
+ | `host-bench` | Approach B measurement arms (`--simulate` default, `--mock`, `--live --model-path`, `--gate`) |
1076
+ | `coding-metrics` | Unified host-bench + Fusion FCS/ZNS report (`--out`, `--gate`, `--version`); publish path for release |
1077
+ | `catalog` | Live hosted model catalog (cached; not used under `--local`) |
1078
+ | `--json` | Machine-readable JSON on stdout |
982
1079
 
983
1080
  ```bash
984
- vg code "rename readCfg to readConfig everywhere it is called" --apply --yes
1081
+ vg models pull qwen2.5-coder:7b
1082
+ vg models pull qwen2.5-coder:7b --dry-run # plan only
985
1083
  ```
986
1084
 
987
- Pick a backend with `--provider` and `--model`. No model is bundled, and nothing is installed until you first use a backend that needs it:
988
-
989
- - **Local** — `--provider ollama` or `--provider lmstudio` (or `--local` to force on-device only, no network).
990
- - **Hosted** — any OpenAI-compatible endpoint: `--provider openrouter` / `litellm` / `openai` / `together`. API keys are read from the environment only (e.g. `OPENROUTER_API_KEY`), never passed as flags.
991
-
992
- With no `--provider`, `vg code` chooses from what you have already configured (a hosted key, or a locally-pulled model) and never dials a cloud endpoint you didn't set up.
993
-
994
1085
  | Flag | Default | Description |
995
1086
  |------|---------|-------------|
996
- | `<instruction>` | — | What to change, in plain language |
997
- | `--provider <id>` | auto | `ollama`, `lmstudio`, `openrouter`, `litellm`, `openai`, `together`, `llama-cpp` |
998
- | `--model <id>` | — | Model id (or set `VG_CODE_MODEL`) |
999
- | `--file <path>` | — | Restrict the edit surface to this file (repeatable) |
1000
- | `--budget <n>` | `3000` | Approx context token budget |
1001
- | `--apply` | — | Write the change (still requires `--yes` or a confirmation) |
1002
- | `--yes` | — | Consent to write, or to a first-use package install, non-interactively |
1003
- | `--local` | — | On-device backends only; never touch the network |
1004
-
1005
- Add `--json` for the full machine-readable result (proposed changes, diffs, and the verification summary), or `--out <file>` to write it for CI. Requires a map — run `vg` first if you have not built one.
1087
+ | `<name>` | — | Model to pull, e.g. `qwen2.5-coder:7b` |
1088
+ | `--runtime <id>` | `ollama` | Runtime to pull with |
1089
+ | `--dry-run` | — | Print the plan only; do not download or uninstall |
1090
+ | `--yes` | — | Skip interactive confirms (required for non-interactive `uninstall`) |
1006
1091
 
1007
1092
  ---
1008
1093
 
@@ -1068,7 +1153,7 @@ Via stdio (default), your AI assistant spawns the server. Via `--http`, it runs
1068
1153
 
1069
1154
  **Attributing CLI calls.** The MCP path detects the calling client automatically from the connection handshake. For CLI calls, pass `--client=<ai>` (e.g. `vg "how does auth work" --client=claude`) so the call is attributed in `vg savings` and any shared stats — this is what `vg install` writes into each assistant's skill. Without `--client`, a bare `vg ask` records nothing.
1070
1155
 
1071
- **The map stays fresh while you (or your AI) edit code.** Each tool call runs a cheap stat-only freshness check against the last build; when files really changed, the server rebuilds the map incrementally in-process — only changed files re-parse — and answers from the updated graph. Probes are debounced with a self-tuning cadence (2s floor, scaling with measured probe cost so probing never exceeds a few percent of serve time even on very large repos), rebuilds are single-flight and cross-process locked, and touch-only changes (a `git checkout`, a re-save with identical content) are recognized by content hash and never trigger a rebuild. There is no filesystem watcher and no daemon: freshness is checked exactly when it matters — at query time. The server also hot-reloads `graph.json` whenever it changes on disk, so an external `vg` build is picked up on the next call too.
1156
+ **The map stays fresh while you (or your AI) edit code.** Each tool call runs a cheap stat-only freshness check against the last build; when files really changed, the server rebuilds the map incrementally in-process — only changed files re-parse — and answers from the updated graph. Probes are debounced with a self-tuning cadence (2s floor, scaling with measured probe cost so probing never exceeds a few percent of serve time even on very large repos), rebuilds are single-flight and cross-process locked, and touch-only changes (a `git checkout`, a re-save with identical content) are recognized by content hash and never trigger a rebuild. There is no filesystem watcher: freshness is checked exactly when it matters — at query time. (`vg daemon` is a separate optional process for multi-workspace IDE/agent sessions; `vg serve` does not require it.) The server also hot-reloads `graph.json` whenever it changes on disk, so an external `vg` build is picked up on the next call too.
1072
1157
 
1073
1158
  The server exposes read-only tools your assistant can call over the code map and dependency data, including:
1074
1159
 
@@ -1185,6 +1270,126 @@ Add `--json` for machine-readable output.
1185
1270
 
1186
1271
  ---
1187
1272
 
1273
+ ## Diagnostics, IDE & runtime
1274
+
1275
+ Setup health, IDE language server, local workspace daemon, and context-policy pins.
1276
+
1277
+ **Typical path:** `vg doctor` → `vg lsp` → `vg daemon`
1278
+
1279
+ ### vg daemon
1280
+
1281
+ Local workspace daemon for multi-root graph sessions used by IDE extensions and coding agents. Tracks registered repository roots, can load a built map into an in-memory active graph, and answers structural queries and impact over a local socket. Does not rewrite your source tree.
1282
+
1283
+ Most developers never need this directly — Vibgrate for VS Code and `vg code` attach when needed. Use the CLI for explicit control, multi-root federation, or scripting.
1284
+
1285
+ ```bash
1286
+ vg daemon status
1287
+ vg daemon ensure
1288
+ vg daemon start
1289
+ vg daemon register
1290
+ vg daemon list
1291
+ vg daemon federation
1292
+ vg daemon publish
1293
+ vg daemon query "<text>"
1294
+ vg daemon impact <symbol>
1295
+ vg daemon graphs
1296
+ ```
1297
+
1298
+ | Subcommand | Description |
1299
+ |------------|-------------|
1300
+ | `status` | Whether the daemon is running and how many workspaces it tracks |
1301
+ | `start` | Run in the foreground (Ctrl-C to stop) |
1302
+ | `ensure` | Start in the background if not already running (idempotent; for hosts and agents) |
1303
+ | `register [root]` | Register the current (or given) repository with a running daemon |
1304
+ | `list` | List registered workspaces |
1305
+ | `federation [root]` | Register a multi-root federation from `.vibgrate/federation.json` (or primary cwd) |
1306
+ | `publish [root]` | Load the workspace code map into the daemon active graph (run `vg build` first) |
1307
+ | `query <query...>` | Lexical/structural query against the active graph |
1308
+ | `impact <symbol>` | Blast radius for a symbol in the active graph |
1309
+ | `graphs` | List multi-branch graph slots currently resident |
1310
+
1311
+ | Flag | Description |
1312
+ |------|-------------|
1313
+ | `--socket <path>` | Override the local socket path |
1314
+ | `--repository-id <id>` | On `query` / `impact` / `graphs`: target a workspace id from `vg daemon list` |
1315
+ | `--git-ref <ref>` | On `publish` / `query` / `impact`: branch or SHA |
1316
+ | `--limit <n>` | On `query`: max matches (default 12) |
1317
+ | `--depth <n>` | On `impact`: max dependency depth (default 4) |
1318
+ | `--json` | Machine-readable JSON on stdout |
1319
+
1320
+ Typical host flow:
1321
+
1322
+ ```bash
1323
+ vg build
1324
+ vg daemon ensure
1325
+ vg daemon publish
1326
+ vg daemon query "payment service"
1327
+ ```
1328
+
1329
+ ---
1330
+
1331
+ ### vg doctor
1332
+
1333
+ One read-only diagnostic pass over setup: which config file won, which credential source won (secrets never printed), whether a code map exists and how fresh it is, hosted catalog reachability, what `vg install` would register as the MCP launch, telemetry opt-outs, and **local inference** (Code Mode recommendation from free RAM/VRAM, weight catalog pin status, warm host pool size, isolation / sampler env). Prints state; changes nothing.
1334
+
1335
+ ```bash
1336
+ vg doctor
1337
+ vg doctor --json
1338
+ vg doctor --local
1339
+ ```
1340
+
1341
+ | Flag | Description |
1342
+ |------|-------------|
1343
+ | `--json` | Machine-readable JSON on stdout |
1344
+ | `--local` | Skip the hosted reachability probe |
1345
+ | `-C, --cwd <dir>` | Run as if started in that directory |
1346
+
1347
+ ---
1348
+
1349
+ ### vg lsp
1350
+
1351
+ Start the Vibgrate language server over **stdio** — the shared engine behind **Vibgrate for VS Code** and other thin IDE clients. Editors spawn this; humans rarely run it by hand.
1352
+
1353
+ ```bash
1354
+ vg lsp
1355
+ vg lsp --diagnostics
1356
+ vg lsp --no-graph
1357
+ vg lsp --no-semantic
1358
+ vg lsp --local
1359
+ ```
1360
+
1361
+ | Flag | Description |
1362
+ |------|-------------|
1363
+ | `--diagnostics` | Also publish Problems-panel diagnostics (EOL runtime, unmaintained packages, license change). **Off by default** — drift is not a defect, and the Problems panel is not filled by default. |
1364
+ | `--no-graph` | Skip the local code graph entirely: no background build; graph queries report it as turned off |
1365
+ | `--no-semantic` | Never use semantic search for graph queries (lexical only; embedding model is not downloaded) |
1366
+ | `--local` | Never touch the network (air-gapped editor sessions) |
1367
+
1368
+ The process owns stdin/stdout until the client sends `shutdown` + `exit`. Speaks standard LSP plus a custom `vibgrate/score` notification carrying the DriftScore and its **band** (never a colour) so clients can theme correctly.
1369
+
1370
+ ---
1371
+
1372
+ ### vg policy
1373
+
1374
+ Show the production **context-policy** pin used by VG Code ranking, and verify a signed `context-policy-patch/0` JSON file before any release that would bump it. Learning never mutates production policy from a single task.
1375
+
1376
+ This is not the hosted workspace policy UI in Vibgrate Cloud (banned packages, drift budgets). For dependency bans in CI, use `vg drift --fail-on standards` with a committed standards file.
1377
+
1378
+ ```bash
1379
+ vg policy
1380
+ vg policy --json
1381
+ vg policy verify ./context-policy-patch.json
1382
+ ```
1383
+
1384
+ | Subcommand | Description |
1385
+ |------------|-------------|
1386
+ | *(default)* | Print production pin and ranking version |
1387
+ | `verify <file>` | Verify a `context-policy-patch/0` JSON file (hash + optional signature + production gate) |
1388
+
1389
+ Exit non-zero from `verify` when the production gate is not ready (so CI can block a premature bump).
1390
+
1391
+ ---
1392
+
1188
1393
  ## Drift Baselines & Fitness Functions
1189
1394
 
1190
1395
  Vibgrate stores scan state under `.vibgrate/`: