Prisma is a next-generation ORM that provides a comprehensive database toolkit including type-safe query builder, declarative migrations, and GUI database management.
—
Quality
Pending
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Authentication and project management for Prisma Platform services including workspace management, environment operations, and service integrations for Pulse and Accelerate.
Access Prisma Platform services and management capabilities through the platform command interface.
/**
* Access Prisma Platform services
* Manage authentication, projects, environments, and service integrations
*/
prisma platform <command> [options]
Commands:
auth Authentication management (login, logout, show)
workspace Workspace operations (show)
environment Environment management (create, delete, show)
project Project operations (create, delete, show)
serviceToken Service token management (create, delete, show)
pulse Pulse real-time events (enable, disable)
accelerate Accelerate connection pooling (enable, disable)
Global Options:
--early-access Enable early access features
--help/-h Show platform command helpManage Prisma Platform authentication with browser-based login and credential management.
/**
* Authentication operations for Prisma Platform
* Supports GitHub and Google OAuth authentication
*/
prisma platform auth <command> [options]
Commands:
login Authenticate via browser (GitHub/Google OAuth)
logout Sign out and clear stored credentials
show Display current authenticated user informationAuthentication Examples:
# Login via browser OAuth
prisma platform auth login
# Check current authentication status
prisma platform auth show
# Sign out and clear credentials
prisma platform auth logoutAuthentication Output Example:
$ prisma platform auth show
✓ Authenticated as john@example.com
Provider: GitHub
Workspace: acme-corp
Expires: 2024-02-01T12:00:00ZDisplay and manage workspace information for Prisma Platform organization.
/**
* Workspace operations for Prisma Platform
* View workspace details and member information
*/
prisma platform workspace <command> [options]
Commands:
show Display current workspace informationWorkspace Examples:
# Display workspace information
prisma platform workspace showCreate, manage, and configure environments within Prisma Platform projects.
/**
* Environment management operations
* Create and manage project environments for different deployment stages
*/
prisma platform environment <command> [options]
Commands:
create Create new environment
delete Delete existing environment
show List environments or show specific environment details
Create Options:
--name <name> Environment name
--description <text> Environment description
--region <region> Deployment region
Delete Options:
--name <name> Environment name to delete
--force Delete without confirmation
Show Options:
--name <name> Show specific environment (optional)Environment Examples:
# List all environments
prisma platform environment show
# Show specific environment
prisma platform environment show --name production
# Create new environment
prisma platform environment create --name staging --description "Staging environment"
# Create environment with region
prisma platform environment create --name production --region us-east-1
# Delete environment
prisma platform environment delete --name old-staging
# Force delete without confirmation
prisma platform environment delete --name temp-env --forceCreate, configure, and manage projects within Prisma Platform workspaces.
/**
* Project management operations
* Create and manage projects within workspace
*/
prisma platform project <command> [options]
Commands:
create Create new project
delete Delete existing project
show List projects or show specific project details
Create Options:
--name <name> Project name
--description <text> Project description
--region <region> Default region for project resources
Delete Options:
--name <name> Project name to delete
--force Delete without confirmation
Show Options:
--name <name> Show specific project (optional)Project Examples:
# List all projects
prisma platform project show
# Show specific project
prisma platform project show --name my-app
# Create new project
prisma platform project create --name my-new-app --description "New application"
# Create project with default region
prisma platform project create --name global-app --region eu-west-1
# Delete project
prisma platform project delete --name old-project
# Force delete without confirmation
prisma platform project delete --name temp-project --forceGenerate, manage, and revoke service tokens for programmatic access to Prisma Platform APIs.
/**
* Service token management for API access
* Generate and manage tokens for CI/CD and programmatic access
*/
prisma platform serviceToken <command> [options]
Commands:
create Generate new service token
delete Revoke existing service token
show List service tokens
Create Options:
--name <name> Token name/description
--project <project> Project scope for token
--environment <env> Environment scope for token
--permissions <perms> Token permissions (comma-separated)
Delete Options:
--id <token-id> Token ID to revoke
--name <name> Token name to revoke
Show Options:
--project <project> Filter by project (optional)Service Token Examples:
# List all service tokens
prisma platform serviceToken show
# Create service token for project
prisma platform serviceToken create --name "CI/CD Token" --project my-app
# Create token with specific permissions
prisma platform serviceToken create \
--name "Deploy Token" \
--project my-app \
--environment production \
--permissions "deploy,read"
# Revoke token by ID
prisma platform serviceToken delete --id st-abc123def456
# Revoke token by name
prisma platform serviceToken delete --name "Old CI Token"
# List tokens for specific project
prisma platform serviceToken show --project my-appNote: Service tokens are also available via the deprecated apikey alias:
# Deprecated aliases (use serviceToken instead)
prisma platform apikey create --name "Legacy Token"
prisma platform apikey show
prisma platform apikey delete --id st-xyz789Enable and manage Pulse real-time event streaming for database change notifications.
/**
* Pulse real-time event streaming management
* Enable database change streams and real-time notifications
*/
prisma platform pulse <command> [options]
Commands:
enable Enable Pulse for project/environment
disable Disable Pulse streaming
Enable Options:
--project <project> Project to enable Pulse for
--environment <env> Environment to enable Pulse for
--region <region> Pulse processing region
Disable Options:
--project <project> Project to disable Pulse for
--environment <env> Environment to disable Pulse forPulse Examples:
# Enable Pulse for project
prisma platform pulse enable --project my-app --environment production
# Enable Pulse with specific region
prisma platform pulse enable \
--project my-app \
--environment production \
--region us-east-1
# Disable Pulse
prisma platform pulse disable --project my-app --environment productionEnable and configure Accelerate connection pooling and caching for improved database performance.
/**
* Accelerate connection pooling and caching management
* Enable database connection pooling and query result caching
*/
prisma platform accelerate <command> [options]
Commands:
enable Enable Accelerate for project/environment
disable Disable Accelerate pooling
Enable Options:
--project <project> Project to enable Accelerate for
--environment <env> Environment to enable Accelerate for
--region <region> Accelerate processing region
--cache-strategy <strategy> Caching strategy configuration
Disable Options:
--project <project> Project to disable Accelerate for
--environment <env> Environment to disable Accelerate forAccelerate Examples:
# Enable Accelerate for project
prisma platform accelerate enable --project my-app --environment production
# Enable Accelerate with specific region and caching
prisma platform accelerate enable \
--project my-app \
--environment production \
--region us-east-1 \
--cache-strategy ttl=300
# Disable Accelerate
prisma platform accelerate disable --project my-app --environment production# 1. Authenticate with platform
prisma platform auth login
# 2. Create project
prisma platform project create --name my-app --description "My application"
# 3. Create environments
prisma platform environment create --name development
prisma platform environment create --name staging
prisma platform environment create --name production
# 4. Enable services
prisma platform accelerate enable --project my-app --environment production
prisma platform pulse enable --project my-app --environment production# Generate service token for CI/CD
prisma platform serviceToken create \
--name "GitHub Actions" \
--project my-app \
--permissions "deploy,read"
# Use token in CI/CD (store as secret)
export PRISMA_PLATFORM_TOKEN="st-abc123def456"CI/CD Configuration Example:
# GitHub Actions
- name: Deploy to Prisma Platform
env:
PRISMA_PLATFORM_TOKEN: ${{ secrets.PRISMA_PLATFORM_TOKEN }}
run: |
prisma platform auth login --token $PRISMA_PLATFORM_TOKEN
prisma migrate deploy# Development environment
prisma platform environment show --name development
# Deploy to staging
prisma platform project show --name my-app
DATABASE_URL=$STAGING_DB_URL prisma migrate deploy
# Enable Accelerate for production
prisma platform accelerate enable \
--project my-app \
--environment productionCommon platform integration errors:
# Use platform services in local development
prisma platform auth login
export ACCELERATE_URL=$(prisma platform accelerate show --project my-app --environment development)
npm run dev// Using platform services in application
import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient({
datasourceUrl: process.env.ACCELERATE_URL, // From platform
})
// Pulse event subscription
const subscription = await prisma.$subscribe('User', {
create: true,
update: true,
})# Deploy to multiple regions
prisma platform environment create --name production-us --region us-east-1
prisma platform environment create --name production-eu --region eu-west-1
prisma platform accelerate enable --project my-app --environment production-us --region us-east-1
prisma platform accelerate enable --project my-app --environment production-eu --region eu-west-1Install with Tessl CLI
npx tessl i tessl/npm-prisma