Prisma Next is in early access.Read the docs

CLI reference

Every @prisma/cli command, flag, environment variable, and error code for Prisma Compute.

This page is the complete reference for the @prisma/cli beta package. For a guided start, see Get started with @prisma/cli.

The package installs an executable called prisma-cli. Run it without installing:

bunx @prisma/cli@latest <command>

Requires Node.js 22.12 or newer for npx and pnpm; bunx also works. The command groups are auth, project, project env, git, branch, database, app, and version. There is no init, schema, or migrate command in the beta.

auth

Manage authentication.

CommandDescription
auth loginLog in to your Prisma platform account (browser flow)
auth logoutClear stored authentication credentials
auth whoamiShow the authenticated user and accessible workspace

The browser step in auth login needs a human. Afterwards, anything running in that environment inherits the session, including coding agents. For CI, set PRISMA_SERVICE_TOKEN instead.

app

Manage apps and deployments for a project.

CommandDescription
app buildBuild the app locally into a deployable artifact
app runRun your app locally
app deployCreate a new deployment for the app
app showShow the app and its current deployment
app openOpen the app's live URL
app logsStream logs for the app's current deployment
app list-deploysList deployments for the app
app show-deploy <deployment>Show a deployment in detail
app promote <deployment>Promote a deployment to production, rebuilding with production env vars
app rollbackRoll back production to the previous deployment, without rebuilding
app removeRemove the app from the current branch

app deploy options

FlagDescription
--app <name>Target a specific app; otherwise inferred from package.json name or directory
--project <id-or-name>Target a specific project
--create-project <name>Create and link a new project before deploying
--branch <name>Deploy to a specific branch; otherwise your active Git branch, then main
--framework <name>One of nextjs, nuxt, astro, hono, tanstack-start, bun
--entry <path>Entry point, required for bun and useful when detection needs a hand
--http-port <port>HTTP port your app listens on
--env <KEY=value>Set a one-off variable for this deployment (repeatable)
--prodConfirm intent to deploy to the production branch

After the first production deploy, every later production deploy needs --prod; without it the deploy fails with PROD_DEPLOY_REQUIRES_FLAG. With --prod, the CLI asks for confirmation; pass -y / --yes to accept it up front. In non-interactive mode, a --prod deploy without --yes fails with CONFIRMATION_REQUIRED. The first production deploy is auto-promoted and needs neither flag.

app build and app run options

FlagDescription
--entry <path>Entry point for Bun apps
--build-type <type>app build: auto, bun, nextjs, nuxt, astro, tanstack-start. app run: auto, bun, nextjs
--port <port>Port for app run

Other app options

FlagApplies toDescription
--app, --projectall inspection and deploy commandsSelect the app or project explicitly
--deployment <id>app logsStream logs for a specific deployment
--to <deployment>app rollbackRoll back to a specific deployment
--yesapp remove, --prod deploysAccept the confirmation prompt

app domain

Manage custom domains for an app. All commands take a <hostname> argument plus --app / --project. Domains target the production branch; to learn more, see the Domains docs.

CommandDescription
app domain add <hostname>Register a custom domain on the app's production branch
app domain show <hostname>Show custom domain status and certificate details
app domain wait <hostname>Wait until a custom domain is active or failed
app domain retry <hostname>Retry custom domain DNS verification and TLS provisioning
app domain remove <hostname>Detach a custom domain from the app

app domain wait polls for up to 15 minutes by default; pass --timeout <duration> to change that, or --timeout 0 for a single status check. In --json mode it streams newline-delimited status events.

project

Manage projects and directory bindings.

CommandDescription
project listList all projects in your workspace
project showShow this directory's project binding
project create <name>Create a project and link the directory to it
project link [id-or-name]Link the directory to an existing project

Linking writes .prisma/local.json, a gitignored local pin of the workspace and project. It is a cache, not committed config; the CLI never reads or writes committed config files.

project env

Manage environment variables for the active project. Writes require an explicit scope: exactly one of --role <production|preview> or --branch <git-name>. To learn more, see the Environment variables docs.

CommandDescription
project env add <KEY=value|KEY>Create a variable; pass just KEY to read the value from your environment
project env update <KEY=value>Replace an existing variable's value
project env listList variable names and metadata for a scope, never values
project env remove <key>Remove a variable from a scope (rm also works)

Values are write-only: encrypted at rest and never returned by any surface. They resolve at deploy time; redeploy to apply changes.

branch

Inspect platform branches for the resolved project without creating remote state. To learn more, see the Branching docs.

CommandDescription
branch listList platform branches for the resolved project

git

Manage the GitHub repository connection. To learn more, see the GitHub integration docs.

CommandDescription
git connect [git-url]Link the project to a GitHub repository; starts the GitHub App install flow if needed
git disconnectStop push-triggered automation; keeps the project and existing branches

In --json / --no-interactive mode, git connect returns an install URL instead of blocking.

version

CommandDescription
versionShow CLI build and environment

Global flags

FlagDescription
--jsonEmit structured JSON output
-y, --yesAccept supported confirmation prompts
-q, --quiet / -v, --verboseAdjust output verbosity
--traceShow deeper diagnostics for failures
--interactive / --no-interactiveForce or disable prompts; non-interactive fails instead of asking
--color / --no-colorControl colored output
--versionPrint the CLI version

JSON output

In --json mode, every command returns an envelope you can branch on:

  • ok: true or false.
  • result: the command's data, when ok is true.
  • error.code, error.summary, error.why, error.fix: what failed and what to do about it.
  • nextSteps and nextActions: exact follow-up commands, useful for agents.

Branch on error.code, not the message text: codes are a stable contract, while message wording can change between releases.

Agent skills

An agent skill teaches a coding agent the Compute deploy workflow. Install it into a repo with:

bunx skills add prisma/skills --skill prisma-compute

This adds the prisma-compute skill to .agents/skills/, where supported agents pick it up. To install every Prisma skill at once, run npx skills add prisma/skills. To learn more, see Agent skills in the getting started guide.

Environment variables

VariableDescription
PRISMA_SERVICE_TOKENAuthenticate without a browser (CI); takes priority over any stored session
PRISMA_PROJECT_IDOverride the project resolved from .prisma/local.json
PRISMA_APP_IDOverride the app resolution

Error codes

The common codes, grouped by area:

General

CodeMeaning
AUTH_REQUIREDNo session or service token. Run auth login or set PRISMA_SERVICE_TOKEN.
CONFIRMATION_REQUIREDA confirmation prompt can't run here (e.g. a --prod deploy in non-interactive mode, or app remove). Pass --yes.
USAGE_ERRORInvalid arguments or flags. Check the command's --help.
FEATURE_UNAVAILABLEThe platform can't serve this yet (e.g. logs for some deployments).

Projects and apps

CodeMeaning
PROJECT_SETUP_REQUIREDNo project resolved. Pass --project or --create-project.
PROJECT_NOT_FOUNDThe named project doesn't exist or isn't visible to you.
APP_AMBIGUOUSMore than one app matched. Pass --app <name>.
FRAMEWORK_NOT_DETECTEDThe CLI couldn't detect your framework. Pass --framework.

Deployments

CodeMeaning
PROD_DEPLOY_REQUIRES_FLAGA production deploy is missing explicit intent. Re-run with --prod.
BUILD_FAILEDThe app failed to build. Check the build output.
DEPLOY_FAILEDThe deployment failed after the build.
DEPLOYMENT_NOT_FOUNDThe deployment id doesn't exist for this app.
NO_PREVIOUS_DEPLOYMENTNothing to roll back to.

Environment variables

CodeMeaning
ENV_VARIABLE_ALREADY_EXISTSThe key exists in this scope. Use update instead.
ENV_VARIABLE_NOT_FOUNDNo variable with that key in this scope.
ENV_BRANCH_SCOPE_IS_PRODUCTIONBranch overrides can't target the production branch.

Domains

CodeMeaning
BRANCH_NOT_DEPLOYABLEDomain commands targeted a non-production branch.
DOMAIN_ALREADY_REGISTEREDThe hostname is already registered.
DOMAIN_DNS_NOT_CONFIGUREDThe CNAME record isn't visible yet.
DOMAIN_VERIFICATION_FAILEDDNS verification or TLS provisioning failed.
DOMAIN_QUOTA_EXCEEDEDThe app already has 3 custom domains.
DOMAIN_RETRY_NOT_ELIGIBLEThe domain isn't in a retryable state.

GitHub

CodeMeaning
REPO_NOT_CONNECTEDNo repository connected. Run git connect first.
REPO_ALREADY_CONNECTEDThe project is already connected to a repository.
REPO_INSTALLATION_REQUIREDThe Prisma GitHub App isn't installed in the workspace.
REPO_PROVIDER_UNSUPPORTEDgit connect with a non-GitHub provider.

On this page