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
| Option | Description |
|---|---|
-V, --version | Output the version number |
-h, --help | Display 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
nevr generate- Generate Prisma schema from entitiesnevr generate:entity- Generate a new entity filenevr introspect- Show all entities (user + plugin)nevr openapi- Generate OpenAPI specificationnevr context- Generate AI-optimized context
Database Management
nevr db:push- Push schema to database (prototyping)nevr db:migrate- Create migrations (production)nevr db:studio- Open Prisma Studio GUInevr db:reset- Reset database (drop all data)nevr db:generate- Generate Prisma client
Scaffolding
create-nevr- Create a new Nevr project
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 projectConfiguration
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.tsCommand Categories
| Category | Commands | Purpose |
|---|---|---|
| Development | dev | Full development workflow |
| Schema | generate, generate:entity | Generate database schema |
| Introspection | introspect, context | Understand your project |
| Documentation | openapi | Generate API documentation |
| Database | db:* | Manage database state |
| Scaffolding | create-nevr | Bootstrap new projects |
