Skip to main content

Create Your First Drift Baseline with vg baseline

Install the Vibgrate CLI, run an initial scan, and freeze the current upgrade drift into a baseline snapshot with vg baseline. The baseline becomes the reference point for all future delta comparisons.

Difficulty
Beginner
Duration
12 minutes
Steps
5

A drift baseline is a saved snapshot of your project's upgrade drift at a moment in time. Once you have one, every later scan can be measured against it so you know whether things are getting better or worse. This tutorial walks through creating your very first baseline with the Vibgrate CLI.

Prerequisites

  • Node.js and npm installed
  • A project repository you can scan locally

Steps

1. Install the Vibgrate CLI

Install the CLI globally so the vg binary is on your PATH:

npm i -g @vibgrate/cli

Prefer not to install? You can try a scan with no install:

npx @vibgrate/cli scan

2. Run an initial scan

From the root of your project, run a bare scan. scan is the default subcommand, so plain vg scans the current directory and reports your DriftScore (0-100):

vg

Review the DriftScore and the drift findings before you freeze them into a baseline.

3. Create the baseline

Now capture the current state as a baseline snapshot:

vg baseline

This writes a baseline artifact under your project's .vibgrate directory that records the current drift state for later delta comparison.

4. Inspect the baseline file

The baseline is stored as a JSON artifact at .vibgrate/baseline.json. Open it to see the captured snapshot. You do not need to edit it by hand; the CLI manages its contents.

5. Verify the baseline

Run a scan against the baseline you just created. With no new drift, the comparison should show zero delta:

vg scan --baseline .vibgrate/baseline.json

Verification

Confirm that .vibgrate/baseline.json exists and that vg scan --baseline .vibgrate/baseline.json reports no new drift relative to the snapshot. A clean comparison and a zero exit code mean your baseline is valid.

Next Steps

  • Commit the baseline to your repository so the whole team shares the same reference.
  • Set a drift budget so CI fails when drift exceeds your threshold.

Prerequisites

  • Node.js and npm installed
  • A project repository to scan

Steps

  • 1
    Install the Vibgrate CLI
  • 2
    Run an initial scan
  • 3
    Create the baseline
  • 4
    Inspect the baseline file
  • 5
    Verify the baseline

Category

Vibgrate