docs/1.34/prisma-cli-and-configuration/cli-command-reference/prisma-generate-xcv2.mdx
export const meta = { title: "prisma1 generate", position: 130, }
prisma1 generateInvokes the generators specified in prisma.yml. Available generators are:
The following generators are built-into the Prisma CLI:
javascript-clienttypescript-clientflow-clientgo-clientgraphql-schemaBy default, the Prisma client is generated locally based on the datamodel. If the datamodel is currently out-of-sync with the API of the running Prisma service, it's also possible to generate the client from the live API instead of the datamodel using the --endpoint option. prisma1 generate looks up the endpoint in your prisma.yml when the option is added to the command. If you want to provide a custom endpoint, you can add it as an argument to the --endpoint option as well.
prisma1 generate [flags]
-e, --env-file ENV-FILE Path to .env file to inject env vars
-p, --project PROJECT Path to Prisma definition file
--endpoint Use a specific endpoint for schema generation or pick endpoint from prisma.yml
Generate the TypeScript client and store the generated files at ./generated/prisma
prisma.yml:
generate:
- generator: typescript-client
output: ./generated/prisma
prisma1 generate
Generate the TypeScript client from custom endpoint
prisma.yml:
generate:
- generator: typescript-client
output: ./generated/prisma
prisma1 generate --endpoint http://localhost:4466
Generate the Go client and the GraphQL schema store the generated files at ./generated/prisma
prisma.yml:
generate:
- generator: go-client
output: ./generated/prisma
- generator: graphql-schema
output: ./generated/prisma
prisma1 generate