Skip to main content
Commands

vg fix

Analyze drift and get ranked, risk-tiered upgrade plans. The report labels them Low-risk, Balanced, and Full; --plan takes safe, balanced, and aggressive. Scored on real-world exploitability. Preview with --no-apply or --dry-run; apply with --yes or --plan.

Overview

vg fix reads your drift — the gap between the versions you run and the latest stable releases — and returns three ranked upgrade plans, scored on real-world exploitability. It answers the question a plain outdated-dependency list can't: which upgrade should you do first?

Printing plans, previewing one plan, and applying are separate steps. --no-apply prints the plans and never touches the project. --dry-run previews the plan from --plan, or the recommended plan when --plan is omitted, and never prompts. With several plans and no --plan, --dry-run previews the recommended one. --yes applies the recommended plan. --plan <tier> applies that tier. A single plan in text output is applied directly. Several plans on a terminal are listed for you to choose. Several plans with no terminal are left unapplied until you pass --yes or --plan.

Hosted capability. Drift scoring and the code map are free and local. The ranked planner runs on Vibgrate's servers, so vg fix needs a DSN: --dsn, then VIBGRATE_DSN, then the DSN saved by vg login. It sends dependency names and versions, and aggregate usage signals (how widely each package is imported, and which symbols those imports use when the CLI can read them). When available, the request also includes the repository name and commit. Your source stays on your machine. --no-apply and --dry-run still call the planner. They do not run the package manager. Applying does, and that install reaches the registries the package manager is configured to use. In CI, set VIBGRATE_DSN from the secret store. Do not paste a token into the workflow or a committed env file.


Usage

vg fix

Analyze the current directory. Pass a path to analyze elsewhere: vg fix packages/api.


The three plans

Each plan is an ordered set of upgrades. The text report names:

  • how many drifted dependencies were analyzed, and whether the pass was preflight-only or included deep analysis of major upgrades
  • a line when any package is on the CISA KEV list, including the peak EPSS when the planner has one
  • one block per plan that actually contains upgrades: Low-risk, Balanced, or Full, marked when it is the recommendation, with a risk score out of 100, the upgrade count, the advisories that plan closes, and the DriftScore that plan would land on
  • a recommendation line with the planner's rationale

There is no sample transcript on this page. Those numbers come from the hosted planner for your repository, and the CLI cannot replay a plan without a login.

The report labels the tiers Low-risk, Balanced, and Full. --plan takes the tier id, not that label: safe is Low-risk, balanced is Balanced, and aggressive is Full. Any other value is an error that names those three ids. When two tiers list the same upgrades, the command keeps the lower-risk plan and accepts the other id as a name for that plan.


Scored on exploitability, not just severity

The ranking layers two public signals on top of advisory data, so the queue reflects what is actually happening in the wild:

  • CISA KEV — the Known Exploited Vulnerabilities catalog. A flaw on this list is being exploited now.
  • FIRST EPSS — the Exploit Prediction Scoring System, a probability of near-term exploitation.

A known-exploited, high-EPSS package outranks a higher-CVSS flaw that no one has ever weaponized.


It re-scans so the plan is current

If a manifest or lockfile changed since your last scan, vg fix re-runs the drift scan first, so recommendations describe the code you have now — not a stale snapshot. That scan contacts package registries for current versions.


Preview, then apply

vg fix --no-apply
vg fix --dry-run
vg fix --plan balanced --dry-run
vg fix --yes
vg fix --plan safe --yes

vg fix --no-apply prints the plans and never touches the project. vg fix --dry-run previews the tier you name with --plan and never prompts. With several plans and no --plan, it previews the recommended one. With only one plan that has upgrades, it previews that plan. It does not run the package manager. vg fix --yes applies the recommended plan. vg fix --plan safe applies the Low-risk tier (safe).

In CI, set VIBGRATE_DSN from the secret store:

- name: Apply the low-risk plan
  env:
    VIBGRATE_DSN: ${{ secrets.VIBGRATE_DSN }}
  run: vg fix --plan safe --yes

Do not paste a token into the workflow, onto the command line, or into a committed env file.

Applying a plan runs your project's own package manager, which reaches the registries that manager is configured to use. An advisory stays open when its upgrade does not land: blocked by policy, blocked by a peer conflict, no fixed version is published, or the install fails. A failed install restores the manifest and lockfile. --format json and --format md print a report and do not apply. The command exits non-zero if an upgrade fails.


Gate CI on exploitability

--fail-on-vulns exits non-zero when the recommended plan would still leave an advisory at or above the given severity unresolved:

vg fix --no-apply --fail-on-vulns high

Options

FlagDescription
--plan <tier>Apply safe, balanced, or aggressive with no prompt (report labels Low-risk, Balanced, and Full). With --dry-run, preview that tier instead
--no-applyPrint the plans and stop. Never modifies the project
--dry-runPreview the --plan tier. Never prompts. With several plans and no --plan, previews the recommended one. With only one plan that has upgrades, previews that plan
--yesApply the recommended plan with no prompt
--fail-on-vulns <severity>Exit non-zero if an advisory at/above low|moderate|high|critical is left unresolved
--format <format>Output format: text (default), json, or md
--in <file>Scan artifact to read (default .vibgrate/scan_result.json)
--dsn <dsn>DSN. Checked before VIBGRATE_DSN, which is checked before the DSN saved by vg login
--region <region>Data-residency region (us, eu)

Related

  • vg scan — the drift scan that feeds the planner
  • vg scan --vulns — the vulnerability data behind the ranking
  • DriftScore — the 0–100 metric each plan moves
No live demo for this command

vg fix calls the hosted Vibgrate planner and needs a login or DSN. The CLI has no offline fixture for that response, so there is nothing deterministic to replay. The report shape is described below — it is not a captured run.

Related Documentation

Related Help Articles

Vibgrate CLI

See a real scan run

A replay of the actual CLI running against our test repositories — live progress, real findings, a genuine DriftScore. Nothing executes in your browser.

Replay
demo@vibgrate — bash
❯ npx @vibgrate/cli scan
 
╭──────────────────────────────────────────╮
│ Vibgrate Drift Report │
╰──────────────────────────────────────────╯
 
── node-turborepo (node) .
Runtime: >=18.0.0 (8 majors behind)
Frameworks:
Turbo: 1.13.4 → 2.11.11 (1 behind)
TypeScript: 5.9.3 → 7.0.2 (2 behind)
Dependencies:
1 current 1 1-behind 3 2+ behind 1 unknown
 
── @repo/admin (node) apps/admin
Frameworks:
TanStack Query: 5.107.1 → 5.107.1 (current)
React: 18.3.1 → 19.3.1 (1 behind)
React DOM: 18.3.1 → 19.3.1 (1 behind)
TypeScript: 5.9.3 → 7.0.2 (2 behind)
Vite: 5.4.21 → 8.3.8 (3 behind)
Dependencies:
3 current 9 1-behind 3 2+ behind 4 unknown
 
── @repo/api (node) apps/api
Frameworks:
Express: 4.22.3 → 5.3.0 (1 behind)
TypeScript: 5.9.3 → 7.0.2 (2 behind)
Vitest: 1.6.1 → 5.1.0 (4 behind)
Dependencies:
7 current 4 1-behind 4 2+ behind 4 unknown
 
── @repo/web (node) apps/web
Frameworks:
Next.js: 14.2.35 → 16.4.6 (2 behind)
React: 18.3.1 → 19.3.1 (1 behind)
React DOM: 18.3.1 → 19.3.1 (1 behind)
TypeScript: 5.9.3 → 7.0.2 (2 behind)
Dependencies:
2 current 6 1-behind 3 2+ behind 5 unknown
 
── @repo/config (node) packages/config
Frameworks:
TypeScript: 5.9.3 → 7.0.2 (2 behind)
Dependencies:
2 current 2 1-behind 5 2+ behind 0 unknown
 
── @repo/database (node) packages/database
Frameworks:
Prisma: 5.22.0 → 7.10.1 (2 behind)
TypeScript: 5.9.3 → 7.0.2 (2 behind)
Dependencies:
1 current 0 1-behind 3 2+ behind 1 unknown
 
── @repo/types (node) packages/types
Frameworks:
TypeScript: 5.9.3 → 7.0.2 (2 behind)
Dependencies:
0 current 0 1-behind 1 2+ behind 1 unknown
 
── @repo/ui (node) packages/ui
Frameworks:
React: 18.3.1 → 19.3.1 (1 behind)
TypeScript: 5.9.3 → 7.0.2 (2 behind)
React: 18.3.1 → 19.3.1 (1 behind)
Dependencies:
1 current 4 1-behind 1 2+ behind 1 unknown
 
── @repo/utils (node) packages/utils
Frameworks:
TypeScript: 5.9.3 → 7.0.2 (2 behind)
Vitest: 1.6.1 → 5.1.0 (4 behind)
Dependencies:
0 current 1 1-behind 2 2+ behind 1 unknown
 
Tech Stack
Frontend: React, React DOM
Meta-frameworks: Next.js
Bundlers: tsx, Turbo, Vite
CSS / UI: Autoprefixer, PostCSS, Tailwind CSS
Backend: Express
ORM / Database: Prisma, Prisma Client
Testing: Vitest
Lint & Format: ESLint, ESLint Prettier, ESLint React, Prettier, typescript-eslint
 
Services & Integrations
Auth: JWT 9.0.3
Databases: Prisma 5.22.0
 
TypeScript
v5.3.3 · strict ✔ · MIXED · target: ES2022
 
Build & Deploy
Package Managers: pnpm
Monorepo: npm-workspaces, pnpm-workspaces, turbo
 
Product Purpose Signals
Frameworks: react, nextjs
Evidence: 177
Top Signals:
- [heading] Dashboard (apps/admin/src/pages/Dashboard.tsx)
- [title] Revenue Overview (apps/admin/src/pages/Dashboard.tsx)
- [copy] workspace:* (packages/ui/package.json)
- [copy] ./dist (packages/ui/tsconfig.json)
- [copy] ./src/index.ts (packages/ui/package.json)
- [copy] @repo/config/tsconfig-base.json (packages/ui/tsconfig.json)
- [copy] @repo/ui (packages/ui/package.json)
- [copy] #3b82f6 (apps/admin/src/pages/Dashboard.tsx)
Unknowns:
- No pricing or billing evidence found.
- No integrations/connectors evidence found.
- No route structure evidence found.
 
Security Posture
Lockfile ✖ · .env ✔ · node_modules ✔
 
Platform
Native modules: turbo
 
Code Quality
Files: 36 · Functions: 183 · Avg complexity: 2.62 · Avg length: 21.13 lines
Max nesting: 2 · Circular deps: 0 · Dead code: 0%
God files: apps/admin/src/pages/Products (448 lines)
 
Database Schema
postgresql · 8 models · 1 enum
Models: Address, CartItem, Category, Order, OrderItem (+3 more)
 
Findings (16 errors, 11 warnings)
✖ @types/node is 6 major versions behind (spec: ^20.11.0, latest: 26.6.6).
vibgrate/dependency-major-lag in .
✖ 60% of dependencies are 2+ major versions behind in node-turborepo.
vibgrate/dependency-rot in .
✖ Node.js runtime ">=18.0.0" reached end-of-life on 2025-04-30 (latest: 26.0.0).
vibgrate/runtime-eol in .
✖ vite is 3 major versions behind (spec: ^5.0.12, latest: 8.3.8).
vibgrate/dependency-major-lag in apps/admin
✖ Vite is 3 major versions behind (current: 5.4.21, latest: 8.3.8).
vibgrate/framework-major-lag in apps/admin
✖ @types/node is 6 major versions behind (spec: ^20.11.0, latest: 26.6.6).
vibgrate/dependency-major-lag in apps/api
✖ vitest is 4 major versions behind (spec: ^1.2.1, latest: 5.1.0).
vibgrate/dependency-major-lag in apps/api
✖ Vitest is 4 major versions behind (current: 1.6.1, latest: 5.1.0).
vibgrate/framework-major-lag in apps/api
✖ @types/node is 6 major versions behind (spec: ^20.11.0, latest: 26.6.6).
vibgrate/dependency-major-lag in apps/web
✖ eslint-plugin-react-hooks is 3 major versions behind (spec: ^4.6.0, latest: 7.1.1).
vibgrate/dependency-major-lag in packages/config
✖ 56% of dependencies are 2+ major versions behind in @repo/config.
vibgrate/dependency-rot in packages/config
✖ 75% of dependencies are 2+ major versions behind in @repo/database.
vibgrate/dependency-rot in packages/database
✖ 100% of dependencies are 2+ major versions behind in @repo/types.
vibgrate/dependency-rot in packages/types
✖ vitest is 4 major versions behind (spec: ^1.2.1, latest: 5.1.0).
vibgrate/dependency-major-lag in packages/utils
✖ 67% of dependencies are 2+ major versions behind in @repo/utils.
vibgrate/dependency-rot in packages/utils
✖ Vitest is 4 major versions behind (current: 1.6.1, latest: 5.1.0).
vibgrate/framework-major-lag in packages/utils
⚠ TypeScript is 2 major versions behind (current: 5.9.3, latest: 7.0.2).
vibgrate/framework-major-lag in .
⚠ TypeScript is 2 major versions behind (current: 5.9.3, latest: 7.0.2).
vibgrate/framework-major-lag in apps/admin
⚠ TypeScript is 2 major versions behind (current: 5.9.3, latest: 7.0.2).
vibgrate/framework-major-lag in apps/api
⚠ Next.js is 2 major versions behind (current: 14.2.35, latest: 16.4.6).
vibgrate/framework-major-lag in apps/web
⚠ TypeScript is 2 major versions behind (current: 5.9.3, latest: 7.0.2).
vibgrate/framework-major-lag in apps/web
⚠ TypeScript is 2 major versions behind (current: 5.9.3, latest: 7.0.2).
vibgrate/framework-major-lag in packages/config
⚠ Prisma is 2 major versions behind (current: 5.22.0, latest: 7.10.1).
vibgrate/framework-major-lag in packages/database
⚠ TypeScript is 2 major versions behind (current: 5.9.3, latest: 7.0.2).
vibgrate/framework-major-lag in packages/database
⚠ TypeScript is 2 major versions behind (current: 5.9.3, latest: 7.0.2).
vibgrate/framework-major-lag in packages/types
⚠ TypeScript is 2 major versions behind (current: 5.9.3, latest: 7.0.2).
vibgrate/framework-major-lag in packages/ui
⚠ TypeScript is 2 major versions behind (current: 5.9.3, latest: 7.0.2).
vibgrate/framework-major-lag in packages/utils
 
╭──────────────────────────────────────────╮
│ Top Priority Actions │
╰──────────────────────────────────────────╯
 
1. Upgrade EOL runtime in node-turborepo
End-of-life runtimes no longer receive security patches and block ecosystem upgrades.
./.
>=18.0.0 → 26.0.0 (8 majors behind)
Impact: −10 drift points (runtime & EOL)
 
2. Fix security posture: no lockfile found
Without a lockfile, installs are non-deterministic. Run the install command to generate one and commit it.
./
Missing: package-lock.json, pnpm-lock.yaml, or yarn.lock
 
3. Upgrade Vitest 1.6.1 → 5.1.0 in @repo/api (+2 more)
4 major versions behind. Major framework drift increases breaking change risk and blocks access to security fixes and performance improvements.
./apps/api
Vitest: 1.6.1 → 5.1.0 (4 majors behind)
./packages/utils
Vitest: 1.6.1 → 5.1.0 (4 majors behind)
./apps/admin
Vite: 5.4.21 → 8.3.8 (3 majors behind)
Impact: −5–15 drift points
 
4. Reduce dependency rot in @repo/types (100% severely outdated)
1 of 1 dependencies are 2+ majors behind. Run `npm outdated` and prioritise packages with known CVEs or breaking API changes.
./packages/types
typescript: 5.9.3 → 7.0.2 (2 majors behind)
Impact: −5–10 drift points
 
5. Reduce dependency rot in @repo/database (75% severely outdated)
3 of 4 dependencies are 2+ majors behind. Run `npm outdated` and prioritise packages with known CVEs or breaking API changes.
./packages/database
@prisma/client: 5.22.0 → 7.10.1 (2 majors behind)
prisma: 5.22.0 → 7.10.1 (2 majors behind)
typescript: 5.9.3 → 7.0.2 (2 majors behind)
Impact: −5–10 drift points
 
╭──────────────────────────────────────────╮
│ Architecture Layers │
╰──────────────────────────────────────────╯
 
Archetype: nextjs (80% confidence)
Files classified: 24 (11 unclassified)
Folders classified: 8
apps/admin/src presentation 100% 4 files
apps/admin/src/pages presentation 100% 2 files
apps/api/src/middleware middleware 100% 2 files
apps/api/src/routes routing 100% 2 files
apps/web/src/app presentation 100% 4 files
apps/web/src/app/products presentation 100% 2 files
apps/web/src/app/products/[id] presentation 100% 1 file
packages/ui/src presentation 100% 6 files
Unclassified source (sample): 11
 
presentation 15 files drift ████████████████████ 100 risk high
routing 4 files drift ████████████████████ 100 risk high
middleware 2 files drift ███████▍░░░░░░░░░░░░ 37 risk moderate
config 2 files drift ░░░░░░░░░░░░░░░░░░░░ 0 risk none
shared 1 file drift ████████████████████ 100 risk high
 
╭──────────────────────────────────────────╮
│ DriftScore Summary │
╰──────────────────────────────────────────╯
 
DriftScore: 70/100
Risk Level: HIGH
Projects: 9
Classified: 8 nano · 1 micro · 0 small · 0 standard
Billable: 0.42 · 9 detected → 0.42 billable projects (micro-project pricing)
0.1 micro · 0.32 nano
These fractions add up across repositories, then round down to whole billable projects.
 
Score Breakdown
Runtime: ████████████████████ 100
Frameworks: ███████████▊░░░░░░░░ 59
Dependencies: ███████░░░░░░░░░░░░░ 35
EOL Risk: ████████████████████ 100
 
Scanned at 2026-11-12T23:47:37.520Z · 5.4s · 286 files scanned · 56 workspace files · 27 dirs
❯
Press Run to start.