Skip to main content

CLI Guide

This guide is the shortest route from "what is Vipr?" to "what can I run in my repo?"

Installation

npm install -g @vipr/cli

Or use without installing:

npx @vipr/cli analyze "src/**/*.{ts,tsx}"

What the CLI can do

Task Common flags Read next
Analyze files or globs vipr analyze [files...], --changed, --plugins, --categories, --report CLI API Reference
Shape the output --format, --output, --compact, --min-severity, --quiet JSON Output
Enforce gates --fail-threshold, --fail-on-critical CI Quality Gates
Tune runtime behavior --debug, --verbose, --timing, --env, --no-cache, --no-parallel, --no-persistent-cache CLI Commands
Scaffold config vipr init, --preset, --force, --quiet Configuration

Typical workflows

Most teams use the CLI in three ways:

  1. Local analysis while refactoring or reviewing a change.
  2. CI checks that fail when quality drops below a threshold.
  3. Scripts and bots that consume json, json-full, or markdown output.

Here are the starting points that cover those workflows:

# Analyze a specific path
vipr analyze "src/components/**/*.tsx"

# Emit structured JSON for CI or automation
vipr analyze "src/**/*.ts" --format json --output vipr-report.json

# Create a shareable Markdown report
vipr analyze "src/**/*.ts" --format markdown --output vipr-report.md

# Fail on low scores or critical findings
vipr analyze "src/**/*.ts" --fail-threshold 70 --fail-on-critical --quiet

# Scaffold a starter config
vipr init --preset strict --quiet

Good defaults

The CLI is designed to work without a config file. When you do add one, use it to lock in default formats, thresholds, cache behavior, and ignore patterns for your team.

vipr init writes the canonical vipr.config.json at the Git repository root by default. During analysis, file inputs expand first and then include, exclude, and global.ignorePatterns from config filter the target set. Config values win over Commander defaults; only explicitly passed CLI flags override them.

When you need the exact contract, use the reference pages:

Documentation