Prisma CLI
PrismaOfficialCreated by prisma
- Skill
- Tool integration
- Software development
- MIT
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
The Prisma ORM 7 CLI skill provides a structured reference for managing Prisma-based applications. It covers essential commands for project setup, database schema synchronization, migration management, and local development. The skill includes specific guidance for using the CLI with different runtimes like Bun, managing environment variables via configuration files, and adhering to safety protocols when performing destructive database operations.
What it does
- Initializes new Prisma projects with specific database providers.
- Generates Prisma Client code based on the schema.
- Manages database migrations including development and production deployment.
- Provides utilities for schema validation, formatting, and database introspection.
- Offers a local development database environment via the dev command.
- Enforces safety checkpoints for destructive commands when used by AI agents.
When to use it
- When initializing a new Prisma ORM 7 project.
- When updating the database schema or generating the Prisma Client.
- When managing database migrations in development or production environments.
- When performing raw SQL execution or seeding the database.
- When debugging Prisma-related issues or validating schema files.
Advantages
- Provides a centralized reference for all Prisma ORM 7 CLI commands.
- Includes safety protocols to prevent accidental data loss during destructive operations.
- Supports modern development workflows including Bun runtime integration.
- Clearly separates development and production migration strategies.
- Facilitates easier schema management through validation and formatting tools.
Usage examples
- “Initialize a new Prisma project with PostgreSQL.”
- The agent executes 'prisma init --datasource-provider postgresql' to set up the project structure and configuration.
- “Generate the Prisma Client for my project.”
- The agent runs 'prisma generate' to produce the client based on the current schema definition.
- “Apply pending migrations to the production database.”
- The agent executes 'prisma migrate deploy' to safely apply migrations to the production environment.
- “Open the database GUI to inspect my data.”
- The agent runs 'prisma studio' to launch the local database management interface.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/prisma/prisma-cli/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip prisma-cli.zip -d .agents/skills
Documentation by prisma
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.
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
# 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 clientBun 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 generateLocal 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 myprojectDatabase 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.sqlMigrations (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 resetMigrations (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 --scriptUtility 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 zshAI 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_ACTIONto the user's exact consent message. Do not invent the text.The Prisma MCP server deliberately has no
migrate-resettool.
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 generateexplicitly aftermigrate dev,db push, or other schema syncs when you need fresh client outputRun
prisma db seedexplicitly aftermigrate devormigrate resetwhen you need seed dataUse
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 infoHow to Use
Use the command categories above for navigation, then open the specific command reference file you need.
Files
- ATTRIBUTION.mdAdded by AutoGineer846 B
- LICENSELicence file added by AutoGineer1.0 KiB
- SKILL.md7.3 KiB
- references/agent-safety.md1.1 KiB
- references/complete.md652 B
- references/db-execute.md1.8 KiB
- references/db-pull.md3.5 KiB
- references/db-push.md2.9 KiB
- references/db-seed.md3.2 KiB
- references/debug.md1.0 KiB
- references/dev.md2.6 KiB
- references/format.md1.0 KiB
- references/generate.md3.4 KiB
- references/init.md3.2 KiB
- references/mcp.md1.2 KiB
- references/migrate-deploy.md2.6 KiB
- references/migrate-dev.md3.1 KiB
- references/migrate-diff.md2.0 KiB
- references/migrate-reset.md1.7 KiB
- references/migrate-resolve.md1.6 KiB
- references/migrate-status.md1.5 KiB
- references/studio.md2.6 KiB
- references/validate.md883 B
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs an MCP server
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Created by
- prisma
- Publisher
- Prisma (Official)
- Source
- prisma/skills · prisma-cli · commit 8ea289b
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by prisma or Prisma.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download prisma-cli.zip