@prisma/cli 8.0.0-rc.1 → 8.0.0-rc.10-dev.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/README.md +25 -29
  2. package/dist/cli.js +14551 -16
  3. package/dist/{v8/sender.js → sender.js} +1 -1
  4. package/package.json +17 -18
  5. package/dist/adapters/git.js +0 -54
  6. package/dist/adapters/local-state.js +0 -155
  7. package/dist/auth/client.js +0 -30
  8. package/dist/auth/errors.js +0 -50
  9. package/dist/auth/guard.js +0 -39
  10. package/dist/auth/login.js +0 -471
  11. package/dist/auth/operations.js +0 -208
  12. package/dist/auth/recipient.js +0 -42
  13. package/dist/auth/token-storage.js +0 -439
  14. package/dist/auth/workspaces.js +0 -171
  15. package/dist/cli-command.js +0 -14
  16. package/dist/cli-name.js +0 -12
  17. package/dist/cli2.js +0 -136
  18. package/dist/command-arguments.js +0 -12
  19. package/dist/commands/agent/index.js +0 -60
  20. package/dist/commands/app/index.js +0 -350
  21. package/dist/commands/auth/index.js +0 -95
  22. package/dist/commands/branch/index.js +0 -27
  23. package/dist/commands/bucket/index.js +0 -123
  24. package/dist/commands/build/index.js +0 -29
  25. package/dist/commands/database/index.js +0 -249
  26. package/dist/commands/env.js +0 -99
  27. package/dist/commands/feedback/index.js +0 -20
  28. package/dist/commands/git/index.js +0 -36
  29. package/dist/commands/init/index.js +0 -33
  30. package/dist/commands/project/index.js +0 -118
  31. package/dist/commands/version/index.js +0 -18
  32. package/dist/controllers/agent-setup.js +0 -52
  33. package/dist/controllers/agent.js +0 -228
  34. package/dist/controllers/app-env-api.js +0 -55
  35. package/dist/controllers/app-env-file.js +0 -181
  36. package/dist/controllers/app-env.js +0 -502
  37. package/dist/controllers/app.js +0 -2508
  38. package/dist/controllers/auth.js +0 -124
  39. package/dist/controllers/branch.js +0 -92
  40. package/dist/controllers/bucket.js +0 -184
  41. package/dist/controllers/build.js +0 -88
  42. package/dist/controllers/database.js +0 -463
  43. package/dist/controllers/feedback.js +0 -90
  44. package/dist/controllers/init.js +0 -814
  45. package/dist/controllers/project.js +0 -892
  46. package/dist/controllers/select-prompt-port.js +0 -13
  47. package/dist/controllers/version.js +0 -12
  48. package/dist/errors.js +0 -102
  49. package/dist/lib/agent/cli-command.js +0 -20
  50. package/dist/lib/agent/constants.js +0 -12
  51. package/dist/lib/agent/package-manager.js +0 -99
  52. package/dist/lib/agent/setup-status.js +0 -83
  53. package/dist/lib/app/app-provider.js +0 -617
  54. package/dist/lib/app/branch-database-api.js +0 -102
  55. package/dist/lib/app/branch-database-deploy.js +0 -353
  56. package/dist/lib/app/branch-database.js +0 -234
  57. package/dist/lib/app/build-settings.js +0 -98
  58. package/dist/lib/app/build.js +0 -82
  59. package/dist/lib/app/bun-project.js +0 -45
  60. package/dist/lib/app/compute-config.js +0 -145
  61. package/dist/lib/app/deploy-output.js +0 -24
  62. package/dist/lib/app/deploy-plan.js +0 -59
  63. package/dist/lib/app/deploy-progress.js +0 -100
  64. package/dist/lib/app/domain-guidance.js +0 -14
  65. package/dist/lib/app/env-config.js +0 -67
  66. package/dist/lib/app/env-file.js +0 -82
  67. package/dist/lib/app/env-vars.js +0 -50
  68. package/dist/lib/app/local-dev.js +0 -109
  69. package/dist/lib/app/production-deploy-gate.js +0 -162
  70. package/dist/lib/app/read-branch.js +0 -30
  71. package/dist/lib/bucket/provider.js +0 -139
  72. package/dist/lib/database/provider.js +0 -385
  73. package/dist/lib/diagnostics.js +0 -16
  74. package/dist/lib/feedback.js +0 -15
  75. package/dist/lib/fs/home-path.js +0 -24
  76. package/dist/lib/git/local-branch.js +0 -53
  77. package/dist/lib/git/local-status.js +0 -57
  78. package/dist/lib/project/interactive-setup.js +0 -57
  79. package/dist/lib/project/local-pin.js +0 -200
  80. package/dist/lib/project/provider.js +0 -93
  81. package/dist/lib/project/resolution.js +0 -389
  82. package/dist/lib/project/setup.js +0 -138
  83. package/dist/lib/version.js +0 -56
  84. package/dist/lib/workspace-id.js +0 -18
  85. package/dist/output/patterns.js +0 -90
  86. package/dist/presenters/agent.js +0 -74
  87. package/dist/presenters/app-env.js +0 -265
  88. package/dist/presenters/app.js +0 -672
  89. package/dist/presenters/auth.js +0 -184
  90. package/dist/presenters/branch.js +0 -46
  91. package/dist/presenters/bucket.js +0 -174
  92. package/dist/presenters/database.js +0 -462
  93. package/dist/presenters/feedback.js +0 -26
  94. package/dist/presenters/init.js +0 -30
  95. package/dist/presenters/project.js +0 -268
  96. package/dist/presenters/verbose-context.js +0 -64
  97. package/dist/presenters/version.js +0 -29
  98. package/dist/shell/cli-command.js +0 -2
  99. package/dist/shell/command-meta.js +0 -923
  100. package/dist/shell/command-runner.js +0 -119
  101. package/dist/shell/diagnostics-output.js +0 -57
  102. package/dist/shell/global-flags.js +0 -37
  103. package/dist/shell/help.js +0 -90
  104. package/dist/shell/output.js +0 -144
  105. package/dist/shell/prompt.js +0 -48
  106. package/dist/shell/runtime.js +0 -38
  107. package/dist/shell/ui.js +0 -116
  108. package/dist/state-dir.js +0 -12
  109. package/dist/update-check.js +0 -248
  110. package/dist/v8/cli.js +0 -14699
@@ -1,923 +0,0 @@
1
- import { resolvePrismaCliPackageCommandFormatterSync } from "../lib/agent/cli-command.js";
2
- import { PRISMA_AGENT_INSTALL_ARGS, PRISMA_AGENT_STATUS_ARGS, PRISMA_AGENT_UPDATE_ARGS, PRISMA_COMPUTE_AGENT_SKILL } from "../lib/agent/constants.js";
3
- //#region src/shell/command-meta.ts
4
- const COMMAND_DESCRIPTOR_ID = Symbol("prisma.commandDescriptorId");
5
- function agentCommandExamples(runtime, commands) {
6
- const formatCommand = resolvePrismaCliPackageCommandFormatterSync(runtime.cwd);
7
- return commands.map((command) => formatCommand(command));
8
- }
9
- const DESCRIPTORS = [
10
- {
11
- id: "root",
12
- path: ["prisma"],
13
- description: "The Prisma Developer Platform, from your terminal",
14
- examples: ["prisma-cli auth login", "prisma-cli app deploy"],
15
- longDescription: "Deploy your app with isolated infrastructure for every branch"
16
- },
17
- {
18
- id: "version",
19
- path: ["prisma", "version"],
20
- description: "Show CLI build and environment",
21
- examples: ["prisma-cli version", "prisma-cli version --json"]
22
- },
23
- {
24
- id: "feedback",
25
- path: ["prisma", "feedback"],
26
- description: "Send feedback to the Prisma CLI team",
27
- longDescription: "Anonymous unless --email is passed. Every submission includes the CLI version, node version, and OS platform/arch, and nothing else.",
28
- examples: ["prisma-cli feedback \"the deploy flow is great\"", "prisma-cli feedback \"please add X\" --email you@example.com"]
29
- },
30
- {
31
- id: "init",
32
- path: ["prisma", "init"],
33
- description: "Write a committed compute config for this app",
34
- examples: (runtime) => agentCommandExamples(runtime, [
35
- ["init"],
36
- [
37
- "init",
38
- "--framework",
39
- "hono",
40
- "--entry",
41
- "src/index.ts"
42
- ],
43
- [
44
- "init",
45
- "--format",
46
- "json"
47
- ],
48
- ["init", "--no-link"]
49
- ])
50
- },
51
- {
52
- id: "agent",
53
- path: ["prisma", "agent"],
54
- description: "Install Prisma context for AI coding agents",
55
- examples: (runtime) => agentCommandExamples(runtime, [
56
- PRISMA_AGENT_INSTALL_ARGS,
57
- PRISMA_AGENT_UPDATE_ARGS,
58
- PRISMA_AGENT_STATUS_ARGS
59
- ])
60
- },
61
- {
62
- id: "agent.install",
63
- path: [
64
- "prisma",
65
- "agent",
66
- "install"
67
- ],
68
- description: "Install Prisma skills for AI coding agents",
69
- examples: (runtime) => agentCommandExamples(runtime, [
70
- PRISMA_AGENT_INSTALL_ARGS,
71
- [
72
- ...PRISMA_AGENT_INSTALL_ARGS,
73
- "--agent",
74
- "codex"
75
- ],
76
- [...PRISMA_AGENT_INSTALL_ARGS, "--all-agents"],
77
- [
78
- ...PRISMA_AGENT_INSTALL_ARGS,
79
- "--skill",
80
- PRISMA_COMPUTE_AGENT_SKILL
81
- ]
82
- ])
83
- },
84
- {
85
- id: "agent.update",
86
- path: [
87
- "prisma",
88
- "agent",
89
- "update"
90
- ],
91
- description: "Refresh Prisma skills for AI coding agents",
92
- examples: (runtime) => agentCommandExamples(runtime, [
93
- PRISMA_AGENT_UPDATE_ARGS,
94
- [
95
- ...PRISMA_AGENT_UPDATE_ARGS,
96
- "--agent",
97
- "codex"
98
- ],
99
- [...PRISMA_AGENT_UPDATE_ARGS, "--all-agents"]
100
- ])
101
- },
102
- {
103
- id: "agent.status",
104
- path: [
105
- "prisma",
106
- "agent",
107
- "status"
108
- ],
109
- description: "Show installed Prisma skills",
110
- examples: (runtime) => agentCommandExamples(runtime, [
111
- PRISMA_AGENT_STATUS_ARGS,
112
- [...PRISMA_AGENT_STATUS_ARGS, "--json"],
113
- [...PRISMA_AGENT_STATUS_ARGS, "--global"]
114
- ])
115
- },
116
- {
117
- id: "auth",
118
- path: ["prisma", "auth"],
119
- description: "Manage local authentication for the CLI",
120
- examples: ["prisma-cli auth login", "prisma-cli auth whoami"]
121
- },
122
- {
123
- id: "auth.login",
124
- path: [
125
- "prisma",
126
- "auth",
127
- "login"
128
- ],
129
- description: "Log in to your Prisma platform account",
130
- examples: ["prisma-cli auth login"]
131
- },
132
- {
133
- id: "auth.logout",
134
- path: [
135
- "prisma",
136
- "auth",
137
- "logout"
138
- ],
139
- description: "Clear stored authentication credentials",
140
- examples: ["prisma-cli auth logout"]
141
- },
142
- {
143
- id: "auth.whoami",
144
- path: [
145
- "prisma",
146
- "auth",
147
- "whoami"
148
- ],
149
- description: "Show the authenticated user and accessible workspace",
150
- examples: ["prisma-cli auth whoami", "prisma-cli auth whoami --json"]
151
- },
152
- {
153
- id: "auth.workspace",
154
- path: [
155
- "prisma",
156
- "auth",
157
- "workspace"
158
- ],
159
- description: "Manage local authenticated workspaces",
160
- examples: [
161
- "prisma-cli auth workspace list",
162
- "prisma-cli auth workspace use",
163
- "prisma-cli auth workspace use wksp_123",
164
- "prisma-cli auth workspace logout wksp_123"
165
- ]
166
- },
167
- {
168
- id: "auth.workspace.list",
169
- path: [
170
- "prisma",
171
- "auth",
172
- "workspace",
173
- "list"
174
- ],
175
- description: "List locally authenticated workspaces",
176
- examples: ["prisma-cli auth workspace list", "prisma-cli auth workspace list --json"]
177
- },
178
- {
179
- id: "auth.workspace.use",
180
- path: [
181
- "prisma",
182
- "auth",
183
- "workspace",
184
- "use"
185
- ],
186
- description: "Switch the local CLI workspace",
187
- examples: [
188
- "prisma-cli auth workspace use",
189
- "prisma-cli auth workspace use wksp_123",
190
- "prisma-cli auth workspace use \"Acme Inc\""
191
- ]
192
- },
193
- {
194
- id: "auth.workspace.logout",
195
- path: [
196
- "prisma",
197
- "auth",
198
- "workspace",
199
- "logout"
200
- ],
201
- description: "Remove one local OAuth workspace session",
202
- examples: ["prisma-cli auth workspace logout wksp_123", "prisma-cli auth workspace logout \"Acme Inc\""]
203
- },
204
- {
205
- id: "project",
206
- path: ["prisma", "project"],
207
- description: "Manage and inspect your Prisma projects",
208
- examples: [
209
- "prisma-cli project list",
210
- "prisma-cli project link proj_123",
211
- "prisma-cli project create my-app"
212
- ]
213
- },
214
- {
215
- id: "app",
216
- path: ["prisma", "app"],
217
- description: "Manage apps and deployments for a project",
218
- examples: ["prisma-cli app deploy", "prisma-cli app deploy --app my-app --framework nextjs --http-port 3000"]
219
- },
220
- {
221
- id: "branch",
222
- path: ["prisma", "branch"],
223
- description: "View your Platform branches",
224
- examples: ["prisma-cli branch list"]
225
- },
226
- {
227
- id: "build",
228
- path: ["prisma", "build"],
229
- description: "Inspect builds",
230
- examples: ["prisma-cli build logs <build_id>"]
231
- },
232
- {
233
- id: "build.logs",
234
- path: [
235
- "prisma",
236
- "build",
237
- "logs"
238
- ],
239
- description: "Stream the logs for a build",
240
- examples: ["prisma-cli build logs <build_id>", "prisma-cli build logs <build_id> --follow"]
241
- },
242
- {
243
- id: "database",
244
- path: ["prisma", "database"],
245
- description: "Manage Prisma Postgres databases for a project",
246
- examples: [
247
- "prisma-cli database list",
248
- "prisma-cli database create my-db",
249
- "prisma-cli database connection create db_123"
250
- ]
251
- },
252
- {
253
- id: "bucket",
254
- path: ["prisma", "bucket"],
255
- description: "Manage object-store buckets for a project",
256
- examples: [
257
- "prisma-cli bucket list",
258
- "prisma-cli bucket create",
259
- "prisma-cli bucket key create bkt_123"
260
- ]
261
- },
262
- {
263
- id: "bucket.list",
264
- path: [
265
- "prisma",
266
- "bucket",
267
- "list"
268
- ],
269
- description: "List object-store buckets for the resolved project",
270
- examples: [
271
- "prisma-cli bucket list",
272
- "prisma-cli bucket list --branch preview",
273
- "prisma-cli bucket list --json"
274
- ]
275
- },
276
- {
277
- id: "bucket.create",
278
- path: [
279
- "prisma",
280
- "bucket",
281
- "create"
282
- ],
283
- description: "Create an object-store bucket",
284
- examples: [
285
- "prisma-cli bucket create",
286
- "prisma-cli bucket create --name my-store",
287
- "prisma-cli bucket create --branch preview --json"
288
- ]
289
- },
290
- {
291
- id: "bucket.delete",
292
- path: [
293
- "prisma",
294
- "bucket",
295
- "delete"
296
- ],
297
- description: "Delete a bucket and all its access keys",
298
- examples: ["prisma-cli bucket delete bkt_123"]
299
- },
300
- {
301
- id: "bucket.key",
302
- path: [
303
- "prisma",
304
- "bucket",
305
- "key"
306
- ],
307
- description: "Manage access keys for an object-store bucket",
308
- examples: [
309
- "prisma-cli bucket key list bkt_123",
310
- "prisma-cli bucket key create bkt_123",
311
- "prisma-cli bucket key delete bkt_123 bkey_456"
312
- ]
313
- },
314
- {
315
- id: "bucket.key.list",
316
- path: [
317
- "prisma",
318
- "bucket",
319
- "key",
320
- "list"
321
- ],
322
- description: "List access keys for a bucket",
323
- examples: ["prisma-cli bucket key list bkt_123", "prisma-cli bucket key list bkt_123 --json"]
324
- },
325
- {
326
- id: "bucket.key.create",
327
- path: [
328
- "prisma",
329
- "bucket",
330
- "key",
331
- "create"
332
- ],
333
- description: "Create a bucket access key and print its one-time credentials",
334
- examples: [
335
- "prisma-cli bucket key create bkt_123",
336
- "prisma-cli bucket key create bkt_123 --role read",
337
- "prisma-cli bucket key create bkt_123 --name ci-key --role read_write"
338
- ]
339
- },
340
- {
341
- id: "bucket.key.delete",
342
- path: [
343
- "prisma",
344
- "bucket",
345
- "key",
346
- "delete"
347
- ],
348
- description: "Revoke and delete a bucket access key",
349
- examples: ["prisma-cli bucket key delete bkt_123 bkey_456"]
350
- },
351
- {
352
- id: "git",
353
- path: ["prisma", "git"],
354
- description: "Manage Git repository connections for a project",
355
- examples: ["prisma-cli git connect", "prisma-cli git disconnect"]
356
- },
357
- {
358
- id: "project.list",
359
- path: [
360
- "prisma",
361
- "project",
362
- "list"
363
- ],
364
- description: "List all projects in your workspace",
365
- examples: ["prisma-cli project list", "prisma-cli project list --json"]
366
- },
367
- {
368
- id: "project.show",
369
- path: [
370
- "prisma",
371
- "project",
372
- "show"
373
- ],
374
- description: "Show this directory's Project binding",
375
- examples: ["prisma-cli project show", "prisma-cli project show --project proj_123 --json"]
376
- },
377
- {
378
- id: "project.create",
379
- path: [
380
- "prisma",
381
- "project",
382
- "create"
383
- ],
384
- description: "Create a Project and link this directory",
385
- examples: ["prisma-cli project create my-app", "prisma-cli project create my-app --json"]
386
- },
387
- {
388
- id: "project.link",
389
- path: [
390
- "prisma",
391
- "project",
392
- "link"
393
- ],
394
- description: "Link this directory to a Project",
395
- examples: [
396
- "prisma-cli project link",
397
- "prisma-cli project link proj_123",
398
- "prisma-cli project link \"Acme Dashboard\" --json"
399
- ]
400
- },
401
- {
402
- id: "project.rename",
403
- path: [
404
- "prisma",
405
- "project",
406
- "rename"
407
- ],
408
- description: "Rename the resolved Project",
409
- examples: ["prisma-cli project rename \"Acme Dashboard v2\"", "prisma-cli project rename billing-api --project proj_123"]
410
- },
411
- {
412
- id: "project.remove",
413
- path: [
414
- "prisma",
415
- "project",
416
- "remove"
417
- ],
418
- description: "Remove a Project permanently after exact id confirmation",
419
- examples: ["prisma-cli project remove proj_123 --confirm proj_123"]
420
- },
421
- {
422
- id: "project.transfer",
423
- path: [
424
- "prisma",
425
- "project",
426
- "transfer"
427
- ],
428
- description: "Transfer a Project to another workspace after exact id confirmation",
429
- examples: ["prisma-cli project transfer proj_123 --to-workspace \"Prisma Labs\" --confirm proj_123", "prisma-cli project transfer proj_123 --recipient-token <token> --confirm proj_123"]
430
- },
431
- {
432
- id: "git.connect",
433
- path: [
434
- "prisma",
435
- "git",
436
- "connect"
437
- ],
438
- description: "Connect the resolved project to a GitHub repository",
439
- examples: [
440
- "prisma-cli git connect",
441
- "prisma-cli git connect git@github.com:prisma/prisma-cli.git",
442
- "prisma-cli git connect --project proj_123"
443
- ]
444
- },
445
- {
446
- id: "git.disconnect",
447
- path: [
448
- "prisma",
449
- "git",
450
- "disconnect"
451
- ],
452
- description: "Disconnect the GitHub repository from the resolved project",
453
- examples: ["prisma-cli git disconnect", "prisma-cli git disconnect --project proj_123"]
454
- },
455
- {
456
- id: "branch.list",
457
- path: [
458
- "prisma",
459
- "branch",
460
- "list"
461
- ],
462
- description: "List Platform branches for the resolved project",
463
- examples: ["prisma-cli branch list", "prisma-cli branch list --json"]
464
- },
465
- {
466
- id: "database.list",
467
- path: [
468
- "prisma",
469
- "database",
470
- "list"
471
- ],
472
- description: "List Prisma Postgres databases for the resolved project",
473
- examples: [
474
- "prisma-cli database list",
475
- "prisma-cli database list --branch feature/foo",
476
- "prisma-cli database list --json"
477
- ]
478
- },
479
- {
480
- id: "database.show",
481
- path: [
482
- "prisma",
483
- "database",
484
- "show"
485
- ],
486
- description: "Show database metadata without secret values",
487
- examples: ["prisma-cli database show db_123", "prisma-cli database show acme-preview --branch preview --json"]
488
- },
489
- {
490
- id: "database.create",
491
- path: [
492
- "prisma",
493
- "database",
494
- "create"
495
- ],
496
- description: "Create a Prisma Postgres database and print its one-time connection URL",
497
- examples: ["prisma-cli database create my-db", "prisma-cli database create my-db --branch feature/foo --region eu-central-1"]
498
- },
499
- {
500
- id: "database.usage",
501
- path: [
502
- "prisma",
503
- "database",
504
- "usage"
505
- ],
506
- description: "Show usage metrics for a database",
507
- examples: ["prisma-cli database usage db_123", "prisma-cli database usage acme-production --from 2026-06-01 --to 2026-06-30"]
508
- },
509
- {
510
- id: "database.restore",
511
- path: [
512
- "prisma",
513
- "database",
514
- "restore"
515
- ],
516
- description: "Restore a database from a backup after exact id confirmation",
517
- examples: ["prisma-cli database restore db_123 --backup bkp_456 --confirm db_123"]
518
- },
519
- {
520
- id: "database.remove",
521
- path: [
522
- "prisma",
523
- "database",
524
- "remove"
525
- ],
526
- description: "Remove a database after exact id confirmation",
527
- examples: ["prisma-cli database remove db_123 --confirm db_123"]
528
- },
529
- {
530
- id: "database.backup",
531
- path: [
532
- "prisma",
533
- "database",
534
- "backup"
535
- ],
536
- description: "Inspect platform-created database backups",
537
- examples: ["prisma-cli database backup list db_123"]
538
- },
539
- {
540
- id: "database.backup.list",
541
- path: [
542
- "prisma",
543
- "database",
544
- "backup",
545
- "list"
546
- ],
547
- description: "List backups for a database",
548
- examples: ["prisma-cli database backup list db_123", "prisma-cli database backup list acme-production --limit 50"]
549
- },
550
- {
551
- id: "database.connection",
552
- path: [
553
- "prisma",
554
- "database",
555
- "connection"
556
- ],
557
- description: "Manage one-time-view database connection strings",
558
- examples: [
559
- "prisma-cli database connection list db_123",
560
- "prisma-cli database connection create db_123",
561
- "prisma-cli database connection remove conn_123 --confirm conn_123"
562
- ]
563
- },
564
- {
565
- id: "database.connection.list",
566
- path: [
567
- "prisma",
568
- "database",
569
- "connection",
570
- "list"
571
- ],
572
- description: "List database connection metadata without secret values",
573
- examples: ["prisma-cli database connection list db_123", "prisma-cli database connection list acme-preview --branch preview --json"]
574
- },
575
- {
576
- id: "database.connection.create",
577
- path: [
578
- "prisma",
579
- "database",
580
- "connection",
581
- "create"
582
- ],
583
- description: "Create a database connection and print its one-time connection URL",
584
- examples: ["prisma-cli database connection create db_123", "prisma-cli database connection create db_123 --name readonly"]
585
- },
586
- {
587
- id: "database.connection.rotate",
588
- path: [
589
- "prisma",
590
- "database",
591
- "connection",
592
- "rotate"
593
- ],
594
- description: "Rotate connection credentials and print the new one-time connection URL",
595
- examples: ["prisma-cli database connection rotate conn_123 --confirm conn_123"]
596
- },
597
- {
598
- id: "database.connection.remove",
599
- path: [
600
- "prisma",
601
- "database",
602
- "connection",
603
- "remove"
604
- ],
605
- description: "Remove a database connection after exact id confirmation",
606
- examples: ["prisma-cli database connection remove conn_123 --confirm conn_123"]
607
- },
608
- {
609
- id: "app.build",
610
- path: [
611
- "prisma",
612
- "app",
613
- "build"
614
- ],
615
- description: "Build the app locally into a deployable artifact",
616
- examples: [
617
- "prisma-cli app build --build-type nextjs",
618
- "prisma-cli app build --build-type nuxt",
619
- "prisma-cli app build --build-type bun --entry server.ts"
620
- ]
621
- },
622
- {
623
- id: "app.run",
624
- path: [
625
- "prisma",
626
- "app",
627
- "run"
628
- ],
629
- description: "Run your app locally",
630
- examples: ["prisma-cli app run --build-type nextjs", "prisma-cli app run --build-type bun --entry server.ts --port 3000"]
631
- },
632
- {
633
- id: "app.deploy",
634
- path: [
635
- "prisma",
636
- "app",
637
- "deploy"
638
- ],
639
- description: "Creates a new deployment for the app",
640
- examples: [
641
- "prisma-cli app deploy",
642
- "prisma-cli app deploy --project proj_123",
643
- "prisma-cli app deploy --create-project my-app --yes",
644
- "prisma-cli app deploy --app my-app --env DATABASE_URL=postgresql://example",
645
- "prisma-cli app deploy --env .env",
646
- "prisma-cli app deploy --db",
647
- "prisma-cli app deploy --db --yes",
648
- "prisma-cli app deploy --app my-app --framework nextjs --http-port 3000",
649
- "prisma-cli app deploy --app my-app --region us-west-1",
650
- "prisma-cli app deploy --branch feat-login --framework hono",
651
- "prisma-cli app deploy --prod --yes",
652
- "prisma-cli app deploy --framework bun --entry src/server.ts"
653
- ]
654
- },
655
- {
656
- id: "app.show",
657
- path: [
658
- "prisma",
659
- "app",
660
- "show"
661
- ],
662
- description: "Show the app and its current deployment",
663
- examples: ["prisma-cli app show", "prisma-cli app show --app hello-world"]
664
- },
665
- {
666
- id: "app.open",
667
- path: [
668
- "prisma",
669
- "app",
670
- "open"
671
- ],
672
- description: "Open the app's live URL",
673
- examples: ["prisma-cli app open", "prisma-cli app open --app hello-world"]
674
- },
675
- {
676
- id: "app.domain",
677
- path: [
678
- "prisma",
679
- "app",
680
- "domain"
681
- ],
682
- description: "Manage custom domains for an app",
683
- examples: [
684
- "prisma-cli app domain add shop.acme.com",
685
- "prisma-cli app domain wait shop.acme.com --timeout 15m",
686
- "prisma-cli app domain retry shop.acme.com"
687
- ]
688
- },
689
- {
690
- id: "app.domain.add",
691
- path: [
692
- "prisma",
693
- "app",
694
- "domain",
695
- "add"
696
- ],
697
- description: "Register a custom domain on the app's production branch",
698
- examples: ["prisma-cli app domain add shop.acme.com"]
699
- },
700
- {
701
- id: "app.domain.show",
702
- path: [
703
- "prisma",
704
- "app",
705
- "domain",
706
- "show"
707
- ],
708
- description: "Show custom domain status and certificate details",
709
- examples: ["prisma-cli app domain show shop.acme.com"]
710
- },
711
- {
712
- id: "app.domain.remove",
713
- path: [
714
- "prisma",
715
- "app",
716
- "domain",
717
- "remove"
718
- ],
719
- description: "Detach a custom domain from the app",
720
- examples: ["prisma-cli app domain remove shop.acme.com --yes"]
721
- },
722
- {
723
- id: "app.domain.retry",
724
- path: [
725
- "prisma",
726
- "app",
727
- "domain",
728
- "retry"
729
- ],
730
- description: "Retry custom domain DNS verification and TLS provisioning",
731
- examples: ["prisma-cli app domain retry shop.acme.com"]
732
- },
733
- {
734
- id: "app.domain.wait",
735
- path: [
736
- "prisma",
737
- "app",
738
- "domain",
739
- "wait"
740
- ],
741
- description: "Wait until a custom domain is active or failed",
742
- examples: ["prisma-cli app domain wait shop.acme.com", "prisma-cli app domain wait shop.acme.com --timeout 0 --json"]
743
- },
744
- {
745
- id: "app.logs",
746
- path: [
747
- "prisma",
748
- "app",
749
- "logs"
750
- ],
751
- description: "Stream logs for the app's current deployment",
752
- examples: ["prisma-cli app logs", "prisma-cli app logs --deployment dep_123"]
753
- },
754
- {
755
- id: "app.list-deploys",
756
- path: [
757
- "prisma",
758
- "app",
759
- "list-deploys"
760
- ],
761
- description: "List deployments for the app",
762
- examples: ["prisma-cli app list-deploys", "prisma-cli app list-deploys --app hello-world"]
763
- },
764
- {
765
- id: "app.show-deploy",
766
- path: [
767
- "prisma",
768
- "app",
769
- "show-deploy"
770
- ],
771
- description: "Show a deployment in detail",
772
- examples: ["prisma-cli app show-deploy dep_123"]
773
- },
774
- {
775
- id: "app.promote",
776
- path: [
777
- "prisma",
778
- "app",
779
- "promote"
780
- ],
781
- description: "Promote a deployment to production by rebuilding with production env vars",
782
- examples: ["prisma-cli app promote dep_123", "prisma-cli app promote dep_123 --app hello-world"]
783
- },
784
- {
785
- id: "app.rollback",
786
- path: [
787
- "prisma",
788
- "app",
789
- "rollback"
790
- ],
791
- description: "Roll back production to a previous deployment",
792
- examples: ["prisma-cli app rollback", "prisma-cli app rollback --app hello-world --to dep_123"]
793
- },
794
- {
795
- id: "app.remove",
796
- path: [
797
- "prisma",
798
- "app",
799
- "remove"
800
- ],
801
- description: "Remove the app from the resolved branch",
802
- examples: [
803
- "prisma-cli app remove --app hello-world",
804
- "prisma-cli app remove --app hello-world --yes",
805
- "prisma-cli app remove --app hello-world --branch feature/foo --yes"
806
- ]
807
- },
808
- {
809
- id: "project.env",
810
- path: [
811
- "prisma",
812
- "project",
813
- "env"
814
- ],
815
- description: "Manage environment variables for the active project",
816
- examples: [
817
- "prisma-cli project env list",
818
- "prisma-cli project env add STRIPE_KEY=sk_test_xxx --role production",
819
- "prisma-cli project env add --file .env --role preview",
820
- "prisma-cli project env add DATABASE_URL=postgresql://branch --branch feature/foo",
821
- "prisma-cli project env remove STRIPE_KEY --role preview"
822
- ]
823
- },
824
- {
825
- id: "project.env.add",
826
- path: [
827
- "prisma",
828
- "project",
829
- "env",
830
- "add"
831
- ],
832
- description: "Create a new environment variable.",
833
- examples: [
834
- "prisma-cli project env add STRIPE_KEY=sk_test_xxx --role production",
835
- "prisma-cli project env add STRIPE_KEY=sk_test_xxx --role preview",
836
- "prisma-cli project env add --file .env --role preview",
837
- "prisma-cli project env add DATABASE_URL=postgresql://branch --branch feature/foo",
838
- "prisma-cli project env add --file .env.local --branch feature/foo",
839
- "API_URL=https://api.example prisma-cli project env add API_URL --project proj_123 --role preview"
840
- ]
841
- },
842
- {
843
- id: "project.env.update",
844
- path: [
845
- "prisma",
846
- "project",
847
- "env",
848
- "update"
849
- ],
850
- description: "Replace an existing environment variable's value.",
851
- examples: [
852
- "prisma-cli project env update STRIPE_KEY=sk_new_xxx --role production",
853
- "prisma-cli project env update STRIPE_KEY=sk_new_xxx --role preview",
854
- "prisma-cli project env update --file .env --role production",
855
- "prisma-cli project env update DATABASE_URL=postgresql://branch --branch feature/foo"
856
- ]
857
- },
858
- {
859
- id: "project.env.list",
860
- path: [
861
- "prisma",
862
- "project",
863
- "env",
864
- "list"
865
- ],
866
- description: "List environment variable metadata for a scope (no values).",
867
- examples: [
868
- "prisma-cli project env list",
869
- "prisma-cli project env list --role production",
870
- "prisma-cli project env list --role preview",
871
- "prisma-cli project env list --branch feature/foo"
872
- ]
873
- },
874
- {
875
- id: "project.env.remove",
876
- path: [
877
- "prisma",
878
- "project",
879
- "env",
880
- "remove"
881
- ],
882
- description: "Remove an environment variable from a scope.",
883
- examples: [
884
- "prisma-cli project env remove STRIPE_KEY --role production",
885
- "prisma-cli project env remove STRIPE_KEY --role preview",
886
- "prisma-cli project env remove DATABASE_URL --branch feature/foo"
887
- ]
888
- }
889
- ];
890
- const DESCRIPTORS_BY_ID = new Map(DESCRIPTORS.map((descriptor) => [descriptor.id, descriptor]));
891
- function attachCommandDescriptor(command, descriptorId) {
892
- const descriptor = getCommandDescriptor(descriptorId);
893
- command[COMMAND_DESCRIPTOR_ID] = descriptor.id;
894
- command.description(descriptor.description);
895
- return command;
896
- }
897
- function getCommandDescriptor(id) {
898
- const descriptor = DESCRIPTORS_BY_ID.get(id);
899
- if (!descriptor) throw new Error(`Unknown command descriptor "${id}".`);
900
- return descriptor;
901
- }
902
- function getDescriptorForCommand(command) {
903
- const descriptorId = command[COMMAND_DESCRIPTOR_ID];
904
- if (descriptorId) return getCommandDescriptor(descriptorId);
905
- const path = getCommandPath(command);
906
- const descriptor = DESCRIPTORS.find((candidate) => candidate.path.join(" ") === path.join(" "));
907
- if (!descriptor) throw new Error(`No command descriptor registered for "${path.join(" ")}".`);
908
- return descriptor;
909
- }
910
- function getCommandPath(command) {
911
- const names = [];
912
- let current = command;
913
- while (current) {
914
- if (current.name()) names.unshift(current.name());
915
- current = current.parent ?? null;
916
- }
917
- return names;
918
- }
919
- function formatDescriptorLabel(descriptor) {
920
- return descriptor.path.length === 1 ? descriptor.path[0] : descriptor.path.slice(1).join(" ");
921
- }
922
- //#endregion
923
- export { attachCommandDescriptor, formatDescriptorLabel, getCommandDescriptor, getDescriptorForCommand };