npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

Iโ€™ve always been into building performant and accessible sites, but lately Iโ€™ve been taking it extremely seriously. So much so that Iโ€™ve been building a tool to help me optimize and monitor the sites that I build to make sure that Iโ€™m making an attempt to offer the best experience to those who visit them. If youโ€™re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, ๐Ÿ‘‹, Iโ€™m Ryan Hefnerย  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If youโ€™re interested in other things Iโ€™m working on, follow me on Twitter or check out the open source projects Iโ€™ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soonโ€“ish.

Open Software & Tools

This site wouldnโ€™t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you ๐Ÿ™

ยฉ 2026 โ€“ย Pkg Stats / Ryan Hefner

vibrant-cli

v0.1.3

Published

๐Ÿ”ฎ The AI-powered code analyzer that detects vibecoding patterns, security vulnerabilities, and bugs before they reach production

Readme


Table of Contents


Why Vibrant?

You're using AI to write code. It's fast. It's convenient. But sometimes it ships bugs, hardcoded secrets, and patterns that scream "I wasn't reviewed by a human."

Vibrant catches what AI misses.

The Problem

// AI generated this. Looks fine, right?
const API_KEY = "sk-proj-abc123..."; // Oops, hardcoded secret

async function fetchUser(id) {
  console.log("Fetching user:", id); // Debug code left in
  try {
    const res = await fetch(`/users/${id}`);
    return res.json();
  } catch (e) {} // Silent failure - bugs waiting to happen
}

The Solution

Vibrant analyzes your codebase and catches:

  • ๐Ÿ” Hardcoded secrets - API keys, passwords, tokens
  • ๐Ÿ› Silent failures - Empty catch blocks, unhandled errors
  • ๐Ÿค– AI telltales - console.log, TODO comments, generic names
  • โšก Security issues - SQL injection, XSS vulnerabilities

Features

โœ… Static Analysis

Fast, offline detection using TypeScript's AST. No API keys required.

๐Ÿง  AI-Powered Deep Analysis

Optional AI analysis for patterns static analysis can't catch. Works with OpenAI, Claude, Gemini, Ollama, and OpenRouter.

๐Ÿ›ก๏ธ Security First

Built-in detection for hardcoded credentials, SQL injection, XSS, and other security vulnerabilities.

๐Ÿ“Š Multiple Output Formats

Pretty output for humans, JSON for CI/CD, Plan format for AI agents to auto-fix.

๐Ÿ”ง Auto-Fix

Some issues can be automatically fixed with --fix.

๐Ÿš€ Fast

~200ms for 100 files (static analysis). Incremental caching for AI analysis.

๐Ÿ“ฆ Zero Config

Works out of the box. Configure only what you need.


Installation

Using npx (No Installation)

npx vibrant-cli .

Global Installation

npm install -g vibrant-cli
vibrant .

Using Bun

bun install -g vibrant-cli
vibrant .

Quick Start

Step 1: Basic Analysis

Run static analysis on your codebase:

vibrant .

Output:

  ๐Ÿ”ฎ Vibrant Analysis
  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

  โœ” Analysis complete

  โœ• src/api.ts:24:5
    โ””โ”€ hardcoded-credentials
       API key hardcoded in source code

       24|   const API_KEY = "sk-abc123...";

       โ†’ Use environment variables instead

  โš  src/utils.ts:85:1
    โ””โ”€ empty-catch-block
       Empty catch block swallows errors

       85|   } catch (e) {}

       โ†’ Log or handle the error properly

  โœ• 1 error ยท โš  1 warning ยท 48 files ยท 200ms

Step 2: Analyze Specific Paths

# Analyze a specific file
vibrant src/api.ts

# Analyze with glob pattern
vibrant "src/**/*.ts"

# Ignore certain paths
vibrant . --ignore "dist,coverage,*.test.ts"

Step 3: AI-Powered Analysis

Enable AI for deeper code understanding:

# Requires an API key (see AI Providers section)
vibrant . --ai

# Use a specific provider
vibrant . --ai --provider openrouter

AI analysis provides:

  • ๐Ÿ“‹ Summary - Overall code health assessment
  • ๐Ÿ” Key Findings - Most important issues to address
  • ๐Ÿ’ก Recommendations - Actionable next steps

Step 4: Auto-Fix Issues

Some issues can be automatically fixed:

vibrant . --fix

AI Providers

Vibrant supports multiple AI providers for deep code analysis:

| Provider | Environment Variable | Free Tier | Recommended Model | | -------------- | ------------------------------ | -------------- | ---------------------------------- | | OpenRouter | OPENROUTER_API_KEY | โœ… Free models | google/gemini-2.0-flash-lite-001 | | Gemini | GOOGLE_GENERATIVE_AI_API_KEY | โœ… Free tier | gemini-2.0-flash-lite | | OpenAI | OPENAI_API_KEY | โŒ Paid | gpt-4o-mini | | Claude | ANTHROPIC_API_KEY | โŒ Paid | claude-3-haiku-20240307 | | Ollama | OLLAMA_HOST | โœ… Local, free | llama3.2 |

Setup Options

Option 1: Environment Variable

export OPENROUTER_API_KEY="sk-or-v1-..."
vibrant . --ai

Option 2: .env File

echo 'OPENROUTER_API_KEY="sk-or-v1-..."' > .env
vibrant . --ai

Option 3: Config File

vibrant init
# Edit vibrant.config.js
vibrant . --ai

Provider-Specific Setup

# OpenRouter (recommended - free models available)
export OPENROUTER_API_KEY="sk-or-v1-..."
vibrant . --ai --provider openrouter

# Google Gemini (free tier)
export GOOGLE_GENERATIVE_AI_API_KEY="AIza..."
vibrant . --ai --provider gemini

# OpenAI
export OPENAI_API_KEY="sk-..."
vibrant . --ai --provider openai

# Anthropic Claude
export ANTHROPIC_API_KEY="sk-ant-..."
vibrant . --ai --provider claude

# Ollama (local, requires Ollama installed)
ollama pull llama3.2
export OLLAMA_HOST="http://localhost:11434"
vibrant . --ai --provider ollama

Detection Rules

Security Rules

| Rule | Description | Severity | Auto-fix | | ----------------------- | ------------------------------------------- | -------- | -------- | | hardcoded-credentials | Detects API keys, passwords, tokens in code | Error | No | | no-sql-injection | Detects SQL injection vulnerabilities | Error | No | | no-unsafe-inner-html | Detects XSS via innerHTML | Error | No |

Bug Prevention Rules

| Rule | Description | Severity | Auto-fix | | --------------------- | ------------------------------------ | -------- | -------- | | empty-catch-block | Empty catch blocks swallow errors | Error | Yes | | unimplemented-error | throw new Error('not implemented') | Error | No | | empty-function-body | Functions with no implementation | Error | No | | no-unreachable | Unreachable code after return/throw | Error | No |

Code Quality Rules

| Rule | Description | Severity | Auto-fix | | ----------------------- | -------------------------- | -------- | -------- | | console-log-debugging | console.log left in code | Warning | Yes | | no-explicit-any | Usage of any type | Warning | No | | no-await-in-loop | Sequential awaits in loops | Warning | No |

List All Rules

vibrant rules

Output:

  ๐Ÿ“‹ Available Detection Rules

  Security
  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
  hardcoded-credentials    Hardcoded API keys, passwords
  no-sql-injection         SQL injection vulnerabilities
  no-unsafe-inner-html     XSS via innerHTML

  Bugs
  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
  empty-catch-block        Empty catch blocks
  unimplemented-error      Unimplemented code
  empty-function-body      Empty functions
  no-unreachable           Unreachable code

  Code Quality
  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
  console-log-debugging    Debug console.log
  no-explicit-any          Any type usage
  no-await-in-loop         Await in loops

Output Formats

Pretty (Default)

Human-readable output with colors:

vibrant .

JSON

For CI/CD pipelines and tooling:

vibrant . --format json
{
  "summary": {
    "filesAnalyzed": 48,
    "errorCount": 1,
    "warningCount": 2,
    "duration": 10234
  },
  "results": [
    {
      "file": "src/api.ts",
      "diagnostics": [
        {
          "line": 24,
          "column": 5,
          "severity": "error",
          "ruleId": "hardcoded-credentials",
          "message": "API key hardcoded in source code"
        }
      ]
    }
  ]
}

Plan

Generate vibrant-report.md with detailed analysis for AI assistants:

vibrant . --format plan

The plan format includes:

  • ๐Ÿ“‹ Complete issue list with code snippets
  • ๐Ÿ’ก Suggested fixes for each issue
  • ๐Ÿ“Š Priority ordering (errors first)

Perfect for feeding to AI agents that can auto-fix your code.

Compact

Single-line output for CI pipelines:

vibrant . --format compact
src/api.ts:24:5 error hardcoded-credentials API key in source
src/utils.ts:85:1 warning empty-catch-block Swallows errors

Configuration

Create Config File

vibrant init

Configuration Options

// vibrant.config.js
module.exports = {
  // Directories to ignore during analysis
  ignore: ["node_modules", ".git", "dist", ".next", "build", "coverage"],

  // Output format: 'pretty', 'compact', 'plan', or 'json'
  format: "pretty",

  // Default AI provider (optional)
  // provider: 'openrouter',
};

Rule Configuration

module.exports = {
  rules: {
    // Security - Always error
    "hardcoded-credentials": "error",
    "no-sql-injection": "error",

    // Bugs - Always error
    "empty-catch-block": "error",
    "unimplemented-error": "error",

    // Code Quality - Warnings
    "console-log-debugging": "warn",
    "no-explicit-any": "warn",

    // Disable specific rules
    "no-await-in-loop": "off",
  },
};

CLI Reference

Commands

vibrant [path]           # Analyze code (default: current directory)
vibrant init             # Create vibrant.config.js
vibrant rules            # List all detection rules
vibrant --help           # Show help
vibrant --version        # Show version

Options

| Option | Short | Description | | --------------------- | ----- | -------------------------------------------------------- | | --ai | | Enable AI-powered analysis | | --provider <name> | -p | AI provider (openai, claude, gemini, ollama, openrouter) | | --format <type> | -f | Output format (pretty, compact, json, plan) | | --fix | | Auto-fix fixable issues | | --ignore <patterns> | | Comma-separated patterns to ignore |

Examples

# Basic analysis
vibrant .

# AI analysis with specific provider
vibrant . --ai --provider openrouter

# JSON output for CI
vibrant . --format json > report.json

# Auto-fix issues
vibrant . --fix

# Analyze specific files
vibrant "src/**/*.ts" --ignore "*.test.ts"

# Compact output
vibrant . --format compact

How It Works

1. Smart Summarizer

Before sending code to AI, Vibrant summarizes it:

## src/api.ts

Suspicious:
L24|const API_KEY = "sk-abc";  // secret detected
L45|console.log("debug");      // console.log
L89|} catch (e) {}             // empty catch

Functions:
L10|async fn fetchData(url: string)
L60|fn processResult(data: any)

Benefits:

  • 50-60% token reduction
  • Maintains detection accuracy
  • Focuses AI on suspicious code

2. Static Analysis

Vibrant runs built-in rules using TypeScript's AST:

  1. Parse source files with TypeScript
  2. Walk the AST tree
  3. Apply each rule's visitor functions
  4. Collect and report diagnostics

3. AI Analysis

When --ai is enabled:

  1. Summarize all files with the Smart Summarizer
  2. Send to configured AI provider
  3. Parse structured response
  4. Merge with static analysis results

CI/CD Integration

GitHub Actions

name: Code Quality

on: [push, pull_request]

jobs:
  analyze:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Setup Node
        uses: actions/setup-node@v4
        with:
          node-version: "20"

      - name: Install Vibrant
        run: npm install -g vibrant-cli

      - name: Run Analysis
        run: vibrant . --format compact
        env:
          OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}

GitLab CI

code-quality:
  image: node:20
  script:
    - npm install -g vibrant-cli
    - vibrant . --format compact
  variables:
    OPENROUTER_API_KEY: $OPENROUTER_API_KEY

Exit Codes

| Code | Meaning | | ---- | ------------------------------ | | 0 | No issues found | | 1 | Issues found or error occurred |


API Reference

Programmatic Usage

import { lintFiles, loadConfig } from "vibrant-cli";

const config = await loadConfig();
const results = await lintFiles("./src", config);

console.log(results);
// {
//   summary: { filesAnalyzed: 48, errorCount: 1, warningCount: 2 },
//   results: [...]
// }

With AI Analysis

import { lintFiles, loadConfig, analyzeWithAI } from "vibrant-cli";

const config = await loadConfig();

// Static analysis
const staticResults = await lintFiles("./src", config);

// AI analysis
const aiResults = await analyzeWithAI("./src", {
  provider: "openrouter",
  apiKey: process.env.OPENROUTER_API_KEY,
});

// Merge results
const allResults = mergeResults(staticResults, aiResults);

Performance

| Scenario | Time | | ----------------------------- | ------ | | Static analysis (100 files) | ~200ms | | Static analysis (500 files) | ~800ms | | AI analysis (48 files) | ~10s | | AI analysis (100 files) | ~15s | | Token savings with Summarizer | 50-60% |


Requirements

  • Node.js: >= 18.0.0
  • TypeScript: >= 5.0.0 (optional, for type checking)

What's Next?

๐Ÿ“š Learn More

๐Ÿš€ Get Started

  1. Install: npm install -g vibrant-cli
  2. Run: vibrant .
  3. Fix issues: vibrant . --fix
  4. Enable AI: vibrant . --ai

๐Ÿ’ก Best Practices

  • Run before commits - Catch issues early
  • Enable AI for PRs - Deep analysis on important changes
  • Use in CI/CD - Automate code quality checks
  • Configure rules - Customize for your project

Contributing

Contributions are welcome! Please see the GitHub repository for more details.

git clone https://github.com/francogalfre/vibrant.git
cd vibrant/apps/cli
bun install
bun run dev

License

MIT License - see the LICENSE file for details.


Links


Built with โค๏ธ for developers who care about code quality

Made by @francogalfre