All skills
prisma avatar

/prisma-cli

@b491588 official
by prismaprisma/skills68 stars
7

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.

Use this Skill: https://skilld.dev/gh/prisma/skills/prisma-cli

This session only. Nothing lands on disk.

referencesinit.md

≈812 tokens on demand. Your agent reads this file only when SKILL.md points to it.

prisma init

Bootstraps a fresh Prisma ORM project in the current directory.

Command

prisma init [options]

Bun Runtime

If you're using Bun, run Prisma with bunx --bun so it doesn't fall back to Node.js:

bunx --bun prisma init

What It Creates

  • prisma/schema.prisma - Your Prisma schema file
  • prisma.config.ts - TypeScript configuration for Prisma CLI
  • .env - Environment variables (DATABASE_URL)
  • .gitignore - Ensures .env is ignored and appends the generated client path

Options

Option Description Default
--datasource-provider Database provider: postgresql, mysql, sqlite, sqlserver, mongodb, cockroachdb postgresql
--db Provisions a fully managed Prisma Postgres database on the Prisma Data Platform -
--url Define a custom datasource url -
--generator-provider Define the generator provider to use prisma-client
--output Define Prisma Client generator output path to use -
--preview-feature Define a preview feature to use -
--with-model Add example model to created schema file -
--no-skills Skip the best-effort installation of Prisma agent skills -

prisma init attempts to install prisma/skills for detected agents. This is best-effort and does not make project initialization fail. Use --no-skills in minimal or controlled environments.

Examples

Basic initialization

prisma init

Creates a PostgreSQL project setup.

SQLite project

prisma init --datasource-provider sqlite

MySQL with custom URL

prisma init --datasource-provider mysql --url "mysql://user:password@localhost:3306/mydb"

Prisma Postgres (cloud)

prisma init --db

Opens browser for authentication, creates cloud database instance.

Add an example model

prisma init --with-model

Adds a starter model to the generated schema.

With preview features

prisma init --preview-feature relationJoins --preview-feature fullTextSearch

Generated Schema

generator client {
  provider = "prisma-client"
  output   = "../generated/prisma"
}

datasource db {
  provider = "postgresql"
}

Generated Config (Node.js default)

// prisma.config.ts
import "dotenv/config";
import { defineConfig } from 'prisma/config'

export default defineConfig({
  schema: 'prisma/schema.prisma',
  migrations: {
    path: 'prisma/migrations',
  },
  datasource: {
    url: process.env['DATABASE_URL'],
  },
})

Generated Config (Bun)

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

export default defineConfig({
  schema: 'prisma/schema.prisma',
  migrations: {
    path: 'prisma/migrations',
  },
  datasource: {
    url: env('DATABASE_URL'),
  },
})

Next Steps After Init

  1. Configure DATABASE_URL in .env (and let prisma.config.ts read it)
  2. Define your models in prisma/schema.prisma
  3. Run prisma dev for local development or connect to remote DB
  4. Run prisma migrate dev to create migrations
  5. Run prisma generate to generate Prisma Client
  6. Run prisma db seed explicitly if you want seed data

Source: SKILL.md on GitHub

No alerts2d5 checks · Risk SAFE
  • Gen Agent Trust Hub2d

    This skill provides a comprehensive reference for Prisma ORM CLI commands, covering project initialization, migrations, and database management. It includes specific safety guidelines to prevent AI agents from executing destructive commands without explicit user consent. No security issues were detected.

  • Socket2d

    No alerts

  • Snyk2d

    Risk: LOW · No issues

  • Runlayer7mo

    4/18 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at b491588. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 1 hour ago.

Activeupdated 3 days ago
metadata
{
  "author": "prisma",
  "version": "7.9.1"
}

README badge

README badge for prisma/skills/prisma-cli

Provides reference documentation and guidance for Prisma ORM CLI commands including init, generate, migrate, db operations, studio, and mcp. Use this skill for Prisma project setup, migrations, schema management, and local development workflows; do not use it for Prisma Compute app deployment.

Generated from the current SKILL.md.

Does this skill cover Prisma Compute deployment?
No. This skill covers Prisma ORM CLI commands only (init, generate, migrate, db, studio, etc.). Use the prisma-compute skill for app deploy, compute:deploy, and Compute-related commands.
What database systems does this skill support?
Prisma ORM with PostgreSQL, MySQL, SQLite, and Prisma Postgres (cloud). The skill documents provider-specific initialization flags.
Does this skill work with Bun?
Yes. The skill documents that you must use the `--bun` flag when running Prisma commands via Bun (e.g. `bunx --bun prisma generate`) so Prisma runs with the Bun runtime instead of falling back to Node.js.
Does this skill cover development workflows only, or production too?
Both. It covers development commands (prisma dev, migrate dev) and production workflows (prisma migrate deploy for CI/CD, prisma db push for schema sync).
What version of Prisma does this skill target?
Prisma 7.6.0 and current releases. It documents the current prisma.config.ts configuration format and CLI behavior.

Generated from the current SKILL.md. These answers refresh after source changes.