A modern Prisma 7 CLI with first-party project templates and great init DX.
trpc-clifor command routingzod@4for validated input schemas@clack/prompts@1for interactive UXexecafor external command executionfs-extrafor filesystem operationshandlebarsfor conditional template renderingtsdownfor ESM builds
Run directly with Bun:
bunx create-prisma@latestCreate a new project (default command):
create-prismaCreate a Hono project non-interactively:
create-prisma --name my-api --template hono --provider postgresqlCreate a Next.js project non-interactively:
create-prisma --name my-web --template next --provider postgresqlInitialize Prisma explicitly in the current project:
create-prisma initSet package manager non-interactively:
create-prisma init --package-manager pnpm --installSkip Prisma Client generation:
create-prisma init --no-generateShow verbose command output:
create-prisma init --verboseRun fully non-interactive with defaults:
create-prisma init --yesUse Prisma Postgres auto-provisioning for PostgreSQL:
create-prisma init --provider postgresql --prisma-postgresOr run locally:
bun install
bun run build
bun run startThe 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.prismaprisma/index.tsprisma.config.ts.env(creates or updatesDATABASE_URL, and writesCLAIM_URLwhen Prisma Postgres is provisioned)- runs
prisma generateautomatically 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.
bun run build- Build todist/bun run dev- Watch mode buildbun run start- Run built CLIbun run typecheck- TypeScript checks onlybun run bump- Create a release PR (interactive semver bump)bun run bump -- patch|minor|major|x.y.z- Non-interactive bumpbun run bump -- --dry-run patch- Preview next version without changing filesbun run release-notes- Generate GitHub release notes viachangelogithub
This repo uses a manual, script-driven release flow:
- Run
bun run bump(or passpatch|minor|major|x.y.z). - The script creates a
release/vX.Y.Zbranch and a PR with commitchore(release): X.Y.Z. - Merge that PR to
mainwith squash (keep commit titlechore(release): X.Y.Z). - GitHub Actions creates the
vX.Y.Ztag and GitHub Release notes viachangelogithub. - GitHub Actions publishes only for
chore(release):commits, using npm trusted publishing (OIDC, no npm token secret).