Skip to content

CLI Overview

The Nevr CLI is your primary tool for developing, managing the database, and generating code.

Installation

The CLI is included with the nevr package. Run it via npx:

bash
npx nevr <command> [options]

Global Options

OptionDescription
-V, --versionOutput the version number
-h, --helpDisplay help for command
-c, --config <path>Path to config file

Commands

Development

  • nevr dev - Start the development workflow (generate + push + dev server)

Schema & Code Generation

Database Management

Scaffolding

Quick Reference

bash
# Development workflow
npx nevr dev                    # Generate + push + start server

# Generate schema
npx nevr generate               # Generate from nevr.config.ts
npx nevr g                      # Alias

# Generate entity file
npx nevr generate:entity post -f "title:string,body:text"
npx nevr g:e post               # Alias

# Introspect project
npx nevr introspect             # Show entities summary
npx nevr introspect --json      # JSON output

# Generate OpenAPI
npx nevr openapi                # Generate openapi.json
npx nevr openapi --format yaml  # Generate openapi.yaml

# Generate AI context
npx nevr context                # Generate context.md
npx nevr context -o CONTEXT.md  # Custom output path

# Database commands
npx nevr db:push                # Push schema to database
npx nevr db:migrate --name init # Create migration
npx nevr db:studio              # Open Prisma Studio
npx nevr db:reset               # Reset database

# Scaffolding
npm create nevr@latest my-app   # Create new project

Configuration

Most commands look for a nevr.config.ts (or .js, .mjs) file in your project root ,src/ or lib/ folder .

typescript
// nevr.config.ts
import { defineConfig } from "nevr"
import { user, post } from "./entities"
import { authPlugin } from "./plugins"

export default defineConfig({
  database: "sqlite",
  entities: [user, post],
  plugins: [authPlugin],
})

You can specify a custom config path with -c or --config:

bash
npx nevr generate -c ./config/custom.ts

Command Categories

CategoryCommandsPurpose
DevelopmentdevFull development workflow
Schemagenerate, generate:entityGenerate database schema
Introspectionintrospect, contextUnderstand your project
DocumentationopenapiGenerate API documentation
Databasedb:*Manage database state
Scaffoldingcreate-nevrBootstrap new projects

Released under the MIT License.