JSPM

  • Created
  • Published
  • Downloads 22
  • Score
    100M100P100Q73698F
  • License Apache-2.0

Prefl AI code review CLI that analyzes staged changes using Groq.

Package Exports

  • @preflight-ai/cli
  • @preflight-ai/cli/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@preflight-ai/cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Prefl AI CLI

Analyze staged changes with Groq-powered code review.

Website: https://prefl.run

Install

npm i -g @prefl-ai/cli

Setup

cd your-repo
prefl init
# Add your GROQ_API_KEY to .env when prompted (or later)

Usage

  • Analyze staged changes
git add .
prefl analyze --staged
  • Analyze entire repo
prefl analyze --all
  • Install pre-commit hook
prefl install-hook
  • Generate and optionally apply AI fix patch
# Generate patch from staged changes, write to .prefl/fix.patch and print
prefl fix

# Validate patch applicability without applying
prefl fix --dry-run

# Apply the generated patch
prefl fix --apply

# Use entire repository as input instead of staged changes
prefl fix --all --dry-run

# Output as JSON (contains { patch })
prefl fix --format json

CLI

prefl --help
prefl --version

Config: prefl.json

{
  "ignore": {
    "globs": ["node_modules/**", "dist/**", ".git/**"],
    "languages": []
  },
  "model": "llama-3.1-70b-versatile"
}

Output

file: src/index.ts
problem: Possible runtime error on JSON.parse chained access
fix: Assign JSON.parse result to a variable and validate before using.

Environment

  • .env should contain GROQ_API_KEY=...