Skip to main content

Initialize a Project With a Baseline Using vg init --baseline

Run vg init --baseline to set up Vibgrate and capture an initial drift snapshot in one step. New projects begin with a reference baseline ready for delta comparison.

Difficulty
Beginner
Duration
10 minutes
Steps
5

vg init sets up Vibgrate in your project. Adding --baseline also captures an initial drift snapshot in the same step, so a brand-new setup already has a reference to compare against. This tutorial bootstraps both at once.

Prerequisites

  • Vibgrate CLI installed (npm i -g @vibgrate/cli)
  • A project repository

Steps

1. Install the CLI

npm i -g @vibgrate/cli

2. Run vg init with a baseline

Initialize Vibgrate and create a baseline in one command:

vg init --baseline

This creates the .vibgrate directory and config file and writes an initial baseline snapshot.

3. Review the created files

Check that the .vibgrate directory now contains your config and a baseline at .vibgrate/baseline.json.

4. Run a baseline-relative scan

Confirm the snapshot works by scanning against it:

vg scan --baseline .vibgrate/baseline.json

5. Verify initialization

With a freshly created baseline, the comparison should show no delta.

Verification

After vg init --baseline, the .vibgrate directory exists with a config file and a baseline. A baseline-relative scan reports a zero delta and exits cleanly.

Next Steps

  • Commit the .vibgrate directory so the team shares the setup.
  • Add a drift budget and a CI gate on top of the baseline.

Prerequisites

  • Vibgrate CLI installed
  • A project repository

Steps

  • 1
    Install the CLI
  • 2
    Run vg init with a baseline
  • 3
    Review the created files
  • 4
    Run a baseline-relative scan
  • 5
    Verify initialization

Category

Vibgrate