Skip to content

prisma/create-prisma

Repository files navigation

create-prisma

A modern Prisma 7 CLI with first-party project templates and great init DX.

Stack

  • trpc-cli for command routing
  • zod@4 for validated input schemas
  • @clack/prompts@1 for interactive UX
  • execa for external command execution
  • fs-extra for filesystem operations
  • handlebars for conditional template rendering
  • tsdown for ESM builds

Usage

Run directly with Bun:

bunx create-prisma@latest

Create a new project (default command):

create-prisma

Create a Hono project non-interactively:

create-prisma --name my-api --template hono --provider postgresql

Create a Next.js project non-interactively:

create-prisma --name my-web --template next --provider postgresql

Initialize Prisma explicitly in the current project:

create-prisma init

Set package manager non-interactively:

create-prisma init --package-manager pnpm --install

Skip Prisma Client generation:

create-prisma init --no-generate

Show verbose command output:

create-prisma init --verbose

Run fully non-interactive with defaults:

create-prisma init --yes

Use Prisma Postgres auto-provisioning for PostgreSQL:

create-prisma init --provider postgresql --prisma-postgres

Or run locally:

bun install
bun run build
bun run start

The CLI updates package.json with Prisma dependencies, optionally runs dependency installation with your selected package manager, and scaffolds Prisma 7 setup files from Handlebars templates:

  • prisma/schema.prisma
  • prisma/index.ts
  • prisma.config.ts
  • .env (creates or updates DATABASE_URL, and writes CLAIM_URL when Prisma Postgres is provisioned)
  • runs prisma generate automatically after scaffolding

create is the default command and currently supports:

  • templates: hono, next
  • project name via --name
  • schema presets via --schema-preset empty|basic (default: basic)

init configures Prisma in the current project and supports schema presets too (default: empty). Both commands prompt for database choice, package manager, and whether to install dependencies now. Supported providers in this flow: postgresql, mysql, sqlite, sqlserver, cockroachdb. Supported package managers: bun, pnpm, npm. Package manager prompt auto-detects from package.json/lockfiles/user agent and uses that as the initial selection. --yes accepts defaults (postgresql, detected package manager, Prisma Postgres enabled for PostgreSQL, install enabled) and skips prompts. --no-generate skips automatic prisma generate. --verbose prints full install/generate command output; default mode keeps output concise. --force (create only) allows scaffolding in a non-empty target directory. If Prisma files already exist, init asks whether to keep existing files or overwrite them. When postgresql is selected, init can provision Prisma Postgres via create-db --json and auto-fill DATABASE_URL.

Scripts

  • bun run build - Build to dist/
  • bun run dev - Watch mode build
  • bun run start - Run built CLI
  • bun run typecheck - TypeScript checks only
  • bun run bump - Create a release PR (interactive semver bump)
  • bun run bump -- patch|minor|major|x.y.z - Non-interactive bump
  • bun run bump -- --dry-run patch - Preview next version without changing files
  • bun run release-notes - Generate GitHub release notes via changelogithub

Release Workflow

This repo uses a manual, script-driven release flow:

  1. Run bun run bump (or pass patch|minor|major|x.y.z).
  2. The script creates a release/vX.Y.Z branch and a PR with commit chore(release): X.Y.Z.
  3. Merge that PR to main with squash (keep commit title chore(release): X.Y.Z).
  4. GitHub Actions creates the vX.Y.Z tag and GitHub Release notes via changelogithub.
  5. GitHub Actions publishes only for chore(release): commits, using npm trusted publishing (OIDC, no npm token secret).

About

No description, website, or topics provided.

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •