Skip to main content
Overview

Getting Started

Choose between one-off scans and CI integration. Learn the recommended workflow for adopting Vibgrate.

Overview

Getting started with Vibgrate takes less than 5 minutes. This guide walks you through installation, your first scan, and the recommended adoption path.

Quick Start: Run npx @vibgrate/cli scan in any project directory to see your drift score immediately.


Installation

Option 1: npx (Recommended for One-off Scans)

# No installation required - runs directly
npx @vibgrate/cli scan

Option 2: Global Installation

# Install globally for repeated use
npm install -g @vibgrate/cli@latest

# Now available as a command
vg scan

Option 3: Project Dependency

# Add to your project's devDependencies
npm install --save-dev @vibgrate/cli@latest

# Run via npm scripts or npx
npx @vibgrate/cli scan

Choosing a Rollout Model

Most teams adopt Vibgrate in two phases:

PhaseModePurposeCommand
📊 Phase 1One-off scanEstablish baseline, identify prioritiesnpx @vibgrate/cli scan
🔄 Phase 2CI integrationContinuous governance, prevent regressionnpx @vibgrate/cli scan --fail-on error

Tip: Start with one-off scans to understand your current state. Add CI integration once you've established a baseline and remediation plan.


End-to-End Workflow

Step 1: Run Initial Scan

# Scan your repository
npx @vibgrate/cli scan

# Example output:
# ✓ Discovered 4 projects
# ✓ Node.js: 3 projects | .NET: 1 project
# ✓ DriftScore: 67/100

Step 2: Initialize and Save Baseline

# Create .vibgrate directory and config
npx @vibgrate/cli@latest init

# Save current state as baseline
npx @vibgrate/cli@latest baseline

What's a baseline? A snapshot of your current drift state. Future scans compare against this baseline to detect regression.

Step 3: Review the Report

# Generate human-readable report
npx @vibgrate/cli@latest report --format md

# Or export for tooling
npx @vibgrate/cli@latest report --format json
npx @vibgrate/cli@latest report --format sarif

Step 4: Integrate with CI

# Add to your CI pipeline with enforcement thresholds
npx @vibgrate/cli scan \
  --baseline .vibgrate/baseline.json \
  --drift-budget 40 \
  --drift-worsening 5 \
  --fail-on error
FlagPurpose
--baselineCompare against saved baseline
--drift-budgetMaximum allowed drift score (0-100)
--drift-worseningMaximum allowed increase from baseline
--fail-onExit with error code when threshold exceeded

Expected Results

After completing the workflow, your team will have:

OutcomeBenefit
📈 Stable score trendTrack improvement over time, not just point-in-time snapshots
🚨 Early CI failuresCatch drift regression before it reaches production
📄 Export-ready reportsMarkdown, JSON, SARIF for engineering and governance
🎯 Prioritized roadmapClear list of upgrade priorities by impact

Exit Codes

Understanding exit codes is essential for CI integration:

CodeMeaningAction
0Success, no threshold violationsPipeline continues
1CLI error (invalid args, scan failure)Debug command
2Drift threshold exceededBlock merge, address findings

Project Structure

After initialization, your project will contain:

your-project/
├── .vibgrate/
│   ├── baseline.json      # Saved drift baseline
│   ├── scan_result.json   # Latest scan output
│   └── config.ts          # Vibgrate configuration
├── package.json
└── ... (your code)

Next Steps

Related Documentation

Related Help Articles