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

prisma-ai-console

v1.0.2

Published

AI-powered REPL console for Prisma ORM with natural language query generation

Readme

prisma-ai-console

AI-powered REPL console for Prisma ORM with natural language query generation

Screenshot

Screenshot Screenshot

Usage

  • From your project directory, run:
npx prisma-ai-console
  • Optional flags:
    • --client or -c: Set Prisma client path (default: ./node_modules/@prisma/client)
    • --schema or -s: Set schema file location for AI features (default: ./prisma/schema.prisma)
npx prisma-ai-console -c ./node_modules/@prisma/client -s ./prisma/schema.prisma

AI-Powered Query Generation 🤖

Generate Prisma queries using natural language! The console now includes an ai() function that understands your database schema and generates the appropriate Prisma commands.

Setup

Set your API key as an environment variable:

# For OpenAI
export OPENAI_API_KEY=your-api-key-here

# Or for Anthropic Claude
export ANTHROPIC_API_KEY=your-api-key-here

# Or for OpenRouter (supports multiple models)
export OPENROUTER_API_KEY=your-api-key-here
export OPENROUTER_MODEL=anthropic/claude-3.5-sonnet  # Optional, defaults to claude-3.5-sonnet

If multiple keys exist, OpenRouter will be used first, then OpenAI, then Anthropic.

Examples

// 1. ai(query) - Generate a Prisma command
await ai('find all users with gmail addresses')
// Displays the command, copy and paste to execute

// 2. run(query) - Generate and execute in one step
await run('get the top 10 most played songs with their artist names')
// Generates the command and runs it immediately, returns the result

Example

◭ > await ai('find all users created in the last 7 days')
🤖 Generating Prisma command...

✨ Generated command:
await prisma.user.findMany({ where: { createdAt: { gte: new Date(Date.now() - 7 * 24 * 60 * 60 * 1000) } } })

💡 Copy and paste to execute, or assign to a variable

Features

Two powerful commands:

  • ai(query) - Generate Prisma commands from natural language
  • run(query) - Generate and execute in one step

The AI automatically:

  • Reads your Prisma schema
  • Understands your database structure
  • Generates accurate Prisma Client queries
  • Supports complex queries with relations, filters, and aggregations

Acknowledgments

This project is built on top of prisma-console by Kinjal Raykarmakar. All the original REPL console features are still available, with AI-powered query generation added on top.

Original console feature included:

Screenshot Screenshot 2