Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

Prisma CLI

$ prisma Official Med Risk
Prisma · Database & Data · Apache-2.0 · macos / linux / windows

Prisma CLI manages schema.prisma validation, type-safe Prisma Client code generation, and SQL migrations (prisma migrate). Offers deterministic non-interactive commands like prisma validate, prisma generate, and prisma migrate deploy for CI and coding agents.

FCRS-1.0 Score
85 /100
Good
Medium Confidence
Zero-Friction Install
npm install -D prisma
CLI vs MCP Decision CLI Preferred vs MCP

npx prisma validate and npx prisma generate are foundational local TypeScript compiler steps that must run via CLI rather than MCP.

Agent-Readiness Checklist

— JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
— NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 20 / 25

Deterministic validate, generate, migrate status, and --create-only flags work well in agent loops, though output is mostly plain text rather than JSON.

  • Non-interactive validate, generate, and migrate status; lacks --json
Trust & Safety 21 / 25

--create-only lets agents inspect generated SQL before execution; destructive migrate reset requires --force in non-TTY shells.

  • migrate dev --create-only separates SQL generation from execution
Setup & Portability 14 / 15

Standard npm devDependency (npx prisma) across macOS, Linux, and Windows.

  • Installed via project npm / npx across all major OSes
Utility & Efficiency 14 / 15

Unifies schema validation, migration generation, introspection (db pull), and TypeScript typegen.

  • Core workflow for TypeScript ORM projects
Maintenance & Lineage 8 / 10

Official prisma/prisma repository under Apache-2.0 with massive ecosystem adoption.

  • Official prisma/prisma repository
Docs & Verifiability 8 / 10

Thorough official CLI reference with clear flag descriptions.

  • Official CLI reference at prisma.io/docs

Security, Auth & Guardrails

Auth Modes
Config File Env API Key
Credential Storage

Database connection URLs read from DATABASE_URL in .env or prisma.config.ts; optional Prisma Data Platform key via PRISMA_API_KEY.

Side Effects
Read-Only Local Write Remote Write Destructive
Cost & Quotas

Prisma ORM and CLI are 100% free and Apache-2.0 open-source.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# Prisma CLI Agent Rules
- Run `npx prisma validate` and `npx prisma generate` after every `schema.prisma` edit.
- Use `npx prisma migrate dev --create-only --name <desc>` to generate SQL for review before applying.
- NEVER run `npx prisma migrate reset` or `npx prisma db push --force-reset` without explicit approval.

Agent-Ready Command Recipes

Safe Read-Only Queries

Validate Prisma schema syntax offline
npx prisma validate

Checks schema.prisma syntax and relation integrity without connecting to a database.

Check applied vs pending migrations
npx prisma migrate status

Reports whether the target database is in sync with local prisma/migrations.

Controlled Writes & Previews

Generate type-safe Prisma Client locally
npx prisma generate

Compiles local TypeScript types and client code from schema.prisma.

Strengths for Agents

  • + prisma validate catches schema relation errors offline in milliseconds.
  • + prisma migrate dev --create-only creates inspectable SQL files without mutating the database.
  • + prisma generate immediately updates TypeScript types for tsc feedback loops.

Caveats & Pitfalls

  • ! Lacks --json output on migrate status and validate.
  • ! Running prisma studio starts a blocking local web server.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI