Skip to main content

Install the Vibgrate CLI with npm

Install the Vibgrate CLI globally or per-project with npm, understand the difference, and confirm the vg command runs your first scan.

Vibgrate Docs

Vibgrate Help

This article shows how to install the Vibgrate CLI (@vibgrate/cli) using npm. npm ships with Node.js, so it is the default choice for most JavaScript and TypeScript developers.

Global install

A global install puts vg on your PATH so you can scan any project from anywhere:

npm install -g @vibgrate/cli

Verify it:

vg --version

Scan the current directory by running the bare command:

vg

Vibgrate reports a DriftScore from 0 to 100 along with the findings.

Per-project install

To pin a specific CLI version for a repository, add it as a dev dependency:

npm install --save-dev @vibgrate/cli

Run it through npm scripts or with npx so the project-local version is used:

npx vg

Add a script to package.json for convenience:

{
  "scripts": {
    "drift": "vg scan --fail-on error"
  }
}

Global vs per-project

  • A global install is best for ad hoc scans across many repositories.
  • A per-project dev dependency pins the version and keeps CI reproducible.

See the dedicated global vs npx article for help choosing.

Upgrading

Reinstall to get the latest version, or use the built-in updater:

vg update

Troubleshooting

  • Permission errors — prefer a Node version manager (nvm or fnm) over sudo.
  • vg: command not found — make sure your global npm bin directory is on PATH, or run via npx vg.

Related

Compare other package managers in the pnpm, yarn, and bun guide, or run Vibgrate with no install using npx @vibgrate/cli scan.

Related Commands