@vibgrate/cli 2026.702.2 → 2026.703.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.
Files changed (70) hide show
  1. package/DOCS.md +521 -146
  2. package/LICENSE +202 -0
  3. package/NOTICE +40 -0
  4. package/README.md +232 -250
  5. package/dist/baseline-D2T3V76P.js +6 -0
  6. package/dist/baseline-D2T3V76P.js.map +1 -0
  7. package/dist/chunk-4M2MUQRO.js +800 -0
  8. package/dist/chunk-4M2MUQRO.js.map +1 -0
  9. package/dist/chunk-E7Q3P6V7.js +6267 -0
  10. package/dist/chunk-E7Q3P6V7.js.map +1 -0
  11. package/dist/chunk-ROWQLHEX.js +31 -0
  12. package/dist/chunk-ROWQLHEX.js.map +1 -0
  13. package/dist/chunk-RXP66R2E.js +39 -0
  14. package/dist/chunk-RXP66R2E.js.map +1 -0
  15. package/dist/chunk-TVPE5CA2.js +11389 -0
  16. package/dist/chunk-TVPE5CA2.js.map +1 -0
  17. package/dist/chunk-X5YT263H.js +912 -0
  18. package/dist/chunk-X5YT263H.js.map +1 -0
  19. package/dist/cli.d.ts +44 -1
  20. package/dist/cli.js +3816 -165
  21. package/dist/cli.js.map +1 -0
  22. package/dist/fs-7KZ4F3SB.js +3 -0
  23. package/dist/fs-7KZ4F3SB.js.map +1 -0
  24. package/dist/index.d.ts +1010 -1
  25. package/dist/index.js +42 -1
  26. package/dist/index.js.map +1 -0
  27. package/dist/parse-worker.d.ts +23 -0
  28. package/dist/parse-worker.js +32 -0
  29. package/dist/parse-worker.js.map +1 -0
  30. package/dist/types-C6ZyQpa9.d.ts +168 -0
  31. package/grammars/tree-sitter-bash.wasm +0 -0
  32. package/grammars/tree-sitter-c.wasm +0 -0
  33. package/grammars/tree-sitter-c_sharp.wasm +0 -0
  34. package/grammars/tree-sitter-cpp.wasm +0 -0
  35. package/grammars/tree-sitter-dart.wasm +0 -0
  36. package/grammars/tree-sitter-elixir.wasm +0 -0
  37. package/grammars/tree-sitter-go.wasm +0 -0
  38. package/grammars/tree-sitter-java.wasm +0 -0
  39. package/grammars/tree-sitter-javascript.wasm +0 -0
  40. package/grammars/tree-sitter-kotlin.wasm +0 -0
  41. package/grammars/tree-sitter-lua.wasm +0 -0
  42. package/grammars/tree-sitter-php.wasm +0 -0
  43. package/grammars/tree-sitter-python.wasm +0 -0
  44. package/grammars/tree-sitter-ruby.wasm +0 -0
  45. package/grammars/tree-sitter-rust.wasm +0 -0
  46. package/grammars/tree-sitter-scala.wasm +0 -0
  47. package/grammars/tree-sitter-swift.wasm +0 -0
  48. package/grammars/tree-sitter-tsx.wasm +0 -0
  49. package/grammars/tree-sitter-typescript.wasm +0 -0
  50. package/grammars/tree-sitter-zig.wasm +0 -0
  51. package/package.json +68 -33
  52. package/scripts/postinstall.mjs +84 -0
  53. package/skills/README.md +58 -0
  54. package/skills/vg/SKILL.md +42 -0
  55. package/HCS-RUNTIME-SETUP.md +0 -73
  56. package/LICENSE.md +0 -45
  57. package/dist/baseline-TJDKYSFL.js +0 -1
  58. package/dist/chunk-EK7ODJWE.js +0 -1
  59. package/dist/chunk-GGDB72YE.js +0 -323
  60. package/dist/chunk-MKDRULJ6.js +0 -1
  61. package/dist/chunk-NGFYX3CW.js +0 -2
  62. package/dist/chunk-OQSVJXWJ.js +0 -143
  63. package/dist/chunk-XTHPCEME.js +0 -2
  64. package/dist/dist-5D3BKCOR.js +0 -1
  65. package/dist/fs-PXXYZATK-ZP2RBR47.js +0 -1
  66. package/dist/hcs-wasm/package.json +0 -3
  67. package/dist/hcs-wasm/vibgrate_hcs_wasm.js +0 -450
  68. package/dist/hcs-wasm/vibgrate_hcs_wasm_bg.wasm +0 -0
  69. package/dist/hcs-worker.js +0 -374406
  70. package/dist/semver-TPPMM2NV.js +0 -1
package/README.md CHANGED
@@ -1,290 +1,185 @@
1
+ <p align="center">
2
+ <a href="https://vibgrate.com"><img src="https://vibgrate.com/img/vibgrate-logo-512.png" alt="Vibgrate" width="96" height="96" /></a>
3
+ </p>
4
+
1
5
  <p align="center">
2
6
  <strong>@vibgrate/cli</strong>
3
7
  <br />
4
- Continuous Upgrade Drift Intelligence for engineering teams
8
+ Local codebase intelligence for AI coding agents — graph, drift, and version-correct docs on your machine
5
9
  </p>
6
10
 
7
11
  <p align="center">
8
12
  <a href="https://www.npmjs.com/package/@vibgrate/cli"><img src="https://img.shields.io/npm/v/@vibgrate/cli?color=blue&label=npm" alt="npm version" /></a>
9
13
  <a href="https://www.npmjs.com/package/@vibgrate/cli"><img src="https://img.shields.io/npm/dm/@vibgrate/cli?color=green" alt="npm downloads" /></a>
10
- <a href="https://vibgrate.com"><img src="https://img.shields.io/badge/website-vibgrate.com-blue" alt="website" /></a>
11
- <img src="https://img.shields.io/node/v/@vibgrate/cli" alt="node version" />
14
+ <a href="https://vibgrate.com/cli"><img src="https://img.shields.io/badge/live%20demo-vibgrate.com%2Fcli-3FB0A4" alt="live demo" /></a>
15
+ <a href="https://vibgrate.com/mcp"><img src="https://img.shields.io/badge/Vibgrate%20MCP%20(hosted)-vibgrate.com%2Fmcp-8B5CF6" alt="Vibgrate MCP (hosted)" /></a>
16
+ <a href="./LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-blue" alt="Apache 2.0" /></a>
17
+ <img src="https://img.shields.io/badge/node-%3E%3D22-brightgreen" alt="node 22+" />
12
18
  </p>
13
19
 
14
- Vibgrate gives you a clear answer to one question:
15
- **How far behind is this repo, and what should we upgrade first?**
16
-
17
- In one command, you get:
20
+ `vg` answers two questions for any repo:
18
21
 
19
- - A deterministic **Upgrade Drift Score** (0–100)
20
- - A clear risk level (**Low / Moderate / High**)
21
- - Runtime + framework major-version lag
22
- - Dependency age distribution + EOL proximity
23
- - Priority actions for what to fix next
22
+ 1. **What is this codebase?** — A deterministic code graph: call trees, import paths, impact surfaces, dependency facts.
23
+ 2. **How far behind is it?** — A ranked **Upgrade Drift Score** (0–100) with runtime/framework lag, dependency age and EOL proximity, and a prioritised fix list.
24
24
 
25
- Supported ecosystems today: **Node.js/TypeScript, .NET, Python, and Java**.
25
+ Everything runs **on your machine**. No API key, no network call, no data leaving your repo unless you explicitly push. The `vibgrate` command is an alias for `vg` — they are interchangeable.
26
26
 
27
27
  ---
28
28
 
29
- ## Why teams adopt Vibgrate
30
-
31
- Most systems do not fail all at once. They accumulate upgrade debt silently until migrations become expensive.
32
-
33
- Vibgrate makes drift measurable and repeatable:
34
-
35
- - **Developers** run a one-off scan to understand current debt.
36
- - **CI pipelines** run every PR/build to stop regression.
37
- - **Engineering leaders** track trends over time in the dashboard (optional push).
29
+ ## See it run
38
30
 
39
- ---
40
-
41
- ## One-off scan vs CI-integrated drift tracking
31
+ <p align="center">
32
+ <a href="https://vibgrate.com/cli">
33
+ <img src="docs/demo/cli-demo.svg" alt="Animated terminal replay: npx @vibgrate/cli scan produces a 74/100 drift score, a score breakdown, and ranked upgrade priorities." width="620" />
34
+ </a>
35
+ </p>
42
36
 
43
- | Mode | What you get | Best for |
44
- | ---------------------- | ----------------------------------------------------------------- | -------------------------------------------- |
45
- | **One-off scan** | Fast snapshot of score, lag, and findings | Audits, due diligence, migration planning |
46
- | **CI-integrated scan** | Continuous drift signal, SARIF annotations, regression guardrails | Keeping upgrade debt under control long-term |
37
+ <p align="center">
38
+ <sub>A real <code>vg scan</code> replay drift score, breakdown, and ranked priorities in one command. Animation plays right here on GitHub; nothing runs in your browser.</sub>
39
+ </p>
47
40
 
48
- Recommended rollout: start with a one-off scan now, then add Vibgrate to CI this week.
41
+ <p align="center">
42
+ <a href="https://vibgrate.com/cli"><strong>▶ Try the live, interactive CLI simulator →</strong></a><br />
43
+ <sub>Step through every command (<code>scan</code>, <code>build</code>, <code>ask</code>, <code>why</code>, …) against real sample repos.</sub>
44
+ </p>
49
45
 
50
46
  ---
51
47
 
52
- ## Quick start
48
+ ## Try it in 10 seconds
53
49
 
54
- Run instantly (no install):
50
+ No install, no signup:
55
51
 
56
52
  ```bash
57
- npx @vibgrate/cli scan
53
+ npx @vibgrate/cli scan # drift score + upgrade priorities
54
+ npx @vibgrate/cli build # build the code graph
55
+ npx @vibgrate/cli ask "what does AuthService do?"
58
56
  ```
59
57
 
60
- Or install locally:
58
+ Install for repeat runs:
61
59
 
62
60
  ```bash
63
61
  npm install -D @vibgrate/cli
64
- npx vibgrate scan
62
+ npx vg scan # vg is the primary command; vibgrate is an alias
65
63
  ```
66
64
 
67
- Add an npm script:
68
-
69
- ```json
70
- {
71
- "scripts": {
72
- "drift": "vibgrate scan"
73
- }
74
- }
75
- ```
76
-
77
- > Local binaries are in `node_modules/.bin`, so use `npx` (or an npm script) unless you install globally.
65
+ > Local binaries live in `node_modules/.bin` — use `npx vg` (or an npm script) unless you install globally.
78
66
 
79
67
  ---
80
68
 
81
- ## Quick start with AI assistants
82
-
83
- Paste this prompt into your AI coding tool (GitHub Copilot, Cursor, Claude, etc.) to get started:
69
+ ## Use it with your AI assistant
84
70
 
85
- ```
86
- Set up Vibgrate for upgrade drift tracking:
87
- 1. Install: npm install -g @vibgrate/cli@latest
88
- 2. Create DSN: npx vibgrate dsn create --workspace new
89
- 3. Save DSN: echo 'export VIBGRATE_DSN="<dsn>"' >> ~/.zshrc && source ~/.zshrc
90
- 4. Scan: npx vibgrate scan --push
91
- Then explain my drift score and top 3 upgrade priorities.
92
- ```
71
+ `vg serve` starts **Vibgrate AI Context** — a local-first MCP server that
72
+ gives any MCP-compatible assistant (Claude, Cursor, Windsurf, Copilot, Gemini
73
+ CLI, …) your code map, **offline drift**, local models, and **version-correct
74
+ library docs**, all from your machine (no account, nothing uploaded; thin
75
+ local docs fall through to the hosted catalog unless you pass `--local`). No
76
+ context-window stuffing, no hallucinated APIs. The map **keeps itself fresh**:
77
+ when files change including edits the assistant itself just made — the next
78
+ tool call rebuilds it incrementally before answering, with no watcher or
79
+ daemon involved.
93
80
 
94
- See [docs/QUICKSTART-PROMPT.md](./docs/QUICKSTART-PROMPT.md) for the full onboarding prompt.
81
+ Wire it up in one command:
95
82
 
96
- ---
97
-
98
- ## What the report contains
99
-
100
- Every scan includes:
83
+ ```bash
84
+ vg install # interactive: pick your assistant(s) and done
85
+ vg install --all # install for every detected assistant at once
86
+ ```
101
87
 
102
- - **Overall score** and risk level
103
- - **Score breakdown** (runtime, frameworks, dependencies, EOL)
104
- - **Per-project details** across Node, .NET, Python, and Java
105
- - **Actionable findings** (warnings/errors/notes)
106
- - **Top Priority Actions** ranked by likely impact
88
+ This writes the MCP config for your chosen tool(s) and installs a skill that teaches the assistant how to query the graph. After reloading your assistant you get graph-aware answers: call trees, impact analysis, drift findings, version-correct library docs — all from local data.
107
89
 
108
- We keep output plain and operational: easy to convert into backlog items and CI policy.
90
+ Browse all 21+ supported assistants and their skill descriptions at **[vibgrate.com/skills](https://vibgrate.com/skills)**.
109
91
 
110
92
  ---
111
93
 
112
- ## New capabilities included in this release
113
-
114
- ### 1) Multi-language workspace scanning
115
-
116
- Vibgrate recursively scans mixed repositories and supports:
117
-
118
- - Node.js / TypeScript (`package.json`)
119
- - .NET (`.sln`, `.csproj`, `.vbproj`)
120
- - Python (`requirements.txt`, `pyproject.toml` style ecosystems)
121
- - Java (`pom.xml`, Gradle-style manifest ecosystems)
122
-
123
- ### 2) Extended scanner suite
124
-
125
- Beyond core drift scoring, Vibgrate can also detect:
126
-
127
- - Platform matrix and native-module risk
128
- - Dependency risk, graph duplication, and phantom dependencies
129
- - Full tooling inventory and build/deploy surface
130
- - TypeScript modernity and breaking-change exposure
131
- - File hotspots and structural security posture
132
- - Service dependency mapping (cloud, db, auth, messaging, etc.)
133
- - Architecture layer mapping
134
- - Code-quality metrics (complexity, nesting, cycles, god files)
135
- - OWASP category mapping from security findings
94
+ ## Understand any codebase
136
95
 
137
- ### 3) SBOM Export & Delta
138
-
139
- Vibgrate now emits rich dependency inventory data in the JSON artifact, including lockfile-derived package graphs, duplicate-version hotspots, and phantom dependencies.
140
-
141
- This gives teams practical **SBOM-ready supply-chain visibility** for governance workflows while keeping the scan fast and CI-friendly.
142
-
143
- Use scan artifacts as operational SBOM intelligence in either CycloneDX or SPDX format:
96
+ Build the graph once, query it continuously:
144
97
 
145
98
  ```bash
146
- npx vibgrate sbom export --format cyclonedx --out sbom.cdx.json
147
- npx vibgrate sbom export --format spdx --out sbom.spdx.json
99
+ vg build # index the repo (incremental; re-run after changes)
100
+ vg show src/auth/service.ts # what this file does, calls, and is called by
101
+ vg ask "where is rate limiting enforced?"
102
+ vg impact src/db/connection.ts # what breaks if this changes + tests to run
103
+ vg path src/api/handler.ts src/db/query.ts # shortest call path between two files
104
+ vg tree src/server.ts # call tree rooted at a node
105
+ vg insights # overview: hubs, hotspots, untested paths
148
106
  ```
149
107
 
150
- Compare two scan artifacts to see dependency additions/removals/version changes between releases:
108
+ The graph is byte-deterministic and reproducible the same repo always produces the same graph on every machine.
151
109
 
152
110
  ```bash
153
- npx vibgrate sbom delta --from .vibgrate/baseline.json --to .vibgrate/scan_result.json --out sbom-delta.txt
111
+ vg share # make the graph committable + auto-updating for the team
112
+ vg serve # start Vibgrate AI Context (local-first MCP: code map + drift + version-correct docs)
154
113
  ```
155
114
 
156
- This keeps reports plain and actionable, so teams can go from scan output to backlog tasks quickly.
157
-
158
- ### 4) Baseline, Drift Budgets & Fitness Gates
115
+ ---
159
116
 
160
- Take a baseline snapshot, then enforce dependency drift fitness functions in CI:
117
+ ## Measure and manage upgrade drift
161
118
 
162
119
  ```bash
163
- npx vibgrate baseline
164
- npx vibgrate scan --baseline .vibgrate/baseline.json --drift-worsening 5 --drift-budget 40
120
+ vg scan # drift score + risk level + ranked priorities
121
+ vg scan --push # same, and upload to Vibgrate Cloud for trend tracking
122
+ vg baseline # snapshot current drift for regression gating
123
+ vg report # generate a report from a saved scan artifact
165
124
  ```
166
125
 
167
- - `--drift-budget <score>` fails the build if absolute drift score exceeds your budget.
168
- - `--drift-worsening <percent>` fails the build if drift worsens by more than X% relative to baseline.
126
+ One scan gives you:
169
127
 
170
- This turns drift scoring into a quality gate instead of passive reporting.
128
+ - **Overall score** (0–100) and risk level (**Low / Moderate / High**)
129
+ - **Score breakdown** — runtime, frameworks, dependencies, EOL
130
+ - **Per-project detail** across Node.js/TypeScript, .NET, Python, and Java
131
+ - **Actionable findings** ranked by likely impact
132
+ - **SBOM export** (CycloneDX / SPDX)
133
+ - **Known vulnerabilities** (opt in with `--vulns`) — severity, CVSS, the fixing version, and, in a git repo, who introduced them
171
134
 
172
135
  ---
173
136
 
137
+ ## Find known vulnerabilities and who introduced them
174
138
 
175
- ## Privacy & offline-first workflows
176
-
177
- Vibgrate now supports explicit privacy controls:
178
-
179
- - `--no-local-artifacts` prevents writing `.vibgrate/*.json` files to disk.
180
- - `--max-privacy` enables a hardened profile (suppresses local artifact writes and disables high-context scanners such as UI-purpose evidence and architecture/code-quality enrichment).
181
- - Additional commercial scanner families are available and independently toggleable in `vibgrate.config.*`: `runtimeConfiguration`, `dataStores`, `apiSurface`, `operationalResilience`, `assetBranding`, and `ossGovernance` (see `docs/commercial-grade-scanners.md`).
182
- - `--offline` disables live registry/network lookups and never uploads scan results.
183
- - `--package-manifest <file>` accepts a local JSON or ZIP package-version manifest so drift can still be calculated offline. Download the latest bundle at `https://github.com/vibgrate/manifests/latest-packages.zip`.
184
-
185
- Example:
186
-
187
- ```bash
188
- vibgrate scan --offline --package-manifest ./package-versions.zip --max-privacy --format json --out scan.json
189
- ```
190
-
191
- When offline mode runs without a package manifest, package freshness is marked as unknown and drift scoring is necessarily partial.
192
-
193
- ## Core commands
194
-
195
- ```bash
196
- vibgrate scan [path] [--format text|json|sarif|md] [--out <file>] [--fail-on warn|error] [--exclude <glob>...] [--offline] [--package-manifest <file>] [--no-local-artifacts] [--max-privacy]
197
- vibgrate baseline [path]
198
- vibgrate report [--in <artifact.json>] [--format md|text|json]
199
- vibgrate push [--dsn <dsn>] [--file <artifact.json>] [--strict]
200
- vibgrate init [path] [--baseline] [--yes]
201
- vibgrate dsn create --workspace <id|new> [--region us|eu] [--write <path>]
202
- ```
203
-
204
- ### Command examples with expected results
139
+ `vg scan --vulns` checks your installed dependencies against the public OSV database and reports each known vulnerability with its severity, CVSS score, and the version that fixes it — as text, JSON, or SARIF. Add `--package-manifest` to run it fully offline from a local advisory bundle.
205
140
 
206
141
  ```bash
207
- # 1) Scan current repo (text output)
208
- npx @vibgrate/cli scan
142
+ vg scan --vulns # drift score + known vulnerabilities
143
+ vg scan --full # drift + vulnerabilities + a banned-dependency report
209
144
  ```
210
145
 
211
- Expected result:
212
-
213
- - Prints overall score + risk level
214
- - Shows detected projects (Node/.NET/Python/Java)
215
- - Writes `.vibgrate/scan_result.json` unless disabled
146
+ In a git repository, every finding is attributed from history: who introduced the vulnerable version, in which commit, and how long you have been exposed. Those exposure windows roll up into remediation metrics framed around the EU Cyber Resilience Act (CRA) — per-severity time-exposed and SLA breaches — so "are we fixing things fast enough?" has a number.
216
147
 
217
148
  ```bash
218
- # 2) Scan with CI gating
219
- npx @vibgrate/cli scan --fail-on error --drift-budget 40
149
+ vg why lodash # who added a dependency, every version since, and any open vulnerabilities
150
+ vg bisect lodash 4.17.21 # the commit where lodash crossed a version line (e.g. reached the fix)
220
151
  ```
221
152
 
222
- Expected result:
153
+ Detection and attribution span the whole npm ecosystem (npm, pnpm, yarn) plus pip/poetry, cargo, composer, bundler, go, pub, hex, NuGet, and Maven/Gradle — read from each project's lockfile, so it works whatever you build in.
223
154
 
224
- - Exit code `0` when no error-level finding and score is within budget
225
- - Exit code `2` when the configured gate is exceeded
226
-
227
- ```bash
228
- # 3) Scan while excluding vendored / generated paths
229
- # --exclude is repeatable and accepts comma/semicolon-separated globs;
230
- # patterns are merged with `exclude` from vibgrate.config.*
231
- npx @vibgrate/cli scan --exclude "legacy/**,vendor/**" --exclude "**/*.generated.ts"
232
- ```
155
+ Your AI assistant sees this too: `vg serve` exposes `list_vulnerabilities`, `vuln_attribution`, and an `upgrade_impact` tool that tells an agent what an upgrade will cost — version distance, how many files import the package, the vulnerabilities it fixes, and (online, opt in) the breaking-change notes between your version and the latest.
233
156
 
234
- Expected result:
235
-
236
- - Matching directories and files are skipped before scanning
237
- - Excludes from the config file still apply (CLI patterns are additive)
157
+ ---
238
158
 
239
- ```bash
240
- # 4) Offline scan using local package-version bundle
241
- npx @vibgrate/cli scan --offline --package-manifest ./latest-packages.zip --format json --out scan.json
242
- ```
159
+ ## Track drift over time → create a free workspace
243
160
 
244
- Expected result:
161
+ The CLI is fully useful offline. When you want **trends across runs and repos** — so drift becomes a metric you manage, not a surprise you discover — push scans to a workspace:
245
162
 
246
- - No registry/network lookup
247
- - JSON artifact in `scan.json`
248
- - Package freshness may be marked unknown if manifest lacks entries
163
+ 1. **Create a workspace** at **[dash.vibgrate.com](https://dash.vibgrate.com)** and copy your DSN.
164
+ 2. **Connect and push:**
249
165
 
250
166
  ```bash
251
- # 5) Export SBOM and compare two runs
252
- npx @vibgrate/cli sbom export --format cyclonedx --out sbom.cdx.json
253
- npx @vibgrate/cli sbom delta --from .vibgrate/baseline.json --to .vibgrate/scan_result.json --out sbom-delta.txt
167
+ VIBGRATE_DSN="vibgrate+https://<key_id>:<secret>@us.ingest.vibgrate.com/<workspace_id>" \
168
+ vg scan --push
254
169
  ```
255
170
 
256
- Expected result:
257
-
258
- - CycloneDX (or SPDX) JSON export file
259
- - Human-readable delta report with added/removed/changed dependencies
260
-
261
- Common usage:
171
+ Upload is opt-in — nothing leaves your machine until you run `--push`. Store the DSN as a CI secret, never commit it.
262
172
 
263
- ```bash
264
- # Standard scan
265
- npx @vibgrate/cli scan
266
-
267
- # CI-ready SARIF output
268
- npx @vibgrate/cli scan --format sarif --out vibgrate.sarif --fail-on error
269
-
270
- # Baseline and compare drift deltas over time
271
- npx @vibgrate/cli baseline
272
- npx @vibgrate/cli scan --baseline .vibgrate/baseline.json
273
- ```
173
+ **[→ Create your workspace](https://dash.vibgrate.com)**
274
174
 
275
175
  ---
276
176
 
277
- ## CI integration (recommended)
177
+ ## CI integration
278
178
 
279
- ### GitHub Actions
280
-
281
- Use the maintained templates in this package for copy-paste setup:
282
-
283
- - `examples/github-actions/driftscore-ci.yml` (JSON artifact + drift gate)
284
- - `examples/github-actions/driftscore-sarif.yml` (SARIF upload to code scanning)
285
- - `docs/ci/github-actions.md` (integration notes)
179
+ Drop `vg` into any pipeline to turn drift scoring into a quality gate:
286
180
 
287
181
  ```yaml
182
+ # GitHub Actions — drift gate + SARIF upload
288
183
  - name: Vibgrate scan
289
184
  env:
290
185
  VIBGRATE_DSN: ${{ secrets.VIBGRATE_DSN }}
@@ -297,92 +192,179 @@ Use the maintained templates in this package for copy-paste setup:
297
192
  sarif_file: vibgrate.sarif
298
193
  ```
299
194
 
300
- ### Azure DevOps
195
+ Gate on drift budgets and regression relative to a baseline:
301
196
 
302
- ```yaml
303
- - script: npx @vibgrate/cli scan --format sarif --out vibgrate.sarif --fail-on error
304
- displayName: Vibgrate scan
197
+ ```bash
198
+ vg baseline
199
+ vg scan --baseline .vibgrate/baseline.json --drift-budget 40 --drift-worsening 5
305
200
  ```
306
201
 
307
- ### GitLab CI
202
+ - `--drift-budget <score>` fails the build if drift exceeds your budget.
203
+ - `--drift-worsening <percent>` fails the build if drift worsens by more than X% vs baseline.
308
204
 
309
- ```yaml
310
- vibgrate:
311
- image: node:20
312
- script:
313
- - npx @vibgrate/cli scan --push --fail-on error
314
- ```
205
+ Copy-paste CI templates live in `examples/github-actions/`. Azure DevOps and GitLab CI snippets are in [DOCS.md](./DOCS.md#ci-integration).
315
206
 
316
207
  ---
317
208
 
318
- ## Dashboard upload (optional)
209
+ ## Version-correct library docs
210
+
211
+ `vg lib` fetches usage docs pinned to the **exact version in your lockfile** — never a newer API your code can't call yet:
212
+
213
+ ```bash
214
+ vg lib react # React docs at your installed version
215
+ vg lib express --fn middleware # specific function reference
216
+ ```
217
+
218
+ AI assistants connected via MCP use `vg lib` automatically when answering questions about library APIs in your project.
319
219
 
320
- The CLI is fully useful offline. Upload is opt-in.
220
+ ---
321
221
 
322
- If you want trend analysis across runs/repos, push scan artifacts with a DSN:
222
+ ## SBOM and OpenVEX
323
223
 
324
224
  ```bash
325
- VIBGRATE_DSN="vibgrate+https://<key_id>:<secret>@us.ingest.vibgrate.com/<workspace_id>" \
326
- npx @vibgrate/cli scan --push
225
+ vg sbom export --format cyclonedx --out sbom.cdx.json
226
+ vg sbom export --format spdx --out sbom.spdx.json
227
+ vg sbom delta --from .vibgrate/baseline.json --to .vibgrate/scan_result.json --out delta.txt
228
+ vg vex # generate an OpenVEX document for attestation
327
229
  ```
328
230
 
329
- You can also upload an existing artifact:
231
+ ---
232
+
233
+ ## Privacy & offline-first
234
+
235
+ - No data leaves your machine unless you run `--push` / `vg push`.
236
+ - Core graph analysis and drift scoring read manifests and configs — **not your source code**.
237
+ - Works without login and without any SaaS dependency.
238
+ - `--offline` disables registry/network lookups; `--package-manifest <file>` feeds drift scoring a local version bundle.
239
+ - `--max-privacy` suppresses local artifact writes and high-context scanners; `--no-local-artifacts` skips writing `.vibgrate/*.json` to disk.
330
240
 
331
241
  ```bash
332
- VIBGRATE_DSN="..." npx @vibgrate/cli push --file .vibgrate/scan_result.json
242
+ vg scan --offline --package-manifest ./package-versions.zip --max-privacy --format json --out scan.json
333
243
  ```
334
244
 
335
- Get your DSN from [vibgrate.com](https://vibgrate.com). For CI, always store it as a secret (never commit it).
245
+ Add `.vibgrate/` to your `.gitignore` those are regenerated local outputs.
336
246
 
337
247
  ---
338
248
 
339
- ## Privacy and safety
340
-
341
- - No data leaves your machine unless you run `--push` / `vibgrate push`
342
- - Core drift analysis is based on manifests/configs
343
- - Works without login and without SaaS dependencies
344
- - `.vibgrate/` artifacts are local outputs and may be gitignored
249
+ ## Quick start with AI assistants
345
250
 
346
- Add this to `.gitignore`:
251
+ Paste this into your AI coding tool (Claude, Cursor, Copilot, Gemini CLI, …):
347
252
 
348
- ```gitignore
349
- .vibgrate/
253
+ ```
254
+ Set up Vibgrate for local codebase intelligence:
255
+ 1. Install: npm install -g @vibgrate/cli@latest
256
+ 2. Build the graph: vg build
257
+ 3. Wire your assistant: vg install
258
+ 4. Ask: vg ask "what are the main entry points?"
259
+ Then explain the architecture and my top 3 upgrade priorities.
350
260
  ```
351
261
 
352
- The CLI writes per-project score files to `.vibgrate/` inside each detected project directory. These are regenerated on every scan and should not be copied between environments.
262
+ See [docs/QUICKSTART-PROMPT.md](./docs/QUICKSTART-PROMPT.md) for the full prompt.
353
263
 
354
264
  ---
355
265
 
356
- ## Commands
266
+ ## Command reference
267
+
268
+ ### Code graph
357
269
 
358
270
  | Command | Description |
359
- |---------|-------------|
360
- | `vibgrate scan [path]` | Scan for upgrade drift |
361
- | `vibgrate scan --push` | Scan and auto-push to dashboard |
362
- | `vibgrate baseline [path]` | Create a drift baseline |
363
- | `vibgrate report` | Generate a report from a scan artifact |
364
- | `vibgrate sbom export` | Export scan artifact as CycloneDX or SPDX SBOM |
365
- | `vibgrate sbom delta` | Compare two artifacts and report SBOM drift delta |
366
- | `vibgrate sbom vex` | Generate an OpenVEX document (exploitability statements) for attestation |
367
- | `vibgrate scan --emit-facts` | Emit the HCS fact payload (in-toto predicate) for artifact attestation |
368
- | `vibgrate init [path]` | Initialise config and `.vibgrate/` directory |
369
- | `vibgrate push` | Upload scan results to dashboard |
370
- | `vibgrate dsn create` | Generate a DSN token |
371
- | `vibgrate update` | Check for and install updates |
271
+ | --- | --- |
272
+ | `vg build [path]` | Build / update the code map (incremental, deterministic) |
273
+ | `vg show <file>` | Explain a node: what it is, what it calls, what calls it |
274
+ | `vg ask "<question>"` | Query the map in natural language |
275
+ | `vg impact <file>` | What breaks if you change it and the tests to run |
276
+ | `vg path <from> <to>` | How A connects to B (shortest path) |
277
+ | `vg tree <file>` | Call tree rooted at a node |
278
+ | `vg insights` | Overview: hubs, hotspots, untested paths |
279
+ | `vg lib <package>` | Version-correct, drift-annotated library docs |
280
+ | `vg serve` | Start **Vibgrate AI Context** (local-first MCP: code map + drift + version-correct docs) |
281
+ | `vg install` | Wire **Vibgrate AI Context** + skill into your AI assistant |
282
+ | `vg share` | Make the graph committable + auto-updating for your team |
283
+ | `vg status` | Cache/freshness, counts, staleness |
284
+ | `vg facts <file>` | Deterministic facts for a node (contracts, invariants) |
285
+ | `vg tests <file>` | Which tests cover a node |
286
+ | `vg embed` | Precompute the semantic index for instant `vg ask` |
287
+ | `vg export` | Export the map (json / ndjson / graphml / dot / cypher / md / html / SBOM) |
288
+
289
+ ### Drift reporting
290
+
291
+ | Command | Description |
292
+ | --- | --- |
293
+ | `vg scan [path]` | Scan for upgrade drift |
294
+ | `vg scan --vulns` | Also detect known vulnerabilities (OSV; offline via `--package-manifest`) |
295
+ | `vg scan --full` | Comprehensive scan: drift + vulnerabilities + a banned-dependency report |
296
+ | `vg why <package>` | Who introduced a dependency, its version history, and any open vulnerabilities |
297
+ | `vg bisect <package> <constraint>` | The commit where a dependency crossed a version line (`--assert` to gate CI) |
298
+ | `vg scan --push` | Scan and push results to Vibgrate Cloud |
299
+ | `vg baseline [path]` | Create a drift baseline |
300
+ | `vg report` | Generate a report from a scan artifact |
301
+ | `vg sbom export` | Export CycloneDX or SPDX SBOM |
302
+ | `vg sbom delta` | Compare two artifacts for SBOM drift |
303
+ | `vg vex` | Generate an OpenVEX document for attestation |
304
+ | `vg init [path]` | Initialise config and `.vibgrate/` |
305
+ | `vg push` | Upload scan results to Vibgrate Cloud |
306
+ | `vg dsn create` | Generate a DSN token |
307
+ | `vg update` | Check for and install updates |
308
+
309
+ ```bash
310
+ vg scan [path] [--vulns] [--full] [--format text|json|sarif|md] [--out <file>] [--fail-on warn|error] \
311
+ [--offline] [--package-manifest <file>] [--no-local-artifacts] [--max-privacy] \
312
+ [--drift-budget <score>] [--drift-worsening <percent>] [--baseline <file>]
313
+ ```
314
+
315
+ Full flag and configuration reference: **[DOCS.md](./DOCS.md)** · **[vibgrate.com/cli](https://vibgrate.com/cli)**.
316
+
317
+ ---
318
+
319
+ ## Why teams adopt Vibgrate
320
+
321
+ Most systems don't fail all at once — they accumulate upgrade debt and architectural drift silently until migrations become expensive. `vg` makes that debt measurable and repeatable, and gives AI assistants the local context they need to be useful:
322
+
323
+ | Mode | What you get | Best for |
324
+ | --- | --- | --- |
325
+ | **One-off scan** | Fast snapshot of drift score, lag, and findings | Audits, due diligence, migration planning |
326
+ | **CI-integrated scan** | Continuous drift signal, SARIF annotations, regression guardrails | Keeping upgrade debt under control long-term |
327
+ | **MCP + graph** | AI assistant with real-time, offline codebase context | Day-to-day development, code review, refactoring |
328
+
329
+ Recommended rollout: `vg build` + `vg install` now, add `vg scan` to CI this week.
372
330
 
373
331
  ---
374
332
 
375
333
  ## Requirements
376
334
 
377
- - Node.js **20+**
335
+ - Node.js **22+**
378
336
  - macOS, Linux, Windows
379
337
 
380
- ---
338
+ ## Command name conflicts
339
+
340
+ `vg` is short and occasionally conflicts with other tools (`virtualgo`, `vugu`, the oh-my-zsh `git verify-commit` alias, custom shell aliases, etc.).
341
+
342
+ **`vibgrate` is an identical alias** — same binary, same flags, same behaviour. If `vg` is taken on your system, use `vibgrate` everywhere instead:
381
343
 
382
- ## Full docs
344
+ ```bash
345
+ vibgrate scan # same as: vg scan
346
+ vibgrate build # same as: vg build
347
+ vibgrate serve # same as: vg serve
348
+ ```
383
349
 
384
- For full command reference, configuration, scanner details, and advanced examples, see [CLI reference](https://vibgrate.com/cli).
350
+ When `@vibgrate/cli` is installed, it registers **both** bin entries unconditionally. If it detects at install time that `vg` is already claimed by another tool, it prints a one-line notice pointing you to `vibgrate`.
385
351
 
386
352
  ---
387
353
 
388
- Copyright © 2026 Vibgrate. All rights reserved. See [Vibgrate CLI License](https://vibgrate.com/license) for terms.
354
+ <p align="center">
355
+ <a href="https://dash.vibgrate.com"><strong>Create a free workspace →</strong></a>
356
+ &nbsp;·&nbsp;
357
+ <a href="https://vibgrate.com/cli">Try the live demo</a>
358
+ &nbsp;·&nbsp;
359
+ <a href="./DOCS.md">Vibgrate AI Context (local MCP)</a>
360
+ &nbsp;·&nbsp;
361
+ <a href="https://vibgrate.com/mcp">Vibgrate MCP (hosted)</a>
362
+ &nbsp;·&nbsp;
363
+ <a href="https://vibgrate.com/skills">AI agent skills</a>
364
+ &nbsp;·&nbsp;
365
+ <a href="./DOCS.md">Full docs</a>
366
+ </p>
367
+
368
+ <p align="center">
369
+ <sub>Apache-2.0 licensed · Copyright © 2026 Vibgrate</sub>
370
+ </p>
@@ -0,0 +1,6 @@
1
+ export { baselineCommand, runBaseline } from './chunk-ROWQLHEX.js';
2
+ import './chunk-TVPE5CA2.js';
3
+ import './chunk-RXP66R2E.js';
4
+ import './chunk-4M2MUQRO.js';
5
+ //# sourceMappingURL=baseline-D2T3V76P.js.map
6
+ //# sourceMappingURL=baseline-D2T3V76P.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"baseline-D2T3V76P.js"}