Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
7bf2069
feat: add prisma next generator path
AmanVarshney01 May 11, 2026
b11feea
docs: describe prisma next scaffolds
AmanVarshney01 May 11, 2026
9df4aeb
fix: declare prisma next contract authoring packages
AmanVarshney01 May 11, 2026
e65dd79
fix: guide mongodb setup through migrations
AmanVarshney01 May 11, 2026
9391d8e
fix: support prisma next package managers
AmanVarshney01 May 11, 2026
ed40302
fix: scaffold runnable mongodb next setup
AmanVarshney01 May 11, 2026
0a77f68
fix: support prisma next migration commands
AmanVarshney01 May 11, 2026
0b8336e
fix: remove unsupported prisma next add-ons
AmanVarshney01 May 11, 2026
4a45b89
fix: use latest mongodb docker image
AmanVarshney01 May 11, 2026
a6d6db3
fix: simplify migration plan next step
AmanVarshney01 May 11, 2026
232bb90
fix: add manual seed command for starters
AmanVarshney01 May 11, 2026
1746a26
fix: rely on bun env loading
AmanVarshney01 May 11, 2026
f04e462
fix: add authoring style prompt hints
AmanVarshney01 May 11, 2026
f6a4fda
fix: add hints across create prompts
AmanVarshney01 May 11, 2026
4ee92c1
fix: clarify prisma next prompt hints
AmanVarshney01 May 11, 2026
636eafc
fix: invoke prisma next cli directly
AmanVarshney01 May 11, 2026
a95a92a
fix: describe next setup commands
AmanVarshney01 May 11, 2026
898f115
ci: publish next preview from labeled prs
AmanVarshney01 May 11, 2026
094d58b
fix: prompt for prisma postgres provisioning
AmanVarshney01 May 11, 2026
fbceeb8
fix: default interactive prisma postgres prompt
AmanVarshney01 May 11, 2026
7bb2736
feat: add prisma next project guidance
AmanVarshney01 May 12, 2026
329cc47
fix: align prisma next project guidance
AmanVarshney01 May 12, 2026
24c904a
fix: add prisma next skill metadata
AmanVarshney01 May 12, 2026
9a61f0a
style: polish prisma next cli copy
AmanVarshney01 May 12, 2026
90bbec7
style: add prisma next cli mark
AmanVarshney01 May 12, 2026
75def74
style: sharpen prisma next title colors
AmanVarshney01 May 12, 2026
9b43461
fix: update prisma next templates to 0.7.0
AmanVarshney01 May 15, 2026
41a7cb7
feat: finalize create-prisma next flow
AmanVarshney01 May 17, 2026
5f4d795
fix: scope prisma next telemetry to next releases
AmanVarshney01 May 17, 2026
de2e089
fix: remove prisma next schema preset option
AmanVarshney01 May 17, 2026
f5aa1a0
fix: sync prisma next skills for claude
AmanVarshney01 May 18, 2026
2d99680
fix: keep claude skill sync silent
AmanVarshney01 May 18, 2026
27977d5
fix: resolve prisma next packages from latest
AmanVarshney01 May 20, 2026
c5334be
fix: add minimal prisma next template
AmanVarshney01 May 20, 2026
7c16ec3
fix: stop syncing prisma next skills
AmanVarshney01 May 20, 2026
ee63efc
feat: use mongodb-memory-server for local mongo dev (#38)
ankur-arch May 21, 2026
de37dbc
fix: align prisma next templates with latest init
AmanVarshney01 May 22, 2026
8eff31c
feat: let create-prisma target a specific Prisma Next release (#40)
wmadden May 27, 2026
4db1a8d
fix: provision postgres by default with yes
AmanVarshney01 May 27, 2026
f068ff2
fix: use canonical Prisma Next layout
AmanVarshney01 May 29, 2026
52df886
fix: accept project name argument
AmanVarshney01 Jun 1, 2026
f8ac783
fix: show created project path
AmanVarshney01 Jun 1, 2026
fca2dac
fix: align templates with Prisma Next
AmanVarshney01 Aug 2, 2026
1520c3e
feat: add Prisma Composer workflow (#53)
AmanVarshney01 Aug 18, 2026
e9a5dd1
Merge remote-tracking branch 'origin/main' into HEAD
AmanVarshney01 Aug 18, 2026
f05c3a7
fix: align Prisma 8 templates with rc6 (#54)
AmanVarshney01 Aug 18, 2026
0be6e74
feat: improve Prisma deployment completion (#55)
AmanVarshney01 Aug 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 33 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
types:
- opened
- synchronize
- labeled
- reopened
- ready_for_review

Expand All @@ -22,7 +23,10 @@ concurrency:
jobs:
preview:
name: Publish PR preview
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
if: >-
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == github.repository &&
(github.event.action != 'labeled' || github.event.label.name == 'release:next')
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
Expand All @@ -39,20 +43,27 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22.14.0"
node-version: "22.18.0"
registry-url: "https://registry.npmjs.org"

- name: Compute preview metadata
id: preview
run: |
PR_NUMBER="${{ github.event.pull_request.number }}"
PUBLISH_NEXT="${{ contains(github.event.pull_request.labels.*.name, 'release:next') }}"
BASE_VERSION=$(node -e "const fs=require('fs');const p=JSON.parse(fs.readFileSync('package.json','utf8'));process.stdout.write(p.version)")
PREVIEW_VERSION="${BASE_VERSION}-pr.${PR_NUMBER}.${{ github.run_number }}.${{ github.run_attempt }}"
DIST_TAG="pr${PR_NUMBER}"
if [ "$PUBLISH_NEXT" = "true" ]; then
PREVIEW_VERSION="${BASE_VERSION}-next.${PR_NUMBER}.${{ github.run_number }}.${{ github.run_attempt }}"
DIST_TAG="next"
else
PREVIEW_VERSION="${BASE_VERSION}-pr.${PR_NUMBER}.${{ github.run_number }}.${{ github.run_attempt }}"
DIST_TAG="pr${PR_NUMBER}"
fi

echo "base_version=$BASE_VERSION" >> "$GITHUB_OUTPUT"
echo "version=$PREVIEW_VERSION" >> "$GITHUB_OUTPUT"
echo "dist_tag=$DIST_TAG" >> "$GITHUB_OUTPUT"
echo "publish_next=$PUBLISH_NEXT" >> "$GITHUB_OUTPUT"

- name: Ensure npm version for trusted publishing
run: |
Expand Down Expand Up @@ -88,6 +99,9 @@ jobs:

- name: Build
run: bun run build
env:
CREATE_PRISMA_TELEMETRY_API_KEY: ${{ steps.preview.outputs.publish_next == 'true' && secrets.CREATE_PRISMA_TELEMETRY_API_KEY || '' }}
CREATE_PRISMA_TELEMETRY_HOST: ${{ steps.preview.outputs.publish_next == 'true' && vars.CREATE_PRISMA_TELEMETRY_HOST || '' }}

- name: Publish to npm
run: npm publish --access public --tag "${{ steps.preview.outputs.dist_tag }}"
Expand All @@ -97,16 +111,21 @@ jobs:
env:
PREVIEW_VERSION: ${{ steps.preview.outputs.version }}
DIST_TAG: ${{ steps.preview.outputs.dist_tag }}
PUBLISH_NEXT: ${{ steps.preview.outputs.publish_next }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
with:
script: |
const marker = "<!-- create-prisma-preview-comment -->";
const isNext = process.env.PUBLISH_NEXT === "true";
const body = [
marker,
"## PR preview published",
isNext ? "## @next preview published" : "## PR preview published",
"",
`- Version: \`${process.env.PREVIEW_VERSION}\``,
`- Tag: \`${process.env.DIST_TAG}\``,
...(isNext
? ["- Trigger: PR has the `release:next` label, so this is available as `create-prisma@next`"]
: []),
`- Run with Bun: \`bunx create-prisma@${process.env.DIST_TAG}\``,
`- Run with npm: \`npx create-prisma@${process.env.DIST_TAG}\``,
`- Run with Yarn: \`yarn dlx create-prisma@${process.env.DIST_TAG}\``,
Expand Down Expand Up @@ -145,10 +164,17 @@ jobs:

- name: Preview summary
run: |
echo "## PR preview published" >> "$GITHUB_STEP_SUMMARY"
if [ "${{ steps.preview.outputs.publish_next }}" = "true" ]; then
echo "## @next preview published" >> "$GITHUB_STEP_SUMMARY"
else
echo "## PR preview published" >> "$GITHUB_STEP_SUMMARY"
fi
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "- Version: \`${{ steps.preview.outputs.version }}\`" >> "$GITHUB_STEP_SUMMARY"
echo "- Tag: \`${{ steps.preview.outputs.dist_tag }}\`" >> "$GITHUB_STEP_SUMMARY"
if [ "${{ steps.preview.outputs.publish_next }}" = "true" ]; then
echo "- Trigger: PR has the \`release:next\` label" >> "$GITHUB_STEP_SUMMARY"
fi
echo "- Run with Bun: \`bunx create-prisma@${{ steps.preview.outputs.dist_tag }}\`" >> "$GITHUB_STEP_SUMMARY"
echo "- Run with npm: \`npx create-prisma@${{ steps.preview.outputs.dist_tag }}\`" >> "$GITHUB_STEP_SUMMARY"
echo "- Run with Yarn: \`yarn dlx create-prisma@${{ steps.preview.outputs.dist_tag }}\`" >> "$GITHUB_STEP_SUMMARY"
Expand All @@ -175,7 +201,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22.14.0"
node-version: "22.18.0"
registry-url: "https://registry.npmjs.org"

- name: Extract version from commit message
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ node_modules
dist
.DS_Store
prisma/generated

prisma-next
prisma-cli
194 changes: 35 additions & 159 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,195 +1,71 @@
# create-prisma

Scaffold a new app with Prisma already wired up.
Create a Prisma 8 app with Prisma Composer built in.

`create-prisma` gives you a project template, Prisma setup, database scripts, and a working starting point without making you assemble everything by hand.
## Quick start

## What It Does

- creates a new app from a supported template
- adds Prisma 7 dependencies for your database
- scaffolds `prisma/schema.prisma`, `prisma/seed.ts`, `prisma.config.ts`, and Compute deploy defaults for Compute-ready templates
- writes a Prisma client singleton in the right place for the selected template
- adds `db:generate`, `db:migrate`, and `db:seed` scripts
- creates or updates the template env file with `DATABASE_URL`
- can install dependencies and run `prisma generate` for you
- can deploy the finished app to Prisma Compute and return a live URL

## Quick Start

Use the package runner you already have:

```bash
npx create-prisma@latest
```

```bash
pnpm dlx create-prisma@latest
```

```bash
yarn dlx create-prisma@latest
```

```bash
bunx create-prisma@latest
```

```bash
deno run -A npm:create-prisma@latest
```

If you already have it available locally:
Use your package manager:

```bash
create-prisma
npx create-prisma@next my-app
pnpm dlx create-prisma@next my-app
yarn dlx create-prisma@next my-app
bunx create-prisma@next my-app
```

## Common Examples
The CLI initializes Prisma 8 with `prisma@next`, installs dependencies, emits the contract, and generates a deployable Composer app. PostgreSQL projects use Composer's native Prisma Postgres provider, including migrations and a typed runtime client.

Create a project interactively:
The deployment prompt is:

```bash
create-prisma
```text
Deploy to Prisma now?
```

Create a Hono app non-interactively:
Choose no to deploy later with the generated `deploy` script.

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

Scaffold into the current directory:

```bash
create-prisma --name . --template hono --provider postgresql
```

Create a monorepo with a shared Prisma package:

```bash
create-prisma --name my-monorepo --template turborepo --provider postgresql
```

Use Prisma Postgres auto-provisioning:

```bash
create-prisma --name my-app --template nest --provider postgresql --prisma-postgres
```
When multiple Prisma workspace sessions are available, the CLI asks which workspace should receive
the deployment. For unattended usage, pass `--workspace <id-or-name>` or omit it to use the active
workspace. Choosing another workspace also updates the Prisma CLI's active workspace session.

Deploy a supported app to Prisma Compute:

```bash
create-prisma --name my-api --template hono --provider postgresql --deploy
```

With PostgreSQL and no `--database-url`, the Compute flow asks whether to use Prisma Postgres. If accepted, or if `--prisma-postgres` is passed, it creates a Prisma Compute project, creates a `main` Prisma Postgres database on the `main` branch, writes `DATABASE_URL` to the template env file, and deploys the app with the env file configured in `prisma.compute.ts`. Pass `--no-prisma-postgres` to deploy without provisioning a database.

## Supported Templates
## Templates

- `minimal`
- `hono`
- `elysia`
- `nest`
- `next`
- `svelte`
- `svelte` (SvelteKit)
- `astro`
- `nuxt`
- `tanstack-start`
- `turborepo`

Prisma Compute deployment is currently supported for:

- `hono`
- `elysia`
- `nest`
- `next`
- `astro`
- `nuxt`
- `tanstack-start`
- `turborepo`

## Supported Databases

- `postgresql`
- `mysql`
- `sqlite`
- `sqlserver`
- `cockroachdb`

## Supported Package Managers

- `npm`
- `pnpm`
- `yarn`
- `bun`
- `deno`
PostgreSQL and MongoDB are supported with PSL or TypeScript contract authoring. npm, pnpm, Yarn, and Bun are supported.

## Useful Flags
## Options

- `--name` project name or relative path
- `--template` choose the template
- `--provider` choose the database provider
- `--package-manager` choose the package manager/runtime
- `--schema-preset empty|basic`
- `--deploy` deploy supported templates to Prisma Compute
- `--yes` accept defaults and skip prompts
- `--no-install` scaffold only
- `--no-generate` skip `prisma generate`
- `--prisma-postgres` provision Prisma Postgres for PostgreSQL
- `--skills --mcp --extension` enable optional add-ons
- `--force` allow scaffolding into a non-empty directory
- `--verbose` print full command output
- positional project name or `--name`
- `--template`
- `--provider postgres|postgresql|mongo|mongodb`
- `--authoring psl|typescript`
- `--package-manager npm|pnpm|yarn|bun`
- `--deploy` / `--no-deploy`
- `--workspace <id-or-name>`
- `--yes`
- `--force`
- `--verbose`

## Add-ons
This branch intentionally targets Prisma 8 only. It does not generate a Prisma 7 compatibility path.

`create-prisma` can also help with a few optional extras:

- Prisma skills for coding agents
- Prisma MCP setup
- Prisma IDE extension install

These can be selected interactively or enabled with flags.
When Prisma Compute deploy is selected, the skills add-on recommends the `prisma-compute` skill too.

## Deploy to Prisma Compute

After scaffolding, `create-prisma` can deploy your app to [Prisma Compute](https://www.prisma.io/docs/compute), the serverless hosting for TypeScript apps that runs next to your Prisma Postgres database. It is offered for the templates the Prisma CLI can deploy today: `hono`, `elysia`, `nest`, `next`, `astro`, `nuxt`, `tanstack-start`, and `turborepo`.

Accept the deploy prompt when it appears, or pass the flag:

```bash
create-prisma --name my-api --template hono --provider postgresql --deploy
```

The deploy step signs you in with the Prisma CLI if you are not signed in yet. With PostgreSQL and no `--database-url`, create-prisma asks whether to use Prisma Postgres. If accepted, or if `--prisma-postgres` is passed, setup creates a Prisma Compute project, creates a `main` Prisma Postgres database on the `main` branch, writes `DATABASE_URL` to the template env file, runs the requested Prisma setup, then deploys the app with the env file configured in `prisma.compute.ts`. Pass `--no-prisma-postgres` to deploy without provisioning a database.

A `prisma.compute.ts` file is generated with the app framework, runtime port, target, and env-file defaults. When deployment is selected, a `compute:deploy` script is added to the generated project so you can redeploy app changes later. That script runs `@prisma/cli@latest app deploy` using `prisma.compute.ts`; it does not create a new project, create a new database, run migrations, or seed data.

The deploy prompt is skipped in `--yes` runs unless you pass `--deploy`. Browser sign-in may still need a person at the keyboard if no Prisma CLI session exists.

## Local Development
## Development

```bash
bun install
bun run test:unit
bun run typecheck
bun run check
bun run build
bun run start
```

Useful repo scripts:

- `bun run dev`
- `bun run typecheck`
- `bun run format`
- `bun run lint`
- `bun run bump`

## Telemetry

Published builds may send anonymous usage telemetry to help improve the CLI. It does not include project names, file paths, or database URLs.

Disable it with any of:

- `DO_NOT_TRACK`
- `CREATE_PRISMA_DISABLE_TELEMETRY`
- `CREATE_PRISMA_TELEMETRY_DISABLED`
Published builds may send anonymous usage telemetry. It never includes project names, file paths, or database URLs. Disable it with `DO_NOT_TRACK`, `CREATE_PRISMA_DISABLE_TELEMETRY`, or `CREATE_PRISMA_TELEMETRY_DISABLED`.
Loading
Loading