init: when no Prisma package is installed, say what to run next

Đang mở
#347 1 bình luận 1 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
72/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
cli

Hướng nghiên cứu

Start with docs/product/output-conventions.md, which describes the no-packages empty state. Then trace skillsOutcome() in packages/cli/src/commands/init.ts and the human and JSON next-action output; the issue says no tests are named. Done means adding the three proposed actions after npm install for no-packages in both outputs, while leaving the other outcomes unchanged.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement

What happens

In a project with no Prisma package installed, prisma init sets up the skills hook and the config, then ends at the empty state. npx -y prisma@latest init --yes --format human in a directory with only a package.json (8.0.0-rc.22, 2026-10-12):

✔ Added "postinstall": "prisma skills sync || exit 0" to package.json.
✔ Added "prisma": "8.0.0-rc.22" to devDependencies in package.json.
✔ Created prisma.config.ts with skills: { agents: ["claude", "cursor", "agents", "devin"] }.
ℹ No Prisma packages with agent skills are installed.

project:  …/init-nopkg2
check:    enabled

→ Install the added prisma dev dependency: npm install

The JSON result has skills.outcome: "no-packages" and one next action (npm install). skillsOutcome() in packages/cli/src/commands/init.ts returns no-packages, and nothing attaches a next step to it.

npx prisma init is the command people and coding agents type from memory when they start a project. In this state they have a config and a hook, but nothing says how to get the ORM, a database, or hosting. An agent reading this output has no next command to run.

Proposal

When the skills outcome is no-packages, add three next actions after the install step, in both human and JSON output:

  1. run-command, prisma orm init, label: "Set up Prisma ORM in this project"
  2. run-command, npx create-db@latest, label: "No database yet? npx create-db@latest creates a temporary Prisma Postgres database and prints its URL; it is deleted after 24 hours unless you claim it."
  3. user-choice, label: "To host the app: prisma deploy module.ts deploys a Prisma Composer (Early Access) app to Prisma Compute after prisma auth login and a build: https://www.prisma.io/docs/compute/getting-started"

The create-db and deploy strings are the same ones proposed for prisma orm init in prisma/orm#30688, so the two commands agree. The other outcomes (synced, up-to-date, no-agents, no-skills, failed, skipped) stay as they are.

This repo is document-driven, so the first change would be to docs/product/output-conventions.md, which describes the no-packages empty state (No Prisma packages with agent skills are installed.). I can open that docs PR, and then the code and tests, if you agree with the direction.

Not this issue

A project whose package.json pins Prisma 5 or 7 is a separate problem: there, npx prisma init runs the version 8 CLI and writes a postinstall hook the pinned CLI cannot run. This issue is only about a project with no Prisma package.

@wmadden, does this fit how you want init to end?

Ngôn ngữ chính
TypeScript
Star
25
Fork
4
Merge trung bình
18 giờ 22 phút
Pull request đã merge (30 ngày)
34

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của prisma/prisma-cli

Tất cả issue của prisma/prisma-cli

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.