# generate (Prisma CLI v7) (/docs/cli/v7/generate) > For the complete Prisma documentation index, see [llms.txt](https://www.prisma.io/docs/llms.txt). A markdown version of any docs page is available by appending `.md` to its URL. Generate artifacts like Prisma Client based on your Prisma schema Location: CLI > v7 > generate The `prisma generate` command generates assets like Prisma Client based on the [`generator`](https://www.prisma.io/docs/orm/v7/prisma-schema/overview/generators) and [`data model`](https://www.prisma.io/docs/orm/v7/prisma-schema/data-model/models) blocks defined in your `schema.prisma` file. ## Usage [#usage] ```bash prisma generate [options] ``` ## How it works [#how-it-works] 1. Inspects the current directory to find a Prisma schema 2. Generates a customized Prisma Client based on your schema into the output directory specified in the generator block ## Prerequisites [#prerequisites] Add a generator definition in your `schema.prisma` file: ```prisma generator client { provider = "prisma-client" output = "./generated" } ``` ## Options [#options] | Option | Description | | ------------------ | ------------------------------------------------------ | | `-h`, `--help` | Display help message | | `--config` | Custom path to your Prisma config file | | `--schema` | Custom path to your Prisma schema | | `--sql` | Generate typed SQL module | | `--watch` | Watch the Prisma schema and regenerate after changes | | `--generator` | Generator to use (can be provided multiple times) | | `--no-hints` | Hide hint messages (still outputs errors and warnings) | | `--require-models` | Do not allow generating a client without models | ## Examples [#examples] ### Generate Prisma Client [#generate-prisma-client] #### bun ```bash bunx prisma generate ``` #### pnpm ```bash pnpm prisma generate ``` #### yarn ```bash yarn prisma generate ``` #### npm ```bash npx prisma generate ``` Output: ```text ✔ Generated Prisma Client to ./node_modules/.prisma/client in 61ms You can now start using Prisma Client in your code: import { PrismaClient } from '../prisma/generated/client' const prisma = new PrismaClient() ``` ### Generate with a custom schema path [#generate-with-a-custom-schema-path] #### bun ```bash bunx prisma generate --schema=./alternative/schema.prisma ``` #### pnpm ```bash pnpm prisma generate --schema=./alternative/schema.prisma ``` #### yarn ```bash yarn prisma generate --schema=./alternative/schema.prisma ``` #### npm ```bash npx prisma generate --schema=./alternative/schema.prisma ``` ### Watch mode [#watch-mode] Automatically regenerate when the schema changes: #### bun ```bash bunx prisma generate --watch ``` #### pnpm ```bash pnpm prisma generate --watch ``` #### yarn ```bash yarn prisma generate --watch ``` #### npm ```bash npx prisma generate --watch ``` Output: ```text Watching... /home/prismauser/prisma/schema.prisma ✔ Generated Prisma Client to ./node_modules/.prisma/client in 45ms ``` ### Generate specific generators [#generate-specific-generators] Run only specific generators: #### bun ```bash bunx prisma generate --generator client ``` #### pnpm ```bash pnpm prisma generate --generator client ``` #### yarn ```bash yarn prisma generate --generator client ``` #### npm ```bash npx prisma generate --generator client ``` Multiple generators: #### bun ```bash bunx prisma generate --generator client --generator zod_schemas ``` #### pnpm ```bash pnpm prisma generate --generator client --generator zod_schemas ``` #### yarn ```bash yarn prisma generate --generator client --generator zod_schemas ``` #### npm ```bash npx prisma generate --generator client --generator zod_schemas ``` ## Generated assets [#generated-assets] The `prisma-client` generator creates a customized client for working with your database. You can [customize the output folder](https://www.prisma.io/docs/orm/v7/reference/prisma-schema-reference#fields-for-prisma-client-provider) using the `output` field in the generator block. ## Related pages - [`db`](https://www.prisma.io/docs/cli/v7/db): Manage your database schema and lifecycle during development - [`debug`](https://www.prisma.io/docs/cli/v7/debug): Display Prisma debug information including schema paths, engine binaries, environment variables, and cache directories for troubleshooting - [`dev`](https://www.prisma.io/docs/cli/v7/dev): Start a local Prisma Postgres server for development - [`format`](https://www.prisma.io/docs/cli/v7/format): Format and validate your Prisma schema file with consistent structure - [`init`](https://www.prisma.io/docs/cli/v7/init): Set up a new Prisma project in the current directory