|
1 | | -# Prisma CLI Beta |
| 1 | +<p align="center"> |
| 2 | + <img src="https://i.imgur.com/h6UIYTu.png" alt="Prisma" width="360" /> |
| 3 | +</p> |
2 | 4 |
|
3 | | -Beta npm package for the unified Prisma CLI. |
| 5 | +# Prisma CLI |
4 | 6 |
|
5 | | -Install: |
| 7 | +[](https://www.npmjs.com/package/@prisma/cli) |
| 8 | +[](https://github.com/prisma/prisma-cli/blob/main/LICENSE) |
| 9 | +[](https://www.npmjs.com/package/@prisma/cli) |
| 10 | + |
| 11 | +[Quickstart](#quickstart) • [Commands](#commands) • [Beta notes](#beta-notes) • [Documentation](#documentation) • [Support](#support) |
| 12 | + |
| 13 | +--- |
| 14 | + |
| 15 | +`@prisma/cli` is the public beta of the new CLI for the |
| 16 | +Prisma Developer Platform. |
| 17 | + |
| 18 | +It is the terminal surface managing your platform projects, branches, apps, |
| 19 | +deployments, and environment variables. |
| 20 | + |
| 21 | +The command model is under active development to include tooling for your |
| 22 | +schema, database, migration, and broader platform workflows. |
| 23 | + |
| 24 | +Looking for Prisma ORM commands such as `prisma generate`, `prisma migrate`, or |
| 25 | +`prisma studio`? Use the [`prisma`](https://www.npmjs.com/package/prisma) |
| 26 | +package. |
| 27 | + |
| 28 | +--- |
| 29 | + |
| 30 | +## Quickstart |
| 31 | + |
| 32 | +Install the beta package locally: |
6 | 33 |
|
7 | 34 | ```bash |
8 | | -pnpm add -D @prisma/cli |
| 35 | +npm install --save-dev @prisma/cli |
9 | 36 | ``` |
10 | 37 |
|
11 | | -Run: |
| 38 | +Run the binary exposed by this package: |
12 | 39 |
|
13 | 40 | ```bash |
14 | | -pnpm prisma-cli --help |
| 41 | +npx prisma-cli --help |
| 42 | +npx prisma-cli auth login |
| 43 | +npx prisma-cli app deploy |
| 44 | +``` |
| 45 | + |
| 46 | +With `pnpm`: |
| 47 | + |
| 48 | +```bash |
| 49 | +pnpm add -D @prisma/cli |
15 | 50 | pnpm prisma-cli auth login |
16 | | -pnpm prisma-cli app deploy --env DATABASE_URL=postgresql://example |
17 | | -pnpm prisma-cli app list-env |
| 51 | +pnpm prisma-cli app deploy |
| 52 | +``` |
| 53 | + |
| 54 | +Useful next commands: |
| 55 | + |
| 56 | +```bash |
| 57 | +npx prisma-cli app logs |
| 58 | +npx prisma-cli app open |
| 59 | +npx prisma-cli project env add DATABASE_URL=postgresql://example --role preview |
| 60 | +npx prisma-cli project env list --role preview |
18 | 61 | ``` |
19 | 62 |
|
20 | | -The package exposes `prisma-cli` so it can coexist with the existing `prisma` |
21 | | -executable. |
| 63 | +The beta package exposes `prisma-cli` so it can coexist with the existing |
| 64 | +`prisma` executable. |
22 | 65 |
|
23 | | -Notes: |
| 66 | +--- |
24 | 67 |
|
| 68 | +## Commands |
| 69 | + |
| 70 | +| Group | What it does | |
| 71 | +| --- | --- | |
| 72 | +| `version` | Show the installed CLI build and host environment. | |
| 73 | +| `auth` | Log in, log out, and inspect the active Prisma account. | |
| 74 | +| `project` | List projects, show the resolved project, and manage project environment variables. | |
| 75 | +| `git` | Connect or disconnect a project from a GitHub repository. | |
| 76 | +| `branch` | Inspect the Prisma branch that maps to the current work context. | |
| 77 | +| `app` | Build, run, deploy, inspect, open, stream logs, promote, roll back, and remove apps. | |
| 78 | + |
| 79 | +Common examples: |
| 80 | + |
| 81 | +```bash |
| 82 | +npx prisma-cli version |
| 83 | +npx prisma-cli auth whoami |
| 84 | +npx prisma-cli project show |
| 85 | +npx prisma-cli branch show |
| 86 | +npx prisma-cli app deploy --branch feat-login --framework nextjs |
| 87 | +npx prisma-cli app promote <deployment-id> |
| 88 | +``` |
| 89 | + |
| 90 | +### Built for humans, CI, and agents |
| 91 | + |
| 92 | +- Human-readable output by default. |
| 93 | +- `--json` for structured output. |
| 94 | +- `--no-interactive` and `--yes` for automation. |
| 95 | +- `PRISMA_SERVICE_TOKEN` for headless authenticated commands. |
| 96 | +- Stable command groups, flags, and error codes for scripts and agents. |
| 97 | +- Environment variable values are not printed back to the terminal. |
| 98 | + |
| 99 | +--- |
| 100 | + |
| 101 | +## Beta notes |
| 102 | + |
| 103 | +- Requires Node.js 20 or newer. |
25 | 104 | - This is a beta package and may change quickly. |
26 | | -- `prisma.config.ts` stores linked project context for this CLI. |
27 | | -- Environment variable values passed with `--env` are not printed back to the terminal. |
| 105 | +- Official beta releases publish as `@prisma/cli`. |
| 106 | +- The package binary is `prisma-cli`, not `prisma`, during beta. |
| 107 | +- Local project context is cached in `.prisma/local.json`, which is gitignored and not a declarative repo config file. |
| 108 | + |
| 109 | +--- |
| 110 | + |
| 111 | +## Documentation |
| 112 | + |
| 113 | +- [CLI docs index](https://github.com/prisma/prisma-cli/blob/main/docs/README.md) |
| 114 | +- [Resource model](https://github.com/prisma/prisma-cli/blob/main/docs/product/resource-model.md) |
| 115 | +- [Command principles](https://github.com/prisma/prisma-cli/blob/main/docs/product/command-principles.md) |
| 116 | +- [Command spec](https://github.com/prisma/prisma-cli/blob/main/docs/product/command-spec.md) |
| 117 | +- [Output conventions](https://github.com/prisma/prisma-cli/blob/main/docs/product/output-conventions.md) |
| 118 | +- [Error conventions](https://github.com/prisma/prisma-cli/blob/main/docs/product/error-conventions.md) |
| 119 | + |
| 120 | +## Support |
| 121 | + |
| 122 | +Issues and feedback are welcome while the CLI is in public beta. Please use |
| 123 | +[GitHub issues](https://github.com/prisma/prisma-cli/issues) for bug reports and |
| 124 | +feature requests. |
| 125 | + |
| 126 | +Security reports should follow Prisma's |
| 127 | +[security policy](https://github.com/prisma/prisma-cli/blob/main/SECURITY.md) |
| 128 | +and should not be filed as public issues. |
| 129 | + |
| 130 | +## License |
| 131 | + |
| 132 | +Apache-2.0 |
0 commit comments