Prisma is a next-generation ORM that provides a comprehensive database toolkit including type-safe query builder, declarative migrations, and GUI database management.
npx @tessl/cli install tessl/npm-prisma@6.15.0Prisma CLI is a next-generation ORM toolkit that provides comprehensive database management, client generation, and development workflow capabilities. It includes type-safe query builder, declarative migrations, and GUI database management with support for multiple database systems including PostgreSQL, MySQL, SQLite, SQL Server, MongoDB, and CockroachDB.
npm install prismaThe Prisma CLI is primarily accessed via command line interface, but also exports types for configuration:
import { PrismaConfig } from "prisma";For configuration utilities:
import { PrismaConfig } from "prisma/config";ESM import:
import { PrismaConfig } from "prisma";CommonJS require:
const { PrismaConfig } = require("prisma");# Initialize new project
npx prisma init
# Start local development server
npx prisma dev
# Generate Prisma Client after schema changes
npx prisma generate
# Push schema changes to database
npx prisma db push
# Create and apply migrations
npx prisma migrate dev --name init
# Launch database GUI
npx prisma studio
# Format schema file
npx prisma format
# Display debug information
npx prisma debug
# Show telemetry information
npx prisma telemetryWith TypeScript configuration:
// schema.prisma example
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model User {
id Int @id @default(autoincrement())
email String @unique
name String?
}Prisma CLI is built around several key components:
@prisma/cli-init, @prisma/cli-security-rulesPrismaConfig from @prisma/configGenerate type-safe Prisma Client from schema definitions with support for multiple generators and custom output options.
prisma generate [options]
Options:
--schema <path> Custom schema file path
--sql Generate typed SQL module
--watch Watch mode for continuous generation
--generator <name> Target specific generator
--no-engine Generate for Accelerate only
--no-hints Hide hint messages
--allow-no-models Allow schemas without models
--require-models Require models in schemaDirect database operations including schema synchronization, raw query execution, and database introspection.
prisma db <command> [options]
Commands:
pull Pull schema from database
push Push schema changes to database
execute Execute raw SQL queries
seed Run database seedingDeclarative data modeling and migration system with development and production workflows.
prisma migrate <command> [options]
Commands:
dev Development migrations with auto-generation
deploy Deploy pending migrations to production
status Check migration status
resolve Mark failed migrations as resolved
reset Reset database and apply all migrations
diff Generate migration diffs between statesWeb-based GUI for database visualization, data editing, and relationship exploration with real-time updates.
prisma studio [options]
Options:
--port/-p <number> Custom port (default: 5555-5600 range)
--browser/-b <browser> Browser selection
--hostname/-n <host> Hostname binding
--schema <path> Schema file pathAuthentication and project management for Prisma Platform services including Pulse, Accelerate, and workspace management.
prisma platform <command> [options]
Commands:
auth Authentication management
workspace Workspace operations
environment Environment management
project Project operations
serviceToken Service token management
pulse Real-time event streaming
accelerate Connection pooling and cachingModel Context Protocol server for AI development tools integration, providing structured access to Prisma operations.
prisma mcp [options]
Options:
--early-access Enable early access features
MCP Tools:
migrate-status Check migration status
migrate-dev Run development migrations
migrate-reset Reset database (with --force)
Prisma-Studio Launch Studio interfaceSchema validation, formatting, and development utilities for maintaining clean and valid Prisma schema files.
prisma format [options]
prisma validate [options]
Format Options:
--schema <path> Schema file path
--check Check formatting without modifying
Validate Options:
--schema <path> Schema file path
--config <path> Configuration file pathSet up a new Prisma project with schema files, configuration, and development environment.
prisma init [options]
Options:
--datasource-provider <provider> Database provider (postgresql, mysql, sqlite, sqlserver, mongodb, cockroachdb)
--url <url> Database connection URL
--help/-h Show help informationNote: This command is provided by the external package @prisma/cli-init.
Start a local Prisma Postgres server for development with automatic schema synchronization.
prisma dev [options]
Options:
--help/-h Show help informationNote: This command provides local development database capabilities.
Display comprehensive debugging information including environment variables, paths, and configuration details.
prisma debug [options]
Options:
--schema <path> Custom path to Prisma schema file
--config <path> Custom path to configuration file
--help/-h Show help informationDisplay telemetry cache information and project identifiers for debugging telemetry issues.
prisma telemetry [options]
Options:
--schema <path> Custom path to Prisma schema fileGlobal Options:
--help/-h Show help information
--version/-v Show version information
--config <path> Configuration file path
--json JSON output format (for version)
--experimental Enable experimental features
--preview-feature Enable preview features
--early-access Enable early access features
--telemetry-information Telemetry configuration// Configuration type from @prisma/config
export type { PrismaConfig } from '@prisma/config';
// Command interface (internal)
interface Command {
parse(argv: string[], config: PrismaConfigInternal): Promise<string | Error>;
help(error?: string): string;
}
// CLI global arguments
interface GlobalArgs {
'--help'?: boolean;
'--version'?: boolean;
'--config'?: string;
'--json'?: boolean;
'--experimental'?: boolean;
'--preview-feature'?: boolean;
'--early-access'?: boolean;
'--telemetry-information'?: string;
}