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

@nevr/cli

v0.2.2

Published

CLI for Nevr - Nevr write boilerplate again

Readme

@nevr/cli

Command-line interface for Nevr — Generate Prisma schemas and typed clients from your entities


📦 Installation

# Global installation
npm install -g @nevr/cli

# Or use directly with npx (recommended)
npx @nevr/cli generate

🚀 Quick Start

  1. Create a config file (nevr.config.ts):
import { entity, string, text, belongsTo } from "nevr"

export const user = entity("user", {
  email: string.unique(),
  name: string.min(1).max(100),
}).build()

export const post = entity("post", {
  title: string.min(1).max(200),
  body: text,
  author: belongsTo(() => user),
})
  .ownedBy("author")
  .build()

export default {
  entities: [user, post],
}
  1. Generate everything:
npx @nevr/cli generate
  1. Push to database:
npx prisma db push --schema=./generated/prisma/schema.prisma

📖 Commands

nevr generate

Generate Prisma schema, TypeScript types, and API client from your entity definitions.

nevr generate [options]

Options:

| Option | Description | Default | |--------|-------------|---------| | -c, --config <path> | Path to nevr config file | ./nevr.config.ts | | -o, --out <dir> | Output directory | ./generated | | -p, --provider <db> | Database provider: sqlite, postgresql, mysql | sqlite |

Examples:

# Default configuration
nevr generate

# PostgreSQL with custom output
nevr generate --provider postgresql --out ./src/generated

# Custom config file
nevr generate --config ./config/api.config.ts

nevr init

Display help for initializing a new nevr project.

nevr init

💡 Tip: For full project scaffolding with a complete setup, use:

npm create nevr@latest

📁 Generated Output

Running nevr generate creates the following structure:

generated/
├── prisma/
│   └── schema.prisma    # Prisma database schema
├── types.ts             # TypeScript interfaces
└── client.ts            # Type-safe API client

schema.prisma

Complete Prisma schema with all your entities, relations, and indexes:

// Generated by @nevr/cli - DO NOT EDIT

datasource db {
  provider = "sqlite"
  url      = env("DATABASE_URL")
}

generator client {
  provider = "prisma-client-js"
}

model User {
  id    String @id @default(cuid())
  email String @unique
  name  String
  posts Post[]
}

model Post {
  id       String @id @default(cuid())
  title    String
  body     String
  authorId String
  author   User   @relation(fields: [authorId], references: [id])
}

types.ts

Type-safe interfaces for all entities:

// Generated by @nevr/cli - DO NOT EDIT

export interface User {
  id: string
  email: string
  name: string
}

export interface Post {
  id: string
  title: string
  body: string
  authorId: string
}

client.ts

Ready-to-use API client for your frontend:

// Generated by @nevr/cli - DO NOT EDIT

import type { User, Post } from "./types"

export const api = {
  users: {
    list: () => fetch("/api/users").then(r => r.json()) as Promise<User[]>,
    get: (id: string) => fetch(`/api/users/${id}`).then(r => r.json()) as Promise<User>,
    create: (data: Omit<User, "id">) => /* ... */,
    update: (id: string, data: Partial<User>) => /* ... */,
    delete: (id: string) => /* ... */,
  },
  posts: { /* ... */ },
}

⚙️ Configuration Reference

Full configuration options in nevr.config.ts:

import { entity, string, text, int, bool, datetime, belongsTo } from "nevr"
import { auth } from "nevr/plugins/auth"
import { timestamps } from "nevr/plugins/timestamps"

// Define entities
export const user = entity("user", {
  email: string.unique(),
  name: string,
}).build()

export const post = entity("post", {
  title: string.min(1).max(200),
  content: text,
  published: bool.default(false),
  author: belongsTo(() => user),
})
  .ownedBy("author")
  .rules({
    create: ["authenticated"],
    read: ["everyone"],
    update: ["owner"],
    delete: ["owner", "admin"],
  })
  .build()

// Export configuration
export default {
  entities: [user, post],
  plugins: [
    auth({ emailAndPassword: true }),
    timestamps(),
  ],
}

🔄 Workflow

Typical development workflow with the CLI:

# 1. Edit your entities in nevr.config.ts

# 2. Regenerate everything
npx @nevr/cli generate

# 3. Apply database changes
npx prisma db push --schema=./generated/prisma/schema.prisma

# 4. (Optional) View your database
npx prisma studio --schema=./generated/prisma/schema.prisma

📚 Related Packages

| Package | Description | |---------|-------------| | nevr | Core framework | | @nevr/generator | Generator library (used internally) | | create-nevr | Project scaffolder |

🤝 Contributing

We welcome contributions! See our Contributing Guide.

📄 License

MIT © Nevr Contributors