You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(cli): offer the Prisma Compute skill install during init (#118)
## Summary
`init` now offers to install the `prisma-compute` skill the same way
`app deploy` does, so interactive setups get agent skills without a
separate `agent install` step.
- Extracted deploy's `maybePromptForAgentSetup` into a shared
`controllers/agent-setup.ts` (pure move, single implementation; deploy
behavior unchanged).
- `init` runs the prompt after the link step, in both the fresh path and
the `--format ts` conversion path (acting on the config directory,
matching the other conversion side-effect steps).
- The prompt and its dismissal state are shared between init and deploy:
whichever runs interactively first asks, declining records the
dismissal, and neither asks twice.
- Never prompts in `--json`, `--quiet`, CI, non-interactive, or `--yes`
runs; a failed install downgrades to a warning with the retry command
and the config write stands.
- Spec: documented the init agent skill step and cross-referenced the
shared prompt from the deploy section.
## Testing
- New `tests/init-agent-setup.test.ts` covering accept (install invoked
with `--skill prisma-compute` from the config dir), decline (dismissal
recorded, init succeeds), already-installed (no prompt), install failure
(warning + retry hint, exit 0), and non-interactive (no prompt).
- Full CLI suite: 629 tests / 46 files pass; `tsc --noEmit` clean.
Copy file name to clipboardExpand all lines: docs/product/command-spec.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -393,7 +393,7 @@ Purpose:
393
393
Behavior:
394
394
395
395
- init is the config formalizer: `app deploy` works with zero config, and init writes down what deploy would infer so the setup is committed, reviewable, and stable for teammates and CI
396
-
- writing the config requires no auth and no network; linking is the only remote step
396
+
- writing the config requires no auth and no network; the only steps that may go remote are the accepted types install, link, and agent skill install, all optional and all after the config is written
397
397
- fails with `INIT_CONFIG_EXISTS` when a compute config already exists in the invocation directory or any ancestor up to the repository or workspace root; the error names the existing file, and init never overwrites or merges — editing a committed config is the user's editor's job
398
398
-`--format <ts|json>` selects the config serialization; `ts` (alias `typescript`) is the default and writes `prisma.compute.ts`, `json` writes `prisma.compute.json` via the shared SDK serializer, a dependency-free static document (a `$schema` reference will be emitted once the schema is hosted; the loader already accepts and strips one); both formats pin exactly the same resolved values, and the CLI's global `--json` output flag is unrelated to the config format
399
399
- with `--format json`, the types install step never runs: the JSON format exists to be dependency-free, so `--install` is a usage error; without `--install`, the result reports the step as skipped with no install hint
@@ -418,6 +418,7 @@ Behavior:
418
418
- interactive mode asks `Link this directory to a Prisma Project now? (Y/n)` when the directory has no project binding; accepting enters the same picker `project link` uses
419
419
-`--no-link` suppresses the question; `--link` requires the step; `--project <id-or-name>` links to that project without prompting
420
420
- link failures and cancellations after the config is written downgrade to warnings and `nextSteps`; the config write stands and init exits 0
421
+
- agent skill step, after the link step: interactive runs prompt once to install the Prisma Compute skill for the project when `prisma-compute` is missing, the same shared prompt `app deploy` uses; accepting installs `prisma-compute` from `prisma/skills` from the config directory, equivalent to the detected package-runner command such as `pnpm dlx @prisma/cli@latest agent install --skill prisma-compute`; declining records the prompt as dismissed in local CLI state, so neither init nor deploy asks again; a failed install downgrades to a warning with the retry command, records no dismissal (a later interactive init or deploy offers again), and the config write stands; does not prompt in `--json`, `--quiet`, CI, non-interactive, or `--yes` runs
421
422
-`nextSteps` includes the deploy command, plus the project link command when the directory is still unlinked
422
423
- user-facing command hints in init output (next steps, link hints, error recovery commands) use the package runner detected from the project, such as `pnpm dlx @prisma/cli@latest project link` or `npx -y @prisma/cli@latest app deploy`, matching the `agent` group's convention
423
424
- in `--json`, `result` includes `configPath`, `format` (`typescript` or `json`), `converted` (true only for the `--format ts` conversion path), the written `app` values (null when a conversion transported a config that does not pin a single fully-resolved app), per-value `settings` sources, and `link` state; `--json` never prompts
@@ -1411,7 +1412,7 @@ Behavior:
1411
1412
- maps user-facing framework names to deploy build strategies
1412
1413
- does not accept `--build-command` or `--output-directory`; custom build settings live in the `build` block of `prisma.compute.ts`
1413
1414
- deploys arbitrary framework output with `framework: "custom"` when the config provides a built output directory and entrypoint; `build.command` is optional for prebuilt artifacts
1414
-
- in interactive human deploys, prompts once to install the Prisma Compute skill for the project when `prisma-compute` is missing; accepting installs `prisma-compute` from `prisma/skills` from the project directory, equivalent to the detected package-runner command such as `pnpm dlx @prisma/cli@latest agent install --skill prisma-compute`; declining records the prompt as dismissed in local CLI state
1415
+
- in interactive human deploys, prompts once to install the Prisma Compute skill for the project when `prisma-compute` is missing; accepting installs `prisma-compute` from `prisma/skills` from the project directory, equivalent to the detected package-runner command such as `pnpm dlx @prisma/cli@latest agent install --skill prisma-compute`; declining records the prompt as dismissed in local CLI state, while a failed install records no dismissal, so a later interactive run offers again; the prompt and its dismissal state are shared with `init`, so whichever command runs interactively first asks and neither asks twice
1415
1416
- does not prompt for agent setup in `--json`, `--quiet`, CI, `--no-interactive`, or `--yes`
1416
1417
- uses `src/index.ts` as the Hono deploy entrypoint when the app has no `package.json#main` or `package.json#module` and that file exists
1417
1418
- supports vanilla Bun apps with `--framework bun` using `package.json#main` or `package.json#module`, or with `--entry <path>`
0 commit comments