@vibgrate/cli 1.0.44 → 1.0.46

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/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  <p align="center">
2
2
  <strong>@vibgrate/cli</strong>
3
3
  <br />
4
- Continuous Upgrade Drift Intelligence for Node & .NET
4
+ Continuous Upgrade Drift Intelligence for engineering teams
5
5
  </p>
6
6
 
7
7
  <p align="center">
@@ -11,230 +11,184 @@
11
11
  <img src="https://img.shields.io/node/v/@vibgrate/cli" alt="node version" />
12
12
  </p>
13
13
 
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:
18
+
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
24
+
14
25
  ---
15
26
 
16
- Modern codebases don't break all at once — they decay silently. Node runtimes fall behind LTS. .NET frameworks approach end-of-life. Core dependencies lag multiple major versions. Upgrade cost compounds until it becomes a project in itself.
27
+ ## Why teams adopt Vibgrate
17
28
 
18
- **Vibgrate turns that invisible decay into a measurable signal.** One CLI command gives you an Upgrade Drift Score (0–100), actionable findings, and a clear picture of where your upgrade debt lives.
29
+ Most systems do not fail all at once. They accumulate upgrade debt silently until migrations become expensive.
30
+
31
+ Vibgrate makes drift measurable and repeatable:
32
+
33
+ - **Developers** run a one-off scan to understand current debt.
34
+ - **CI pipelines** run every PR/build to stop regression.
35
+ - **Engineering leaders** track trends over time in the dashboard (optional push).
19
36
 
20
37
  ---
21
38
 
22
- ## Quick Start
39
+ ## One-off scan vs CI-integrated drift tracking
40
+
41
+ | Mode | What you get | Best for |
42
+ | ---------------------- | ----------------------------------------------------------------- | -------------------------------------------- |
43
+ | **One-off scan** | Fast snapshot of score, lag, and findings | Audits, due diligence, migration planning |
44
+ | **CI-integrated scan** | Continuous drift signal, SARIF annotations, regression guardrails | Keeping upgrade debt under control long-term |
23
45
 
24
- Run instantly with npx no install required:
46
+ Recommended rollout: start with a one-off scan now, then add Vibgrate to CI this week.
47
+
48
+ ---
49
+
50
+ ## Quick start
51
+
52
+ Run instantly (no install):
25
53
 
26
54
  ```bash
27
- npx @vibgrate/cli scan
55
+ npx @vibgrate/cli scan .
28
56
  ```
29
57
 
30
- Or install as a dev dependency:
58
+ Or install locally:
31
59
 
32
60
  ```bash
33
61
  npm install -D @vibgrate/cli
62
+ npx vibgrate scan .
34
63
  ```
35
64
 
36
- Then scan your project:
65
+ Add an npm script:
37
66
 
38
- ```bash
39
- npx vibgrate scan
67
+ ```json
68
+ {
69
+ "scripts": {
70
+ "drift": "vibgrate scan ."
71
+ }
72
+ }
40
73
  ```
41
74
 
42
- > **Why `npx`?** Installing with `-D` places the binary in `node_modules/.bin/`, which isn't on your system PATH. Use `npx` to run it, or add a script to your `package.json`:
43
- >
44
- > ```json
45
- > "scripts": {
46
- > "drift": "vibgrate scan"
47
- > }
48
- > ```
49
- >
50
- > Then run `npm run drift`. Alternatively, install globally with `npm install -g @vibgrate/cli` to use `vibgrate` directly.
51
-
52
- That's it. You'll see a full drift report in seconds.
75
+ > Local binaries are in `node_modules/.bin`, so use `npx` (or an npm script) unless you install globally.
53
76
 
54
77
  ---
55
78
 
56
- ## What You Get
79
+ ## What the report contains
57
80
 
58
- ```
59
- ╭───╮➜
60
- ╭┤◉ ◉├╮ V I B G R A T E
61
- ╰┤───├╯ Drift Intelligence Engine v1.x.x
62
- ╰───╯
63
-
64
- ╔══════════════════════════════════════════╗
65
- ║ Vibgrate Drift Report ║
66
- ╚══════════════════════════════════════════╝
67
-
68
- Drift Score: 72/100
69
- Risk Level: LOW
70
- Projects: 3
71
- VCS: git main a1b2c3d
72
-
73
- Score Breakdown
74
- Runtime: ████████████████████ 100
75
- Frameworks: ████████████████░░░░ 78
76
- Dependencies: ██████████████░░░░░░ 64
77
- EOL Risk: ████████████████████ 100
78
-
79
- ── my-api (node) src/api
80
- Runtime: 20.11.0 (current)
81
- Frameworks:
82
- NestJS: 10.3.0 → 11.0.0 (1 behind)
83
- Dependencies:
84
- 42 current 8 1-behind 3 2+ behind
85
-
86
- ── web-app (node) src/web
87
- Runtime: 20.11.0 (current)
88
- Frameworks:
89
- React: 18.2.0 → 19.0.0 (1 behind)
90
- Dependencies:
91
- 31 current 5 1-behind 2 2+ behind
92
-
93
- Tech Stack
94
- Frontend: React, Tailwind CSS
95
- Bundlers: Vite
96
- Testing: Vitest, Playwright
97
- Lint & Format: ESLint, Prettier
98
-
99
- Services & Integrations
100
- Cloud: AWS SDK v3
101
- Databases: PostgreSQL
102
-
103
- TypeScript
104
- v5.4.2 · strict ✔ · ESM · target: ES2022
105
-
106
- Build & Deploy
107
- CI: GitHub Actions
108
- Docker: 2 Dockerfiles (node:20-alpine)
109
- Package Managers: pnpm
110
-
111
- Security Posture
112
- Lockfile ✔ · .env ✔ · node_modules ✔
113
-
114
- Dependency Graph
115
- pnpm-lock.yaml: 312 unique, 487 installed
116
- 5 duplicated packages
117
-
118
- Findings (2 warnings, 1 note)
119
- ⚠ Framework "NestJS" is 1 major version(s) behind
120
- framework/outdated in src/api/package.json
121
- ⚠ 12% of dependencies are 2+ major versions behind
122
- dependency/outdated in src/api/package.json
123
- ℹ TypeScript target is ES2022
124
- ts/target in tsconfig.json
125
-
126
- ╔══════════════════════════════════════════╗
127
- ║ Top Priority Actions ║
128
- ╚══════════════════════════════════════════╝
129
-
130
- 1. Upgrade NestJS 10.3.0 → 11.0.0 in my-api
131
- 1 major version behind. Major framework drift increases
132
- breaking change risk and blocks access to security fixes.
133
- ./src/api
134
- NestJS: 10.3.0 → 11.0.0 (1 behind)
135
- Impact: +5–15 points (framework score)
136
-
137
- 2. Reduce dependency rot in my-api (42% severely outdated)
138
- 3 of 53 dependencies are 2+ majors behind. Run `npm outdated`
139
- and prioritise packages with known CVEs.
140
- ./src/api
141
- express: 3.4.0 → 5.0.0 (2 majors behind)
142
- lodash: 3.10.1 → 4.17.21 (1 major behind)
143
- ... and 1 more
144
- Impact: +5–10 points (dependency score)
145
-
146
- Scanned at 2026-02-16T00:00:00.000Z · 1.2s · 48 files scanned
147
- ```
81
+ Every scan includes:
148
82
 
149
- ---
83
+ - **Overall score** and risk level
84
+ - **Score breakdown** (runtime, frameworks, dependencies, EOL)
85
+ - **Per-project details** across Node, .NET, Python, and Java
86
+ - **Actionable findings** (warnings/errors/notes)
87
+ - **Top Priority Actions** ranked by likely impact
88
+
89
+ We keep output plain and operational: easy to convert into backlog items and CI policy.
150
90
 
151
- ## Key Features
91
+ ---
152
92
 
153
- ### Upgrade Drift Score
93
+ ## New capabilities included in this release
154
94
 
155
- A single 0–100 number that tells you how upgrade-ready your codebase is. Computed from runtime lag, framework versions, dependency age distribution, and EOL proximity. Deterministic and comparable across repos.
95
+ ### 1) Multi-language workspace scanning
156
96
 
157
- ### Multi-Platform Scanning
97
+ Vibgrate recursively scans mixed repositories and supports:
158
98
 
159
- Works across **Node.js/TypeScript** and **.NET** projects in the same scan. Detects `package.json`, `.sln`, and `.csproj` files recursively.
99
+ - Node.js / TypeScript (`package.json`)
100
+ - .NET (`.sln`, `.csproj`)
101
+ - Python (`requirements.txt`, `pyproject.toml` style ecosystems)
102
+ - Java (`pom.xml`, Gradle-style manifest ecosystems)
160
103
 
161
- ### CI-Native
104
+ ### 2) Extended scanner suite
162
105
 
163
- Designed to live in your build pipeline. Returns meaningful exit codes, produces SARIF output for GitHub Code Scanning and Azure DevOps, and requires zero configuration to get started.
106
+ Beyond core drift scoring, Vibgrate can also detect:
164
107
 
165
- ### 13 Extended Scanners
108
+ - Platform matrix and native-module risk
109
+ - Dependency risk, graph duplication, and phantom dependencies
110
+ - Full tooling inventory and build/deploy surface
111
+ - TypeScript modernity and breaking-change exposure
112
+ - File hotspots and structural security posture
113
+ - Security scanner readiness (Semgrep / Gitleaks / TruffleHog)
114
+ - Service dependency mapping (cloud, db, auth, messaging, etc.)
115
+ - Architecture layer mapping
116
+ - Code-quality metrics (complexity, nesting, cycles, god files)
117
+ - OWASP category mapping from Semgrep OSS findings
166
118
 
167
- Beyond the core drift score, Vibgrate runs a suite of extended scanners — all optional, all privacy-safe:
119
+ ### 3) SBOM Export & Delta
168
120
 
169
- | Scanner | What It Finds |
170
- |---------|---------------|
171
- | **Platform Matrix** | Native modules, OS assumptions, Docker base images, architecture risks |
172
- | **Dependency Risk** | Deprecated packages, native module flags, platform-specific dependencies |
173
- | **Dependency Graph** | Duplicated packages, phantom dependencies, lockfile analysis |
174
- | **Tooling Inventory** | Full tech stack map — frameworks, bundlers, ORMs, testing tools |
175
- | **Build & Deploy** | CI systems, Docker, IaC, release tooling, monorepo tools |
176
- | **TypeScript Modernity** | Strict mode, module system, ESM readiness |
177
- | **Breaking Change Exposure** | Packages known to cause upgrade pain, legacy polyfills |
178
- | **File Hotspots** | Codebase shape — file counts, sizes, depth, shared packages |
179
- | **Security Posture** | Lockfile hygiene, `.gitignore` coverage, audit severity counts |
180
- | **Security Scanners** | Semgrep (SAST) + Gitleaks/TruffleHog readiness, version risk checks, heuristic secret signals |
181
- | **Service Dependencies** | External SDK detection — payment, auth, cloud, databases, messaging |
182
- | **Code Quality** | Cyclomatic complexity, function length, nesting depth, god files, dead-code estimate, circular imports |
183
- | **OWASP Category Mapping** | Semgrep OSS findings mapped to OWASP Top 10 categories (fast or cache-input mode) |
121
+ Vibgrate now emits rich dependency inventory data in the JSON artifact, including lockfile-derived package graphs, duplicate-version hotspots, and phantom dependencies.
184
122
 
185
- ### Baseline & Delta Tracking
123
+ This gives teams practical **SBOM-ready supply-chain visibility** for governance workflows while keeping the scan fast and CI-friendly.
186
124
 
187
- Take a baseline snapshot, then measure drift over time:
125
+ Use scan artifacts as operational SBOM intelligence in either CycloneDX or SPDX format:
188
126
 
189
127
  ```bash
190
- npx vibgrate baseline .
191
- npx vibgrate scan --baseline .vibgrate/baseline.json
128
+ npx vibgrate sbom export --format cyclonedx --out sbom.cdx.json
129
+ npx vibgrate sbom export --format spdx --out sbom.spdx.json
192
130
  ```
193
131
 
194
- ### Multiple Output Formats
132
+ Compare two scan artifacts to see dependency additions/removals/version changes between releases:
195
133
 
196
- | Format | Use Case |
197
- |--------|----------|
198
- | `text` | Terminal output, local development |
199
- | `json` | Programmatic consumption, artifact storage |
200
- | `sarif` | GitHub Code Scanning, Azure DevOps integration |
201
- | `md` | PR comments, documentation, wikis |
134
+ ```bash
135
+ npx vibgrate sbom delta --from .vibgrate/baseline.json --to .vibgrate/scan_result.json --out sbom-delta.txt
136
+ ```
202
137
 
203
- ### Dashboard Upload (Optional)
138
+ This keeps reports plain and actionable, so teams can go from scan output to backlog tasks quickly.
204
139
 
205
- Push scan results to the [Vibgrate Dashboard](https://vibgrate.com) for trend analysis, cross-repo comparison, and team-wide visibility. Upload is always opt-in — the CLI provides full value offline.
140
+ ### 4) Baseline, Drift Budgets & Fitness Gates
206
141
 
207
- The easiest way is to combine scan and push in a single command:
142
+ Take a baseline snapshot, then enforce dependency drift fitness functions in CI:
208
143
 
209
144
  ```bash
210
- VIBGRATE_DSN="..." npx @vibgrate/cli scan --push
145
+ npx vibgrate baseline .
146
+ npx vibgrate scan --baseline .vibgrate/baseline.json --drift-worsening 5 --drift-budget 40
211
147
  ```
212
148
 
213
- Or pass the DSN directly:
149
+ - `--drift-budget <score>` fails the build if absolute drift score exceeds your budget.
150
+ - `--drift-worsening <percent>` fails the build if drift worsens by more than X% relative to baseline.
151
+
152
+ This turns drift scoring into a quality gate instead of passive reporting.
153
+
154
+ ---
155
+
156
+ ## Core commands
214
157
 
215
158
  ```bash
216
- npx @vibgrate/cli scan --push --dsn "vibgrate+https://<key_id>:<secret>@us.ingest.vibgrate.com/<workspace_id>"
159
+ vibgrate scan [path] [--format text|json|sarif] [--out <file>] [--fail-on warn|error]
160
+ vibgrate baseline [path]
161
+ vibgrate report [--in <artifact.json>] [--format md|text|json]
162
+ vibgrate push [--dsn <dsn>] [--file <artifact.json>] [--strict]
163
+ vibgrate init [path] [--baseline] [--yes]
164
+ vibgrate dsn create --workspace <id> [--region us|eu] [--write <path>]
217
165
  ```
218
166
 
219
- You can also push a previously generated artifact separately:
167
+ Common usage:
220
168
 
221
169
  ```bash
222
- VIBGRATE_DSN="..." vibgrate push
223
- ```
170
+ # Standard scan
171
+ npx @vibgrate/cli scan .
224
172
 
225
- > **Get your DSN:** Sign up at [vibgrate.com](https://vibgrate.com) and your workspace will be created automatically with a ready-to-paste code snippet containing your DSN.
173
+ # CI-ready SARIF output
174
+ npx @vibgrate/cli scan . --format sarif --out vibgrate.sarif --fail-on error
175
+
176
+ # Baseline and compare drift deltas over time
177
+ npx @vibgrate/cli baseline .
178
+ npx @vibgrate/cli scan . --baseline .vibgrate/baseline.json
179
+ ```
226
180
 
227
181
  ---
228
182
 
229
- ## CI Integration
183
+ ## CI integration (recommended)
230
184
 
231
185
  ### GitHub Actions
232
186
 
233
187
  ```yaml
234
- - name: Vibgrate Scan
188
+ - name: Vibgrate scan
235
189
  env:
236
190
  VIBGRATE_DSN: ${{ secrets.VIBGRATE_DSN }}
237
- run: npx @vibgrate/cli scan --push --format sarif --out vibgrate.sarif --fail-on error
191
+ run: npx @vibgrate/cli scan . --push --format sarif --out vibgrate.sarif --fail-on error
238
192
 
239
193
  - name: Upload SARIF
240
194
  if: always()
@@ -243,63 +197,55 @@ VIBGRATE_DSN="..." vibgrate push
243
197
  sarif_file: vibgrate.sarif
244
198
  ```
245
199
 
246
- > **Setup:** Add your DSN as a repository secret named `VIBGRATE_DSN` under **Settings → Secrets and variables → Actions**. Get your DSN from [vibgrate.com](https://vibgrate.com) — it's generated automatically when you create a workspace.
247
-
248
200
  ### Azure DevOps
249
201
 
250
202
  ```yaml
251
- - script: npx @vibgrate/cli scan --format sarif --out vibgrate.sarif --fail-on error
252
- displayName: Vibgrate Scan
203
+ - script: npx @vibgrate/cli scan . --format sarif --out vibgrate.sarif --fail-on error
204
+ displayName: Vibgrate scan
253
205
  ```
254
206
 
255
- Works in any CI environment. No login required. No configuration needed.
207
+ ### GitLab CI
208
+
209
+ ```yaml
210
+ vibgrate:
211
+ image: node:20
212
+ script:
213
+ - npx @vibgrate/cli scan . --push --fail-on error
214
+ ```
256
215
 
257
216
  ---
258
217
 
259
- ## Configuration
218
+ ## Dashboard upload (optional)
260
219
 
261
- Optionally create a `vibgrate.config.ts` to customise thresholds and scanner toggles:
220
+ The CLI is fully useful offline. Upload is opt-in.
221
+
222
+ If you want trend analysis across runs/repos, push scan artifacts with a DSN:
262
223
 
263
224
  ```bash
264
- vibgrate init
225
+ VIBGRATE_DSN="vibgrate+https://<key_id>:<secret>@us.ingest.vibgrate.com/<workspace_id>" \
226
+ npx @vibgrate/cli scan . --push
265
227
  ```
266
228
 
267
- ```typescript
268
- import type { VibgrateConfig } from '@vibgrate/cli';
269
-
270
- const config: VibgrateConfig = {
271
- exclude: ['legacy/**'],
272
- thresholds: {
273
- failOnError: {
274
- eolDays: 180,
275
- frameworkMajorLag: 3,
276
- dependencyTwoPlusPercent: 50,
277
- },
278
- },
279
- };
280
-
281
- export default config;
282
- ```
229
+ You can also upload an existing artifact:
283
230
 
284
- ---
231
+ ```bash
232
+ VIBGRATE_DSN="..." npx @vibgrate/cli push --file .vibgrate/scan_result.json
233
+ ```
285
234
 
286
- ## Privacy First
235
+ Get your DSN from [vibgrate.com](https://vibgrate.com). For CI, always store it as a secret (never commit it).
287
236
 
288
- Vibgrate is designed to be safe to run on any codebase:
237
+ ---
289
238
 
290
- - **No source code content is exfiltrated** — code-quality metrics are computed locally and only aggregated numbers are emitted
291
- - **Source code is only read when explicitly needed** — core drift scanners use manifests/configs; OWASP mapping can inspect source files via Semgrep
292
- - **No secrets are scanned** — ever
293
- - **No git history, authors, or commit messages** — only HEAD SHA and branch name for traceability
294
- - **No data leaves your machine** unless you explicitly run `vibgrate push` or `vibgrate scan --push`
295
- - **No login required** — works fully offline
239
+ ## Privacy and safety
296
240
 
297
- ### `.gitignore`
241
+ - No data leaves your machine unless you run `--push` / `vibgrate push`
242
+ - Core drift analysis is based on manifests/configs
243
+ - Works without login and without SaaS dependencies
244
+ - `.vibgrate/` artifacts are local outputs and may be gitignored
298
245
 
299
- The `.vibgrate/` directory contains ephemeral scan results and should not be committed to version control. Add it to your `.gitignore`:
246
+ Add this to `.gitignore`:
300
247
 
301
248
  ```gitignore
302
- # Vibgrate scan results (do not commit)
303
249
  .vibgrate/
304
250
  ```
305
251
 
@@ -315,6 +261,8 @@ The CLI writes per-project score files to `.vibgrate/` inside each detected proj
315
261
  | `vibgrate scan --push` | Scan and auto-push to dashboard |
316
262
  | `vibgrate baseline [path]` | Create a drift baseline |
317
263
  | `vibgrate report` | Generate a report from a scan artifact |
264
+ | `vibgrate sbom export` | Export scan artifact as CycloneDX or SPDX SBOM |
265
+ | `vibgrate sbom delta` | Compare two artifacts and report SBOM drift delta |
318
266
  | `vibgrate init [path]` | Initialise config and `.vibgrate/` directory |
319
267
  | `vibgrate push` | Upload scan results to dashboard |
320
268
  | `vibgrate dsn create` | Generate a DSN token |
@@ -324,22 +272,15 @@ The CLI writes per-project score files to `.vibgrate/` inside each detected proj
324
272
 
325
273
  ## Requirements
326
274
 
327
- - **Node.js** >= 20.0.0
328
- - Works on macOS, Linux, and Windows
329
-
330
- ---
331
-
332
- ## Full Documentation
333
-
334
- See [DOCS.md](https://github.com/crowers/vibgrate-cli/blob/main/packages/vibgrate-cli/DOCS.md) for the complete reference — all commands, all flags, configuration options, extended scanner details, CI examples, and more.
275
+ - Node.js **20+**
276
+ - macOS, Linux, Windows
335
277
 
336
278
  ---
337
279
 
338
- ## Links
280
+ ## Full docs
339
281
 
340
- - [Website](https://vibgrate.com)
341
- - [Documentation](https://github.com/crowers/vibgrate-cli/blob/main/packages/vibgrate-cli/DOCS.md)
282
+ For full command reference, configuration, scanner details, and advanced examples, see [DOCS.md](./DOCS.md).
342
283
 
343
284
  ---
344
285
 
345
- Copyright © 2026 Vibgrate. All rights reserved. See [LICENSE.md](./LICENSE) for terms.
286
+ Copyright © 2026 Vibgrate. All rights reserved. See [LICENSE.md](./LICENSE.md) for terms.
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  baselineCommand,
3
3
  runBaseline
4
- } from "./chunk-LO66M6OC.js";
5
- import "./chunk-YFJC5JSQ.js";
4
+ } from "./chunk-SKROLJET.js";
5
+ import "./chunk-HEILEAVO.js";
6
6
  import "./chunk-RNVZIZNL.js";
7
7
  export {
8
8
  baselineCommand,