Skip to main content
Prisma Documentation Docs
current

Search documentation

Type to search this documentation.

On this pageOverview

From the CLI

Start a Prisma ORM app with Prisma Postgres from the command line.

Use the CLI when you want Prisma ORM and Prisma Postgres set up without leaving the terminal.

bun
bun create prisma@latest
pnpm
pnpm create prisma@latest
yarn
yarn create prisma@latest
npm
npm create prisma@latest

Choose PostgreSQL when prompted, and answer No to Deploy to Prisma now?. Setup adds prisma-8.md, installs project-level Prisma ORM skills for your coding agent, and writes the generated scripts used below.

Create a Prisma Postgres database from the terminal and export its connection string. The generated scripts read the environment variable, not .env:

bun
bunx create-db@latest
pnpm
pnpm dlx create-db@latest
yarn
yarn dlx create-db@latest
npm
npx create-db@latest
Bash
export DATABASE_URL="<the connection string create-db printed>"

The command also prints a claim URL; open it within 24 hours to keep the database in your account.

From the generated project directory, run:

bun
bun run db:init
pnpm
pnpm run db:init
yarn
yarn db:init
npm
npm run db:init

Sample users are seeded automatically on the app's first query.

bun
bun run dev
pnpm
pnpm run dev
yarn
yarn dev
npm
npm run dev

If the app already exists, run Prisma ORM from the project root:

bun
bunx prisma@latest orm init
pnpm
pnpm dlx prisma@latest orm init
yarn
yarn dlx prisma@latest orm init
npm
npx prisma@latest orm init

Choose PostgreSQL and set DATABASE_URL to your Prisma Postgres connection string. Init adds prisma-8.md, package scripts, and the Prisma ORM skills for your coding agent. Then follow Add Prisma ORM to an existing PostgreSQL database.

Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu