Prisma CLI reference
This document describes the Prisma CLI commands, arguments, and options.
Commands
version
(-v
)
The version
command outputs information about your current prisma
version, platform, and engine binaries.
Options
The version
command recognizes the following options to modify its behavior:
Option | Required | Description |
---|---|---|
--json | No | Outputs version information in JSON format. |
Examples
Output version information
prisma version
Show CLI results
Environment variables loaded from .env
prisma : 2.21.0-dev.4
@prisma/client : 2.21.0-dev.4
Current platform : windows
Query Engine : query-engine 2fb8f444d9cdf7c0beee7b041194b42d7a9ce1e6 (at C:\Users\veroh\AppData\Roaming\npm\node_modules\@prisma\cli\query-engine-windows.exe)
Migration Engine : migration-engine-cli 2fb8f444d9cdf7c0beee7b041194b42d7a9ce1e6 (at C:\Users\veroh\AppData\Roaming\npm\node_modules\@prisma\cli\migration-engine-windows.exe)
Format Binary : prisma-fmt 60ba6551f29b17d7d6ce479e5733c70d9c00860e (at node_modules\@prisma\engines\prisma-fmt-windows.exe)
Default Engines Hash : 60ba6551f29b17d7d6ce479e5733c70d9c00860e
Studio : 0.365.0
Output version information (-v
)
prisma -v
Show CLI results
Environment variables loaded from .env
prisma : 2.21.0-dev.4
@prisma/client : 2.21.0-dev.4
Current platform : windows
Query Engine : query-engine 2fb8f444d9cdf7c0beee7b041194b42d7a9ce1e6 (at C:\Users\veroh\AppData\Roaming\npm\node_modules\@prisma\cli\query-engine-windows.exe)
Migration Engine : migration-engine-cli 2fb8f444d9cdf7c0beee7b041194b42d7a9ce1e6 (at C:\Users\veroh\AppData\Roaming\npm\node_modules\@prisma\cli\migration-engine-windows.exe)
Format Binary : prisma-fmt 60ba6551f29b17d7d6ce479e5733c70d9c00860e (at node_modules\@prisma\engines\prisma-fmt-windows.exe)
Default Engines Hash : 60ba6551f29b17d7d6ce479e5733c70d9c00860e
Studio : 0.365.0
Output version information as JSON
prisma version --json
Show CLI results
Environment variables loaded from .env
{
"prisma": "2.21.0-dev.4",
"@prisma/client": "2.21.0-dev.4",
"current-platform": "windows",
"query-engine": "query-engine 60ba6551f29b17d7d6ce479e5733c70d9c00860e (at node_modules\\@prisma\\engines\\query-engine-windows.exe)",
"migration-engine": "migration-engine-cli 60ba6551f29b17d7d6ce479e5733c70d9c00860e (at node_modules\\@prisma\\engines\\migration-engine-windows.exe)",
"format-binary": "prisma-fmt 60ba6551f29b17d7d6ce479e5733c70d9c00860e (at node_modules\\@prisma\\engines\\prisma-fmt-windows.exe)",
"default-engines-hash": "60ba6551f29b17d7d6ce479e5733c70d9c00860e",
"studio": "0.365.0"
}
init
Bootstraps a fresh Prisma ORM project within the current directory.
The init
command does not interpret any existing files. Instead, it creates a prisma
directory containing a bare-bones schema.prisma
file within your current directory.
Arguments
Argument | Required | Description | Default |
---|---|---|---|
--datasource-provider | No | Specifies the value for the provider field in the datasource block. Options are sqlite , postgresql , mysql , sqlserver , mongodb and cockroachdb . | postgresql |
--url | No | Define a custom datasource url. | |
--generator-provider | No | Define the generator provider to use. | prisma-client-js |
--preview-feature | No | Define the Preview features to use. To define multiple Preview features, you have to provide the flag multiple times for each Preview feature. See example | |
--output | No | Specifies the output location for the generated client. | node_modules/.prisma/client |
--with-model | No | Adds a simple User model to the initial Prisma schema. Available since version 5.14.0 . |