命令
本文档介绍了 Prisma 数据平台集成的 Prisma CLI 命令、参数和选项。
¥This document describes the Prisma Data Platform's integrated Prisma CLI commands, arguments, and options.
入门
¥Getting started
要开始使用,请确保你已将 Prisma CLI 更新到 5.10.0
或更高版本。这是通过 Prisma CLI 访问平台所必需的。
¥To get started, ensure you have the Prisma CLI updated to version 5.10.0
or later. This is necessary to access the Platform through the Prisma CLI.
💡 使用命令时,请始终以 prisma platform
开头并包含 --early-access
标志,以便在早期访问期间启用 Prisma 数据平台。
¥💡 When using commands, always start with prisma platform
and include the --early-access
flag to enable the use of the Prisma Data Platform whilst still in early access.
身份验证
¥Authentication
platform
auth login
打开一个浏览器窗口,允许你登录 Prisma 数据平台账户或创建一个新账户。目前,GitHub 是唯一支持的登录方式。我们计划添加使用 Google 和电子邮件/密码登录的支持。
¥Opens a browser window that allows you to log into your Prisma Data Platform account or create a new one. Currently, GitHub is the only supported login method. We do have plan to add support for signing in with Google and email/password.
npx prisma platform auth login --early-access
auth logout
退出你的 Prisma 数据平台账户。
¥Logs out of your Prisma Data Platform account.
npx prisma platform auth logout --early-access
auth show
显示有关当前经过身份验证的用户的信息。
¥Displays information about the currently authenticated user.
npx prisma platform auth show --early-access
工作区管理
¥Workspace Management
platform
workspace show
列出你账户可用的所有工作区。
¥Lists all workspaces available to your account.
npx prisma platform workspace show --early-access
项目管理
¥Project Management
platform
project show
列出指定工作区中的所有项目。
¥Lists all projects within the specified workspace.
npx prisma platform project show \
--workspace $INSERT_WORKSPACE_ID \
--early-access
参数
¥Arguments
争论 | 类型 | 必需的 | 描述 |
---|---|---|---|
--workspace -w | string | yes | 工作区 ID. 提示:你可以使用 workspace show 命令查看你的工作区 ID。 |
project create
在指定的工作区中创建一个新项目。
¥Creates a new project within the specified workspace.
npx prisma platform project create \
--workspace $INSERT_WORKSPACE_ID \
--name "INSERT_PROJECT_NAME" \
--early-access
Arguments
争论 | 类型 | 必需的 | 描述 |
---|---|---|---|
--workspace -w | string | yes | 工作区 id .提示:你可以使用 workspace show 命令查看你的工作区 ID。 |
--name -n | string | no | 项目的显示名称. 如果省略,系统将为你生成默认项目名称。 |
project delete
删除指定的项目。
¥Deletes the specified project.
npx prisma platform project delete \
--project $INSERT_PROJECT_ID \
--early-access
Arguments
争论 | 类型 | 必需的 | 描述 |
---|---|---|---|
--project -p | string | yes | 项目 id .提示:你可以使用 project show 命令查看你的项目 ID。 |
环境管理
¥Environment Management
platform
environment show
列出指定项目内的所有环境。
¥Lists all environments within the specified project.
npx prisma platform environment show \
--project $INSERT_PROJECT_ID \
--early-access
参数
¥Arguments
争论 | 类型 | 必需的 | 描述 |
---|---|---|---|
--project -p | string | yes | 项目 id .提示:你可以使用 project show 命令查看你的项目 ID。 |
environment create
在指定项目中创建新环境。
¥Creates a new environment within the specified project.
npx prisma platform environment create \
--project $INSERT_PROJECT_ID \
--name $INSERT_ENVIRONMENT_NAME \
--early-access
Arguments
争论 | 类型 | 必需的 | 描述 |
---|---|---|---|
--project -p | string | yes | 项目 id .提示:你可以使用 project show 命令查看你的项目 ID。 |
--name -n | string | no | 环境的显示名称. 如果省略,系统将为你生成默认环境名称。 |
environment delete
删除指定的环境。
¥Deletes the specified environment.
npx prisma platform environment delete \
--environment $INSERT_ENVIRONMENT_ID \
--early-access
Arguments
争论 | 类型 | 必需的 | 描述 |
---|---|---|---|
--environment -e | string | yes | 环境 id .提示:你可以使用 environment show 命令查看你的环境 ID。 |
API 密钥管理
¥API Key Management
platform
apikey show
列出指定环境的所有 API 密钥。
¥Lists all API keys for the specified environment.
npx prisma platform apikey show \
--environment $INSERT_ENVIRONMENT_ID \
--early-access
参数
¥Arguments
争论 | 类型 | 必需的 | 描述 |
---|---|---|---|
--environment -e | string | yes | 环境 id .提示:你可以使用 environment show 命令查看你的环境 ID。 |
apikey create
为指定项目创建新的 API 密钥。
¥Creates a new API key for the specified project.
npx prisma platform apikey create \
--environment $INSERT_ENVIRONMENT_ID \
--name $INSERT_API_KEY_NAME \
--early-access
Arguments
争论 | 类型 | 必需的 | 描述 |
---|---|---|---|
--environment -e | string | yes | 环境 id .提示:你可以使用 environment show 命令查看你的环境 ID。 |
--name -n | string | no | API 密钥的显示名称。 如果省略,将为你生成默认 API 密钥名称。 |
apikey delete
删除指定的 API 密钥。
¥Deletes the specified API Key.
npx prisma platform apikey delete \
--apikey $INSERT_API_KEY_ID \
--early-access
Arguments
争论 | 类型 | 必需的 | 描述 |
---|---|---|---|
--apikey | string | yes | API 密钥 id .提示:你可以使用 apikey show 命令查看你的 API 密钥 ID。 |
Prisma 加速
¥Prisma Accelerate
platform
accelerate enable
为指定环境启用 Prisma Accelerate。
¥Enables Prisma Accelerate for the specified environment.
npx prisma platform accelerate enable \
--environment $INSERT_ENVIRONMENT_ID \
--url "postgresql://username:password@host:port/database" \
--region $INSERT_CONNECTION_POOL_REGION \
--apikey true \
--early-access
Arguments
争论 | 类型 | 必需的 | 描述 |
---|---|---|---|
--environment -e | string | yes | 环境 id .提示:你可以使用 environment show 命令查看你的环境 ID。 |
--url | string | yes | 你的数据库连接字符串。 |
--region | string | no | Prisma Accelerate 托管连接池的区域。 查看可用区域列表 此处. 提示:选择距离你的数据库最近的区域以获得最佳延迟。 |
--apikey | boolean | no | 如果是,系统将为关联环境生成一个新的 API 密钥。 |
accelerate disable
针对指定环境禁用 Prisma Accelerate。
¥Disables Prisma Accelerate for the specified environment.
npx prisma platform accelerate disable \
--environment $INSERT_ENVIRONMENT_ID \
--early-access
Arguments
争论 | 类型 | 必需的 | 描述 |
---|---|---|---|
--environment -e | string | yes | 环境 id .提示:你可以使用 environment show 命令查看你的环境 ID。 |
帮助
¥Help
有问题吗?请告诉我们,我们随时为你提供帮助。通过 Discord 联系我们。
¥Have a question? Let us know, we’re here to help. Reach out to us on Discord.