Skip to content
Prisma CLI

Prisma CLI Skill

Prisma's official command reference for Prisma ORM 7: init, generate, migrate, db, dev, studio and mcp, with a safety checkpoint before destructive commands.

GitHub Docs

Install

Install with the skills CLI

One command for Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf and dozens of other agents. Needs Node.js; the skill is fetched straight from prisma/skills.

$ npx skills add prisma/skills --skill prisma-cli

Run it in a terminal. The CLI finds the agents installed on your machine, asks which ones to add the skill to, and whether to install it into the folder you ran it from or for all your projects.

Other ways to install

Copy the whole skill folder — SKILL.md and any scripts or references beside it — into ~/.claude/skills/prisma-cli/, where Claude Code picks it up in every project. Only git is needed.

tmp=$(mktemp -d) && \
  git clone --depth 1 --branch main https://github.com/prisma/skills.git "$tmp" && \
  mkdir -p ~/.claude/skills && \
  cp -R "$tmp"/prisma-cli ~/.claude/skills/prisma-cli

No scripts or references next to it? Saving the SKILL.md alone as ~/.claude/skills/prisma-cli/SKILL.md works too.

Using another agent? Its personal skills folder
Codex
~/.agents/skills/
Cursor
~/.cursor/skills/
GitHub Copilot
~/.copilot/skills/
Gemini CLI
~/.gemini/skills/
Windsurf
~/.codeium/windsurf/skills/
OpenCode
~/.config/opencode/skills/

About

  • Command reference for Prisma ORM 7: init, generate, dev, db, migrate, studio, mcp
  • Uses the project's version-matched CLI instead of prisma@latest
  • Local Prisma Postgres development database commands
  • prisma.config.ts configuration and explicit environment loading
  • Consent checkpoint before migrate reset and data-loss db push
  • Per-command rule files ranked by priority

Prisma CLI is Prisma's official agent skill for the prisma command line in Prisma ORM 7 projects, published in the prisma/skills repository. It tells a coding agent which command fits each job and how to run it with the project's own version-matched CLI rather than a floating prisma@latest. For a new setup, connection problems or Prisma 8 it points to the separate Prisma ORM Setup skill, and it warns against confusing the ORM CLI with the beta Prisma Platform package.

The reference covers project setup (prisma init with a datasource provider, --db for Prisma Postgres, --with-model), client generation including watch mode, the local Prisma Postgres development database (prisma dev, detached instances, list, stop and remove), direct database operations (db pull, db push, db seed, db execute), development and production migrations (migrate dev, deploy, status, diff, reset), and utilities such as Studio, the Prisma MCP server, validate, format and debug. It explains the prisma.config.ts configuration file, explicit environment loading with dotenv, the need to run generate and db seed explicitly after schema syncs, and the --bun flag for Bun.

Its AI safety checkpoint matters most: Prisma blocks migrate reset, db push --force-reset and db push --accept-data-loss when it detects an agent until the user gives explicit consent, and the skill tells the agent to explain the data loss and ask immediately before, never to infer consent. Detailed rule files cover each command. MIT licensed, version 7.9.1.

SKILL.md

The instructions your agent loads, as published by Prisma.

SKILL.md
name
prisma-cli
description
Prisma ORM 7 CLI reference for existing Prisma 7 applications or explicitly selected Prisma 7 workflows. Covers prisma init, generate, migrate, db, dev, studio, and mcp. For setup, connection repair, or Prisma 8, use prisma-orm-setup; not the Prisma Platform CLI.
license
MIT
metadata
author: prisma version: "7.9.1"

Prisma ORM 7 CLI reference

These commands and examples apply to Prisma ORM 7 only. For setup, connection repair, or a Prisma 8 application, load [prisma-orm-setup](../prisma-orm-setup/SKILL.md).

Use the project's version-matched CLI. Do not install a floating prisma@latest to run these commands.

Boundary: Platform and Compute

Do not confuse the stable ORM command (prisma) with the public-beta Platform package (@prisma/cli, binary prisma-cli). Use prisma-compute for Compute apps and workspace auth, and prisma-postgres-setup for Platform projects and databases.

When to Apply

Reference this skill when:

  • Setting up an explicitly selected Prisma 7 project (prisma init)
  • Generating Prisma Client (prisma generate)
  • Running database migrations (prisma migrate)
  • Managing database state (prisma db push/pull)
  • Using local development database (prisma dev)
  • Debugging Prisma issues (prisma debug)
  • Generating shell completions (prisma complete)
Rule Categories by Priority
PriorityCategoryImpactPrefix
1SetupHIGHinit
2GenerationHIGHgenerate
3DevelopmentHIGHdev
4DatabaseHIGHdb-
5MigrationsCRITICALmigrate-
6UtilityMEDIUMcomplete, studio, validate, format, debug, mcp
Command Categories
CategoryCommandsPurpose
SetupinitInitialize a Prisma project
GenerationgenerateGenerate Prisma Client
Validationvalidate, formatSchema validation and formatting
DevelopmentdevLocal Prisma Postgres for development
Databasedb pull, db push, db seed, db executeDirect database operations
Migrationsmigrate dev, migrate deploy, migrate reset, migrate status, migrate diff, migrate resolveSchema migrations
Utilitycomplete, studio, mcp, version, debugShell, development, and AI tooling
Quick Reference
Project Setup
# Initialize new project (creates prisma/ folder and prisma.config.ts)
prisma init

# Initialize with specific database
prisma init --datasource-provider postgresql
prisma init --datasource-provider mysql
prisma init --datasource-provider sqlite

# Initialize with Prisma Postgres (cloud)
prisma init --db

# Initialize with an example model
prisma init --with-model
Client Generation
# Generate Prisma Client
prisma generate

# Watch mode for development
prisma generate --watch

# Generate specific generator only
prisma generate --generator client
Bun Runtime

When using Bun, always add the --bun flag so Prisma runs with the Bun runtime (otherwise it falls back to Node.js because of the CLI shebang):

bunx --bun prisma init
bunx --bun prisma generate
Local Development Database
# Start local Prisma Postgres
prisma dev

# Start with specific name
prisma dev --name myproject

# Start in background (detached)
prisma dev --detach

# List all local instances
prisma dev ls

# Stop instance
prisma dev stop myproject

# Remove instance data
prisma dev rm myproject
Database Operations
# Pull schema from existing database
prisma db pull

# Push schema to database (no migrations)
prisma db push

# Seed database
prisma db seed

# Execute raw SQL
prisma db execute --file ./script.sql
Migrations (Development)
# Create and apply migration
prisma migrate dev

# Create migration with name
prisma migrate dev --name add_users_table

# Create migration without applying
prisma migrate dev --create-only

# Reset database and apply all migrations
prisma migrate reset
Migrations (Production)
# Apply pending migrations (CI/CD)
prisma migrate deploy

# Check migration status
prisma migrate status

# Compare schemas and generate diff
prisma migrate diff --from-config-datasource --to-schema schema.prisma --script
Utility Commands
# Open Prisma Studio (database GUI)
prisma studio

# Start Prisma's MCP server for AI tools
prisma mcp

# Show version info
prisma version
prisma -v

# Debug information
prisma debug

# Validate schema
prisma validate

# Format schema
prisma format

# Generate shell completion code
prisma complete zsh
AI Safety Checkpoint

Prisma blocks destructive commands when it detects an AI agent until the agent has obtained explicit user consent. This covers migrate reset, db push --force-reset, and db push --accept-data-loss.

  • Explain the exact data-loss impact and ask for consent immediately before running the command.
  • Do not infer consent from earlier or unrelated messages.
  • If automation needs the consent variable, set PRISMA_USER_CONSENT_FOR_DANGEROUS_AI_ACTION to the user's exact consent message. Do not invent the text.
  • The Prisma MCP server deliberately has no migrate-reset tool.

Read references/agent-safety.md before any destructive Prisma command.

Current Prisma CLI Setup
New Configuration File

Use prisma.config.ts for CLI configuration:

import 'dotenv/config'
import { defineConfig, env } from 'prisma/config'

export default defineConfig({
  schema: 'prisma/schema.prisma',
  migrations: {
    path: 'prisma/migrations',
    seed: 'tsx prisma/seed.ts',
  },
  datasource: {
    url: env('DATABASE_URL'),
  },
})
Current Command Behavior
  • Run prisma generate explicitly after migrate dev, db push, or other schema syncs when you need fresh client output
  • Run prisma db seed explicitly after migrate dev or migrate reset when you need seed data
  • Use prisma db execute --file ... for raw SQL scripts
Environment Variables

Load environment variables explicitly in prisma.config.ts, commonly with dotenv:

// prisma.config.ts
import 'dotenv/config'
Rule Files

See individual rule files for detailed command documentation:

references/init.md           - Project initialization
references/generate.md       - Client generation
references/dev.md            - Local development database
references/db-pull.md        - Database introspection
references/db-push.md        - Schema push
references/db-seed.md        - Database seeding
references/db-execute.md     - Raw SQL execution
references/migrate-dev.md    - Development migrations
references/migrate-deploy.md - Production migrations
references/migrate-reset.md  - Database reset
references/migrate-status.md - Migration status
references/migrate-resolve.md - Migration resolution
references/migrate-diff.md   - Schema diffing
references/studio.md         - Database GUI
references/mcp.md            - Prisma MCP server
references/complete.md       - Shell completion generation
references/agent-safety.md   - AI consent checkpoint for destructive commands
references/validate.md       - Schema validation
references/format.md         - Schema formatting
references/debug.md          - Debug info
How to Use

Use the command categories above for navigation, then open the specific command reference file you need.

Install
New

Prisma's official skill for setting up Prisma ORM or repairing an app's database connection: it detects the app's Prisma version, defaults new apps to Prisma 8 and its package-owned skill, and keeps Prisma 6 and 7 apps on their own major.

Prisma's official Prisma Client reference skill: client setup with driver adapters, CRUD and bulk queries, select/include/omit, filters, relation reads and nested writes, transactions and safe raw SQL.

Prisma's official skill for migrating an ORM project from v6 to v7 - the prisma-client generator, driver adapters, prisma.config.ts, ESM entrypoints and every removed API.

Prisma's official skill for getting an app a Prisma Postgres database: reuse an existing connection, use the Vercel Marketplace flow, spin up a no-account database with npx create-db, or provision a persistent one, then connect and verify it.

Browse all skills →