feat(prisma-compute): teach agents the CLI feedback command#21
Merged
Conversation
AmanVarshney01
added a commit
to prisma/prisma-cli
that referenced
this pull request
Jul 14, 2026
## What this adds
`prisma-cli feedback` sends a message to the Prisma CLI team. It is a
top-level command like `version`: it needs no auth, no workspace, no
project, no config, and it never prompts, so it works identically for
humans, CI, and agents.
```
$ prisma-cli feedback "loving the new deploy flow"
feedback → Feedback sent. Thank you!
│ id: 019f5f8b-a108-7000-8457-78598b856156
│ sent as: anonymous
│ included: CLI 3.0.0-development, node v24.18.0, darwin arm64
```
## Anonymous by default
Without `--email`, nothing identifying leaves the machine. This is the
entire wire payload:
```json
{
"message": "loving the new deploy flow",
"meta": {
"cliVersion": "3.0.0-development",
"nodeVersion": "v24.18.0",
"platform": "darwin",
"arch": "arm64"
}
}
```
The command help discloses exactly that list ("Anonymous unless --email
is passed. Every submission includes the CLI version, node version, and
OS platform/arch, and nothing else."). The service uses the client IP
transiently, in memory, to rate limit; it is never stored, and the spec
says so.
`--email` is the only way to become contactable, validated before
anything is sent (shape and the service's 320-char limit):
```
$ prisma-cli feedback "please add X" --email dev@example.com # payload gains "email"
$ prisma-cli feedback "please add X" --email not-an-email
✘ Invalid email [USAGE_ERROR]
Fix: Pass a valid address with --email, or drop the flag to stay anonymous.
```
## Agent output
`--json` returns the standard envelope; `id` is the service's stored
submission id (null when the response has none), `email` is null when
anonymous:
```json
{
"ok": true,
"command": "feedback",
"result": {
"id": "fb_...",
"email": null,
"context": { "cliVersion": "...", "nodeVersion": "...", "platform": "...", "arch": "..." }
}
}
```
## Failure behavior
Validation happens before any network call and exits 2 as `USAGE_ERROR`:
empty or whitespace-only message, message over 4000 characters, email
invalid or over 320 characters. Nothing is sent in those cases.
Delivery problems exit 1 as `FEEDBACK_SEND_FAILED` and surface the
service's own detail:
```
$ prisma-cli feedback "hello" # service returned 500
✘ Feedback could not be delivered [FEEDBACK_SEND_FAILED]
Why: The feedback service responded with HTTP 500 (db down).
Fix: Check your network and rerun the command.
```
Requests time out after 3 seconds, and the timeout covers the body read
too: a 201 whose body stalls is a delivery failure, not a fake success,
and user cancellation propagates instead of exiting 0. Only a fully
received non-JSON 2xx body maps to a null id. `PRISMA_CLI_FEEDBACK_URL`
overrides the endpoint for tests and staging.
## Crashes point here (and stop breaking --json)
Unexpected crashes previously wrote plain text even under `--json`. The
outermost boundary now emits the standard envelope with code
`UNEXPECTED_ERROR`, and both output modes advertise the feedback command
pre-filled with the failing command and error line:
```
$ prisma-cli project list # CLI bug/crash
Unexpected CLI error: ENOENT: no such file or directory, open '...'
More: Re-run with --trace for deeper diagnostics
Tell us what happened: prisma-cli feedback 'project list crashed: ENOENT: ...'
```
```json
{
"ok": false,
"command": "project.list",
"error": { "code": "UNEXPECTED_ERROR", "domain": "cli", "why": "ENOENT: ..." },
"nextSteps": ["prisma-cli feedback 'project list crashed: ENOENT: ...'"],
"nextActions": [
{
"kind": "run-command",
"journey": "recover",
"label": "Report this crash to the Prisma team",
"command": "prisma-cli feedback 'project list crashed: ENOENT: ...'"
}
]
}
```
`--quiet` suppresses the human hint. Usage errors and expected failures
never advertise feedback, so the pointer stays a signal rather than
wallpaper. The pre-filled command is shell-escaped and runnable
verbatim; a companion PR (prisma/skills#21) teaches the prisma-compute
skill to run it.
## Where feedback goes
A small Bun server on Prisma Compute in the Prisma DevRel workspace,
storing to Prisma Postgres (repo: `~/dev/work/prisma-cli-feedback`, app
`cli-feedback`), with the same limits enforced server-side plus per-IP
rate limiting and a token-gated admin read endpoint.
## Docs (spec-first)
- `command-spec.md`: `feedback` section, top-level command lists (Scope
and Global Rules), privacy wording including IP handling, crash-pointer
bullet.
- `error-conventions.md`: `FEEDBACK_SEND_FAILED` and `UNEXPECTED_ERROR`
registered with recommended meanings; crash-boundary rule updated.
- `output-conventions.md`: `feedback` added to the pattern mapping.
## Testing
- `tests/feedback.test.ts`: 10 tests against a real local HTTP server:
anonymous payload shape, email inclusion, empty/oversized message,
invalid and over-long email (nothing sent in each case), service 5xx,
unreachable service, stalled 2xx body (fails at 3s), null id.
- `tests/shell.test.ts`: crash-boundary tests for the feedback hint,
command labeling, pre-filled report escaping, and the `UNEXPECTED_ERROR`
JSON envelope with its `recover` action.
- Manual verification sweeps through the built CLI: 25+ usage cases
against a mock service (boundaries, flag parsing edges, failure modes,
unicode, wire-payload inspection), a forced real crash in all three
output modes, and live sends verified end to end against the production
service and database. Full suite: 643 tests pass.
Audited against prisma/prisma-cli (command spec + source), the installed @prisma/compute-sdk 0.34.0, prisma/project-compute, and prisma/pdp-control-plane. prisma-compute: - build blocks are accepted for every framework (all build types are config-backed); the 'CLI rejects build blocks for nuxt/astro/nestjs' claim was never true for these SDKs; reworded in seven places - deploy-time database setup via --db/--no-db (--db --yes in CI) replaces the stale 'do not add database setup to deploy examples' - --no-promote build-then-verify path; first production deploy auto-promotes without --prod - project rename/transfer/remove, database usage/backup list/restore, connection rotate added to the command surface - agent deploy template no longer assumes --prod - prisma.compute.json in the accepted filename list; bun.lockb in the discovery boundaries; top-level region default documented - NestJS detection includes nest-cli.json; deploy port default is framework-specific (Astro 4321) - branch wording narrowed to branch list (no create/remove commands) - SDK deploy-result fields completed; env-var scope follows branch role prisma-postgres (7.6.0 -> 7.7.0): - @prisma/cli database group added for persistent databases - Workspace->Project->Branch->Database model and branch endpoints - endpoints.direct/endpoints.pooled documented; flat connectionString deprecated; one-time-view secret behavior noted
nurul3101
approved these changes
Jul 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@prisma/clinow ships afeedbackcommand (prisma/prisma-cli#119) and its crash output points at it. This PR teaches the skills that, and also carries a full staleness audit of the compute/platform skills against the current sources: prisma/prisma-cli (command spec + source), the installed@prisma/compute-sdk0.34.0, prisma/project-compute, and prisma/pdp-control-plane.Feedback command (prisma-compute, v1.3.1 -> v1.4.0)
deploy-report-cli-bugsand troubleshooting section "Report Unresolved CLI Issues": onUNEXPECTED_ERRORor unresolvable failures, sendbunx @prisma/cli@latest feedback "<command>: <error summary>", preferring the pre-filled command from the crash envelope'snextActionsverbatim. Privacy contract spelled out (anonymous; only CLI/node/OS versions; never secrets).init coverage (prisma-compute)
init; addedconfig-init-formalizerand a compute-config section covering detection,--format json, the JSON-to-TS conversion, and init's refusals.Staleness audit fixes (prisma-compute)
buildblocks for nuxt/astro/nestjs" was never true for these SDK versions; all build types are config-backed. Reworded in seven places to "optional; overrides framework-strategy defaults".--no-promotebuild-then-verify path added; noted the first production deploy auto-promotes without--prod; the agent deploy template no longer assumes--prod --yes.project rename/transfer/remove,database usage,database backup list,database restore,database connection rotateadded, with the exact--confirm <id>requirement. (build list/showdeliberately NOT added: specced but not yet registered in the CLI.)prisma.compute.jsonadded to the accepted filename list,bun.lockbto discovery boundaries, top-levelregiondefault documented.nest-cli.json; deploy port default is framework-specific (Astro 4321).projectId,region,previousDeploymentId,previousDeploymentAction); env-var scoping corrected to follow the attached branch's role (preview -> branch-scoped, production -> project-scoped).branch list(no create/remove commands exist).prisma-postgres (v7.6.0 -> v7.7.0)
@prisma/cli databasegroup added as the persistent-database path (distinct fromcreate-dbthrowaways).endpoints.direct/endpoints.pooleddocumented; flatconnectionStringnoted as deprecated; one-time-view secret behavior noted.prisma postgres linkis an ORM CLI command (prisma@latest), verified working, and stays.Sequencing
The
feedbackguidance references a command that lands with prisma/prisma-cli#119; merge this after that PR ships in an@prisma/clirelease. Everything else has no release dependency.