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 🙏

© 2025 – Pkg Stats / Ryan Hefner

cr-ai

v1.0.43

Published

A terminal AI tool for code review with AI assistance using Gemini API

Readme

CR - Code Review Tool

A terminal-based code review tool from git changes (before commit) with AI assistance using Google's Gemini API.

Features

  1. Index code: Index current code in your project directory
  2. Initialize configuration: Set up the CR tool with a configuration file (CR.json)
  3. Review code changes: Automatically review git changes with AI assistance
  4. Git integration: Set up git hooks to run code review automatically on commit
  5. Customizable rules: Define your own code review rules
  6. AI-powered: Uses Google's Gemini API for intelligent code review

alt text

Installation

npm install -g cr-ai

Configuration

The tool uses a CR.json file for configuration with the following structure:

{
    "index_source_path": "path to index source code",
    "rules": [
        "Check for security vulnerabilities",
        "Ensure proper error handling",
        "Verify code follows best practices"
    ],
    "gemini_api_key": "your gemini api key",
    "model_name": "gemini-2.0-flash",
    "instruction": "Review this code for bugs, security issues, and best practices.",
    "use_colors": true,
    "light_review": false
}

The model_name field specifies which Gemini model to use for code review. Supported models:

  • gemini-2.0-flash (default): Faster, more efficient model
  • gemini-1.5-flash: Balanced performance model
  • gemini-2.5-flash-preview-04-17: Latest preview model with advanced capabilities

The use_colors field controls whether the code review output uses colored formatting:

  • true (default): Display code reviews with colorful headers and syntax highlighting
  • false: Display code reviews in plain text without colors

The light_review field controls the level of detail in code reviews:

  • false (default): Full review with all sections (SUMMARY, ISSUES, SUGGESTIONS, BEST PRACTICES, etc.)
  • true: Light review with only ISSUES and BEST PRACTICES sections

Usage

Initialize the tool

cr init

This will guide you through creating a CR.json configuration file.

Index your code

cr index

This will scan and index your codebase for better context during reviews.

Review code changes

cr changes

This will analyze your git changes and provide AI-powered code review feedback.

Set up git hooks

cr integrate

This will set up git hooks to automatically run code review on commit using Husky. The command preserves any existing pre-commit hooks, so it's safe to use in projects that already have other hooks configured (like ESLint).

Manage AI models

List available models

cr model list

This will display all available AI models for code review.

Show current model

cr model show

This will display the currently configured AI model.

Change the model

cr model change

This will allow you to select a different AI model for code review.

Requirements

  • Node.js >= 18 (required, the tool will warn you if using an older version)
  • Git repository (for the changes and integrate commands)
  • Gemini API key (optional, but recommended for AI features)
  • Husky (automatically installed by the integrate command)

License

MIT