
Prisma Cli
Look up correct Prisma CLI commands, flags, and workflow order when bootstrapping schema, generating the client, or applying migrations on a solo SaaS backend.
Overview
Prisma CLI is an agent skill most often used in Build (also Operate) that documents Prisma command usage for init, generate, migrate, database management, and MCP.
Install
npx skills add https://github.com/prisma/skills --skill prisma-cliWhat is this skill?
- 6 priority-ranked rule categories from setup (`init`) through CRITICAL `migrate-` commands
- Command map for setup, generation, dev DB, `db push/pull`, migrations, Studio, validate, format, debug, and MCP
- Explicit triggers: prisma init, generate, migrate, db, studio, mcp
- Versioned reference aligned to Prisma 7.6.0 CLI surface in SKILL.md metadata
- 6 rule categories by priority
- CRITICAL-priority migrate- command family
Adoption & trust: 8.8k installs on skills.sh; 39 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need to run Prisma commands but risk wrong migration order, missed `generate`, or unfamiliar `db` and `dev` options.
Who is it for?
Solo builders maintaining `schema.prisma`, running migrations, or wiring Prisma MCP inside Claude Code or Cursor.
Skip if: Choosing ORM vs raw SQL at the architecture stage, or frontend-only projects with no database layer.
When should I use this skill?
Running Prisma CLI: prisma init, generate, migrate, db, studio, debug, validate, format, dev, or prisma mcp.
What do I get? / Deliverables
You execute the right Prisma CLI sequence with documented options for setup, client output, schema sync, and migrations.
- Correctly ordered CLI actions
- Generated Prisma Client
- Migration files or synced schema state
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Build → Backend is where Prisma schema, client generation, and first migrations are defined. Prisma CLI is the database layer toolchain adjacent to application APIs, not frontend or marketing work.
Where it fits
Run `prisma init` and `generate` after defining the first user model for a solo SaaS API.
Look up `migrate dev` workflow before adding a nullable column locally.
Reference `db pull` and `validate` when production drift needs reconciliation.
Start Prisma MCP from CLI when wiring database tools into the agent.
How it compares
CLI command reference skill—not a replacement for Prisma docs site, hosted DB, or an ORM-agnostic query builder.
Common Questions / FAQ
Who is prisma-cli for?
Developers using Prisma on SaaS or API backends who want an in-agent command cheat sheet for init, generate, migrate, and database tooling.
When should I use prisma-cli?
In Build when setting up Prisma, generating the client, or authoring migrations; in Operate when pushing schema fixes or debugging CLI failures; when starting Prisma MCP.
Is prisma-cli safe to install?
Review Security Audits on this Prism page; migration and `db push` commands can change production data—always confirm targets and backups before the agent runs shell commands.
SKILL.md
READMESKILL.md - Prisma Cli
# Prisma CLI Reference Complete reference for all Prisma CLI commands. This skill provides guidance on command usage, options, and best practices for current Prisma releases. ## When to Apply Reference this skill when: - Setting up a new Prisma 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`) ## Rule Categories by Priority | Priority | Category | Impact | Prefix | |----------|----------|--------|--------| | 1 | Setup | HIGH | `init` | | 2 | Generation | HIGH | `generate` | | 3 | Development | HIGH | `dev` | | 4 | Database | HIGH | `db-` | | 5 | Migrations | CRITICAL | `migrate-` | | 6 | Utility | MEDIUM | `studio`, `validate`, `format`, `debug`, `mcp` | ## Command Categories | Category | Commands | Purpose | |----------|----------|---------| | Setup | `init` | Bootstrap new Prisma project | | Generation | `generate` | Generate Prisma Client | | Validation | `validate`, `format` | Schema validation and formatting | | Development | `dev` | Local Prisma Postgres for development | | Database | `db pull`, `db push`, `db seed`, `db execute` | Direct database operations | | Migrations | `migrate dev`, `migrate deploy`, `migrate reset`, `migrate status`, `migrate diff`, `migrate resolve` | Schema migrations | | Utility | `studio`, `mcp`, `version`, `debug` | Development and AI tooling | ## Quick Reference ### Project Setup ```bash # 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 ```bash # 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): ```bash bunx --bun prisma init bunx --bun prisma generate ``` ### Local Development Database ```bash # 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 ```bash # 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) ```bash # 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) ```bash # 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 ```bash # Open Prisma Studio (dat