prisma-cli
This skill provides Prisma ORM 7 CLI command reference for agents working with existing Prisma 7 projects.
Identity proven by GitHub's verified organisation badge (prisma)
- Agents
- Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode, claude.ai and API
- License
- MIT (permissive)
- Pin
- be16a87pinned Oct 9, 2026
- Context cost
- about 1,800 tokenswhen the skill loads
- GitHub stars
- 67on prisma/skills
- Scripts
- None found
What it does
“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.”
Generated summary from the skill's own text
This skill provides Prisma ORM 7 CLI command reference for agents working with existing Prisma 7 projects. The agent can initialize projects, generate Prisma Client, run database migrations, manage database state with push/pull operations, use local development databases, and access debugging tools. It enforces safety checkpoints for destructive operations requiring explicit user consent before execution.
When to use it
- Working with existing Prisma 7 applications and projects
- Managing database migrations and schema synchronization
- Setting up local development databases with Prisma Postgres
- Generating or regenerating Prisma Client after schema changes
When not to
- Setting up new Prisma projects or Prisma 8 applications, use prisma-orm-setup instead
- Working with Prisma Platform or Compute products, use specialized tools instead
Install
These commands install from the publisher's repository and need no account.
skills CLI
npx skills add prisma/skills --skill prisma-cliInstalls from the repository's default branch, which may have changed since the commit we checked.
GitHub CLI 2.90 or later
gh skill install prisma/skills prisma-cli@be16a8740d01363d13552b317042431ee8dfc581Installs the commit we checked (be16a87).
Copy by hand
Download the folder at be16a87 and put it in .claude/skills/prisma-cli for Claude Code and in .agents/skills/prisma-cli for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode.
Copy for your agent
A prompt for any coding agent. It installs this skill from GitHub at the pinned commit, copies the files as they are, and runs nothing unless you ask.
Prompt
Install the agent skill "prisma-cli" by Prisma. Source, pinned to commit be16a8740d01363d13552b317042431ee8dfc581: https://github.com/prisma/skills/tree/be16a8740d01363d13552b317042431ee8dfc581/prisma-cli 1. Download that folder at exactly this commit. Do not use the default branch. 2. Copy every file unchanged, keeping the folder structure, into .claude/skills/prisma-cli/ for Claude Code and .agents/skills/prisma-cli/ for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode. Create the folders if they do not exist. 3. Do not edit the files, and do not run any script in the folder unless I ask you to. 4. When you are done, list the files you copied and where you put them. Listing and checks: https://www.agentnative.dev/skills/prisma/prisma-cli
SKILL.md at the pin
---
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
| 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 | `complete`, `studio`, `validate`, `format`, `debug`, `mcp` |
## Command Categories
| Category | Commands | Purpose |
|----------|----------|---------|
| Setup | `init` | Initialize a 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 | `complete`, `studio`, `mcp`, `version`, `debug` | Shell, 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 (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:
```typescript
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`:
```typescript
// 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.
From prisma/skills at be16a87, shown as plain text under its license: MIT (permissive). The license text is in prisma-cli/SKILL.md.
View SKILL.md on GitHub at be16a87Files
- SKILL.md7.5 KB · e20d1a307dd8
- references/
- agent-safety.md1.1 KB · 66f06b408c2d
- complete.md652 B · 75c24fbd4450
- db-execute.md1.8 KB · 2cd76d47f204
- db-pull.md3.6 KB · 3c446ef9f3e7
- db-push.md3.0 KB · 51d5b4afa8f7
- db-seed.md3.3 KB · c86060e14174
- debug.md1.1 KB · 14f7d956ebd8
- dev.md2.7 KB · dbb420492bbd
- format.md1.1 KB · 9943b440cf4d
- generate.md3.5 KB · 85c801290339
- init.md3.2 KB · edd87b670117
- mcp.md1.2 KB · 97e8339e7451
- migrate-deploy.md2.6 KB · 2d6d669383b0
- migrate-dev.md3.1 KB · 804fe7e60e3b
- migrate-diff.md2.1 KB · daf77c34fdac
- migrate-reset.md1.7 KB · ae05eff0b9ac
- migrate-resolve.md1.7 KB · 9fc77c20ce99
- migrate-status.md1.5 KB · bacd09ee8be1
- studio.md2.7 KB · 2354f79d63c0
- validate.md883 B · 27d9262345da
21 files, 50 KB in total. Each file has a sha256 in the pin's manifest; the first 12 characters are shown.
Skill folder on GitHub at be16a87More from Prisma
prisma-8
This skill helps agents work with Prisma 8, a contract-first data layer for TypeScript projects.
Contains scripts
Claude Code, Codex, Cursor +3 · about 3.5K tokens · pinned 6 days ago
adr-review
This skill reviews Architecture Decision Records (ADRs) from a fresh perspective, identifying clarity and structural issues, then rewrites them for future…
Claude Code, Codex, Cursor +4 · about 590 tokens · pinned 6 days ago
ast-visitor-pattern
This skill teaches agents to use the visitor pattern with frozen subclasses for discriminated unions that need multiple dispatch sites.
Claude Code, Codex, Cursor +4 · about 710 tokens · pinned 6 days ago
bumping-biome
Updates the biome code formatter package to a specified version using pnpm, renames configuration files to biome.jsonc format, updates schema references, and…
Claude Code, Codex, Cursor +4 · about 290 tokens · pinned 6 days ago
contrib-pr
This skill guides external contributors through opening a pull request against prisma-next by following the project's contribution guidelines.
Claude Code, Codex, Cursor +4 · about 2.2K tokens · pinned 6 days ago
create-pr
This skill creates a GitHub pull request with a Linear-ticket-prefixed title and a decision-led narrative description for the prisma-next repository.
Claude Code, Codex, Cursor +4 · about 4.3K tokens · pinned 6 days ago
Related in Data and databases
prisma-next
Routes vague Prisma Next prompts to the correct specialized skill.
by PrismaOfficial publisher
Claude Code, Codex, Cursor +4 · about 1.1K tokens · pinned 6 days ago
prisma-next-contract
This skill enables editing the Prisma Next data contract, the single source of truth for your data layer.
by PrismaOfficial publisher
Claude Code, Codex, Cursor +4 · about 6.9K tokens · pinned 6 days ago
prisma-next-debug
Routes Prisma Next error envelopes to the right recovery workflow by reading the structured error's code, domain, severity, and metadata.
by PrismaOfficial publisher
Claude Code, Codex, Cursor +4 · about 4K tokens · pinned 6 days ago
prisma-next-migration-review
This skill helps review Prisma Next migrations before deployment, showing which migrations will run when you merge or deploy to an environment.
by PrismaOfficial publisher
Claude Code, Codex, Cursor +4 · about 5K tokens · pinned 6 days ago
prisma-next-migrations
Author and execute Prisma Next migrations by choosing between quick database updates or formal migration plans with data transforms.
by PrismaOfficial publisher
Claude Code, Codex, Cursor +4 · about 10K tokens · pinned 6 days ago
prisma-next-queries
Write queries against Postgres, SQLite, or MongoDB using Prisma Next.
by PrismaOfficial publisher
Claude Code, Codex, Cursor +4 · about 3.5K tokens · pinned 6 days ago