@prisma/compute-cli
v0.14.0
Published
Command-line interface for deploying and managing [Prisma Compute](https://www.prisma.io/compute) services.
Keywords
Readme
Compute CLI
Command-line interface for deploying and managing Prisma Compute services.
Quick start
Run directly with bunx (no install required):
bunx @prisma/compute-cli --helpAlso works with
npx @prisma/compute-cliif you don't have Bun installed.
Authentication
Interactive login (browser-based)
bunx @prisma/compute-cli loginThis opens your browser for OAuth authentication with Prisma. Tokens are stored locally:
| Platform | Path |
| -------- | ---------------------------------------------------------------------------------------------- |
| macOS | ~/Library/Application Support/prisma-compute/auth.json |
| Linux | $XDG_CONFIG_HOME/prisma-compute/auth.json (defaults to ~/.config/prisma-compute/auth.json) |
| Windows | %APPDATA%\prisma-compute\auth.json |
To log out and clear stored credentials:
bunx @prisma/compute-cli logoutService token (CI / non-interactive)
Set the PRISMA_API_TOKEN environment variable. When present, the CLI skips the stored OAuth credentials and authenticates with this token directly.
export PRISMA_API_TOKEN="your-service-token"
bunx @prisma/compute-cli projects listCommands
All commands except login and logout support --json for machine-readable output.
Deploy
Build and deploy your application:
bunx @prisma/compute-cli deploy --path ./my-appKey flags:
| Flag | Description |
| ----------------- | ---------------------------------------------------------------------------------- |
| --path | App directory (default: .) |
| --project | Project ID (prompted interactively if omitted) |
| --service | Compute service ID (prompted interactively if omitted) |
| --entrypoint | File to run at startup, relative to --path (falls back to package.json main) |
| --serviceName | Name for a new compute service |
| --region | Region for a new compute service |
| --env KEY=VALUE | Environment variable (repeatable) |
| --httpPort | HTTP port your application listens on (default: 8080) |
| --skipBuild | Deploy a pre-built artifact (requires --entrypoint) |
| --timeout | Poll timeout in seconds (default: 120) |
| --pollInterval | Poll interval in ms (default: 1000) |
| --json | Output JSON instead of human-readable text |
Set PRISMA_COMPUTE_SERVICE_ID to skip the --service flag across all commands:
export PRISMA_COMPUTE_SERVICE_ID="your-service-id"
bunx @prisma/compute-cli deploy --path ./my-appEnvironment variables
Update environment variables on a running service (creates a new version):
bunx @prisma/compute-cli env update --env DATABASE_URL=postgres://... --env NODE_ENV=productionProjects
bunx @prisma/compute-cli projects listServices
bunx @prisma/compute-cli services list --project <id>
bunx @prisma/compute-cli services create --project <id> --name my-service --region <region>
bunx @prisma/compute-cli services show <service-id>
bunx @prisma/compute-cli services delete <service-id>
bunx @prisma/compute-cli services destroy <service-id> # stops all versions, then deletesVersions
bunx @prisma/compute-cli versions list --service <id>
bunx @prisma/compute-cli versions show <version-id>
bunx @prisma/compute-cli versions start <version-id>
bunx @prisma/compute-cli versions stop <version-id>
bunx @prisma/compute-cli versions delete <version-id>
bunx @prisma/compute-cli versions destroy <version-id> # stops, then deletesJSON output
Pass --json to any command for structured output suitable for scripting:
bunx @prisma/compute-cli services list --project <id> --json | jq '.value[].id'Configuration
| Variable | Description |
| --------------------------- | -------------------------------------- |
| PRISMA_API_TOKEN | Service token for non-interactive auth |
| PRISMA_COMPUTE_SERVICE_ID | Default compute service ID |
| PRISMA_MANAGEMENT_API_URL | Override the management API base URL |
Development
bun run bin/compute --help
bun run bin/compute deploy --path .