Skip to content

Commit b74f322

Browse files
authored
Merge pull request #46 from prisma/feat/cli-npm-readme
2 parents 31a41f6 + b696303 commit b74f322

4 files changed

Lines changed: 128 additions & 19 deletions

File tree

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Example workflow:
2323
```bash
2424
pnpm prisma-cli auth login
2525
pnpm prisma-cli app deploy --env DATABASE_URL=postgresql://example
26-
pnpm prisma-cli app list-env
26+
pnpm prisma-cli project env list --role preview
2727
```
2828

2929
If you want local project scripts that look like the future command shape, add:
@@ -86,6 +86,7 @@ The CLI groups commands by developer workflow:
8686

8787
- `auth`
8888
- `project`
89+
- `git`
8990
- `branch`
9091
- `app`
9192

@@ -118,6 +119,9 @@ Start here when changing command behavior:
118119
See `CONTRIBUTING.md` for local development and contribution guidance.
119120
See `ARCHITECTURE.md` for the short architecture entrypoint.
120121

122+
The npm package README lives at `packages/cli/README.md` and is copied into the
123+
staged publish artifact.
124+
121125
## Community
122126

123127
Issues and feedback are welcome while the CLI is in public beta. Pull

packages/cli/README.md

Lines changed: 118 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,132 @@
1-
# Prisma CLI Beta
1+
<p align="center">
2+
<img src="https://i.imgur.com/h6UIYTu.png" alt="Prisma" width="360" />
3+
</p>
24

3-
Beta npm package for the unified Prisma CLI.
5+
# Prisma CLI
46

5-
Install:
7+
[![npm version](https://img.shields.io/npm/v/@prisma/cli?label=npm)](https://www.npmjs.com/package/@prisma/cli)
8+
[![license](https://img.shields.io/npm/l/@prisma/cli)](https://github.com/prisma/prisma-cli/blob/main/LICENSE)
9+
[![Node.js](https://img.shields.io/node/v/@prisma/cli)](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:
633

734
```bash
8-
pnpm add -D @prisma/cli
35+
npm install --save-dev @prisma/cli
936
```
1037

11-
Run:
38+
Run the binary exposed by this package:
1239

1340
```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
1550
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
1861
```
1962

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.
2265

23-
Notes:
66+
---
2467

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.
25104
- 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

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@prisma/cli",
33
"version": "3.0.0-development",
4-
"description": "Beta of the unified Prisma CLI.",
4+
"description": "Command-line interface for the Prisma Developer Platform.",
55
"type": "module",
66
"bin": {
77
"prisma-cli": "./dist/cli.js"

packages/cli/tests/publish-prep.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe("prepare cli publish", () => {
2525
name: "@prisma/cli",
2626
private: true,
2727
version: "3.0.0-development",
28-
description: "Beta of the unified Prisma CLI.",
28+
description: "Command-line interface for the Prisma Developer Platform.",
2929
type: "module",
3030
engines: {
3131
node: ">=20",
@@ -60,7 +60,7 @@ describe("prepare cli publish", () => {
6060
expect(manifest).toEqual({
6161
name: "@prisma/cli",
6262
version: "3.0.0-development",
63-
description: "Beta of the unified Prisma CLI.",
63+
description: "Command-line interface for the Prisma Developer Platform.",
6464
type: "module",
6565
bin: {
6666
"prisma-cli": "./dist/cli.js",
@@ -103,7 +103,7 @@ describe("prepare cli publish", () => {
103103
{
104104
name: "@prisma/cli",
105105
version: "3.0.0-development",
106-
description: "Beta of the unified Prisma CLI.",
106+
description: "Command-line interface for the Prisma Developer Platform.",
107107
type: "module",
108108
dependencies: {},
109109
},
@@ -141,7 +141,7 @@ describe("prepare cli publish", () => {
141141
{
142142
name: "@prisma/cli",
143143
version: "3.0.0-development",
144-
description: "Beta of the unified Prisma CLI.",
144+
description: "Command-line interface for the Prisma Developer Platform.",
145145
type: "module",
146146
dependencies: {},
147147
},

0 commit comments

Comments
 (0)