Index of every page on this site: llms.txt
All skills
prisma avatar

/prisma-compute

@a6f1929 official
by prismaprisma/skills80 stars
8
Run it yourself

Deploy and operate apps on Prisma Compute with the Prisma 8 CLI. Use whenever the user mentions Prisma Compute, deploying or hosting a Prisma app, `prisma deploy`, `prisma dev module.ts`, Prisma Composer apps (`module.ts`, `compute()`, the `composer` section of `prisma.config.ts`), preview stages, deploy on push (`prisma git connect`, `prisma/cloud-deploy-action`), `prisma service` logs, versions, rollback, or custom domains, `project env`, `PRISMA_SERVICE_TOKEN`, regions, 504s, sleeping instances, or `waitUntil`; also when a project still uses the removed `@prisma/cli app deploy`, `prisma.compute.ts`, `defineComputeConfig`, `compute:deploy`, or `build logs` surface.

Use this Skill: https://skilld.dev/gh/prisma/skills/prisma-compute

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesautomation-rest-api.md

≈1.4k tokens on demand. Your agent reads this file only when SKILL.md points to it.

automation-rest-api

Programmatic access to Compute: the Management REST API, the Composer control API, and what became of @prisma/compute-sdk.

Priority

MEDIUM

Why It Matters

Deploys now go through Composer, so low-level deploy clients from the earlier flow create resources that no module.ts declares. Use the CLI or the control API to deploy, and the REST API to read state, stream logs, and integrate with other tools.

Choose the Surface

Goal Use
Deploy or tear down an app prisma deploy, or deploy/destroy from @prisma/composer/control
Deploy from GitHub prisma/cloud-deploy-action (deploy-on-push.md)
Read services, versions, builds, logs from your own tool REST API
A coding agent with its own credential and approval policy Agent enrollment (REST API)

REST API

Base URL https://api.prisma.io/v1. The current OpenAPI document is at https://api.prisma.io/v1/doc; read it for exact payloads instead of copying shapes from memory. Authenticate with Authorization: Bearer <workspace service token> or an OAuth token. The Compute endpoints are marked experimental and can change.

Resource Paths
Projects GET/POST /v1/projects, GET/PATCH/DELETE /v1/projects/{id}
Branches GET/POST /v1/projects/{projectId}/branches (gitName filter), GET/PATCH/DELETE /v1/branches/{branchId}
Services GET/POST /v1/services (filter by projectId, branchId, branchGitName), GET/PATCH/DELETE /v1/services/{serviceId}
Versions (deployments) GET/POST /v1/services/{serviceId}/deployments, GET/DELETE /v1/deployments/{deploymentId}, POST /v1/deployments/{deploymentId}/start, POST /v1/deployments/{deploymentId}/stop
Promote and rollback POST /v1/services/{serviceId}/promote, POST /v1/services/{serviceId}/rollback
Logs GET /v1/deployments/{deploymentId}/logs
Builds GET/POST /v1/builds (filter by projectId, branchId, state), GET/PATCH /v1/builds/{buildId}
Domains GET/POST /v1/services/{serviceId}/domains, GET/DELETE /v1/domains/{domainId}, POST /v1/domains/{domainId}/retry
Environment variables GET/POST /v1/environment-variables (filter by projectId, class, key, branchId), GET/PATCH/DELETE /v1/environment-variables/{envVarId}

The /v1/apps paths (/v1/apps, /v1/apps/{appId}/deployments, /promote, /rollback, /domains) are deprecated. Use the /v1/services equivalents.

Logs

GET /v1/deployments/{deploymentId}/logs takes tail, from_start, or cursor. A plain GET returns newline-delimited JSON: type: "log" records, then a type: "terminal" record carrying the cursor for the next page. Send Upgrade: websocket to follow live; a live segment ends after 10 minutes with the same terminal record, so reconnect with the cursor.

Builds

A build record is what a deploy reports about itself: the deploy action and prisma deploy both write to it. GET /v1/builds/{buildId} returns its state, failingStep, errorMessage, externalLogUrl (for example the GitHub Actions run), and deployedUrl. There is no build log endpoint; the log lives at externalLogUrl or in the terminal that ran the deploy. prisma deploy --build-id <id> joins a build record your CI created with POST /v1/builds.

Secrets

Environment variable values are write-only: no endpoint returns them. Do not log tokens, connection URLs, or env values.

Control API

@prisma/composer/control runs the CLI's operations in-process and returns { ok: true, value } or { ok: false, failure } with a dotted failure.code:

import { deploy } from "@prisma/composer/control";
import prismaConfig from "./prisma.config.ts";

const result = await deploy({
  entry: "module.ts",
  config: { value: prismaConfig.composer, file: "prisma.config.ts" },
  stage: "pr-42",
});
if (!result.ok) throw new Error(`${result.failure.code}: ${result.failure.message}`);
  • Operations: deploy, destroy, dev, log. config is required in 0.28.0.
  • deploy and destroy read only PRISMA_SERVICE_TOKEN and PRISMA_WORKSPACE_ID, never the auth login session. Without them they fail with environment variable PRISMA_WORKSPACE_ID is required.
  • log tails a locally running prisma dev app; it is not a platform log reader.
  • The engine's own output still streams to stdio.

@prisma/compute-sdk

@prisma/compute-sdk 0.43.0 is still on npm, and the CLI uses it internally for service operations and log streaming. Its deploy() build strategies and defineComputeConfig belong to the removed flow: no CLI command reads prisma.compute.ts, and its app client calls the deprecated /v1/apps endpoints. Do not start new deploy automation on it, and remove it from projects that used it only for defineComputeConfig.

Bad

import { ComputeClient, PreBuilt } from "@prisma/compute-sdk";

await new ComputeClient(apiClient).deploy({
  strategy: new PreBuilt({ appPath: "./dist", entrypoint: "index.js" }),
  projectId: "proj_abc",
  appName: "my-app",
});

This creates an app outside any Composer declaration, through deprecated endpoints.

Good

Deploy with prisma deploy module.ts or the control API, and read the result back with GET /v1/services?projectId=... and GET /v1/deployments/{deploymentId}/logs.

References

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts10d3 checks · Risk SAFE
  • Gen Agent Trust Hub11d

    The skill provides comprehensive instructions for deploying and managing applications on Prisma Compute using the Prisma 8 CLI. It follows security best practices, such as redacting environment variables before display and warning against sharing secrets. All external resources and tools originate from trusted Prisma domains and repositories.

  • Socket10d

    No alerts

  • Snyk11d

    Risk: LOW · No issues

Signed by skilld at a6f1929. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last week.

Activeupdated 2 weeks ago
metadata
{
  "author": "prisma",
  "version": "2.1.0"
}

README badge

README badge for prisma/skills/prisma-compute

Guides agents through deploying TypeScript apps to Prisma Compute using the `@prisma/cli app deploy` command or `create-prisma` scaffolding. Covers framework-specific readiness (Next.js, Hono, Elysia, Astro, Nuxt, etc.), host/port binding, environment variables, branch deployments, and troubleshooting of the Compute CLI surface.

Generated from the current SKILL.md.

Does this skill cover deploying existing apps or only new scaffolds?
Both. It covers deploying existing TypeScript apps using the generated `compute:deploy` script or `@prisma/cli app deploy`, and scaffolding new apps with `create-prisma --deploy`. Prefer the generated script if your project already has one.
What frameworks does Prisma Compute support?
Current CLI deploy support includes Next.js, Hono, TanStack Start, and Bun. The skill covers deploy readiness checks for Elysia, Astro, Nuxt, Svelte, Nest, and Turborepo, but verify current CLI help output before deploying any framework.
Do I need to use `@prisma/cli` or the old Prisma CLI for Compute?
Use `@prisma/cli@latest` for Compute app deployment unless your help output shows the command has moved. Always verify current CLI help before assuming package names or flags.
What do I need to fix if my server won't accept connections after deploying?
Ensure your app binds to all interfaces (`0.0.0.0` or the framework equivalent) and reads the `PORT` environment variable, not hardcoded `localhost` or `127.0.0.1`. Loopback-only listeners appear ready locally but fail in production.
How do I deploy without interactive browser auth?
Use a stored CLI login or set `PRISMA_SERVICE_TOKEN` in your environment. Run with `--json --no-interactive` for agent-readable output. Never print the token.

Generated from the current SKILL.md. These answers refresh after source changes.