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.

referencesdeploy-on-push.md

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

deploy-on-push

Deploy every pushed branch from the repository's own GitHub Actions with prisma/cloud-deploy-action.

Priority

HIGH

Why It Matters

The platform does not build on push. A connected repository without a workflow deploys nothing and reports no error, and a workflow without the connection skips with a green run. Both pieces are required, and a push to the default branch deploys production without any further prompt.

How It Works

  1. The connection. prisma git connect installs the Prisma GitHub App (if needed) and links the repository to the project. It lets workflow runs exchange their GitHub OIDC token for a 30-minute workspace token, and it tears down a preview when its Git branch is deleted.
  2. The workflow. prisma/cloud-deploy-action runs install, your build command, and prisma deploy <module>. The default branch deploys production; any other branch deploys a stage named after it.

The Console can do both at once: importing the repository there opens a pull request that adds the workflow. The CLI only creates the connection.

Setup From the CLI

npx prisma project link <app-name>          # deploy does not link the directory
npx prisma git connect                      # uses the origin remote; needs an interactive terminal

git connect opens a browser for the GitHub App install and waits, so a person has to run it. With --no-interactive it fails with CLI.INTERACTION_REQUIRED; use the Console instead in that case. It fails with PROJECT.SETUP_REQUIRED when the directory is not linked.

Then commit the workflow:

# .github/workflows/prisma-deploy.yml
name: prisma-deploy

on:
  push:

concurrency:
  group: prisma-deploy-${{ github.ref }}
  cancel-in-progress: false

permissions:
  contents: read
  id-token: write

jobs:
  deploy:
    if: github.ref_type == 'branch'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 22
      - uses: oven-sh/setup-bun@v2
      - uses: prisma/cloud-deploy-action@v1
        with:
          build-command: npm run build
  • id-token: write is required for the OIDC exchange.
  • Bun 1.3.10 or newer must be on the runner PATH; oven-sh/setup-bun@v2 provides it.
  • GitHub reads the workflow from the pushed commit, so a branch created before the file existed deploys nothing until it contains the file.

Action Inputs and Outputs

Inputs (from action.yml in v1.9.0):

Input Default Notes
build-command npm run build Run verbatim; none skips the build
install-command auto npm ci or bun install --frozen-lockfile from the lockfile; pnpm and yarn need an explicit value
module module.ts The Composer entry
stage derived Empty: default branch is production, other branches become a stage of the same name
working-directory . For monorepos
prisma-version 8.0.0-rc.9 Used only when the repository has no prisma dev dependency; otherwise the installed version deploys
mode deploy destroy does not work against the current CLI

Outputs: outcome (succeeded, failed, skipped-no-credential), url (root service), urls (JSON map of service address to URL), build-id, report-path. Repositories that are not connected can pass PRISMA_SERVICE_TOKEN from a secret in the step's env; an explicit token wins over OIDC.

Checking a Push

  • Watch the run in the repository's Actions tab. The job summary lists each service URL and, on failure, the cause.
  • outcome: skipped-no-credential means the repository is not connected, id-token: write is missing, or the run came from a fork.
  • CLI.UNKNOWN_COMMAND in the deploy step means an action release up to v1.5.0, which called the removed prisma composer commands. Use @v1 (v1.9.0 or later).
  • From a terminal: npx prisma service list --branch <git-branch> --json.
  • Deleting the Git branch removes the preview's services, databases, and buckets. Production and the default branch are never torn down.

Bad

Running npx prisma git connect, pushing, and reporting the app as deployed. The connection alone builds and deploys nothing.

Good

Connect, commit .github/workflows/prisma-deploy.yml, push a non-default branch first, confirm the run's url responds, and only then merge to the default branch with the user's go-ahead.

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.