The problem
--confirm <token> is a flag every command accepts. When no consent prompt in the run asks for the token, the value is ignored without a word:
prisma bucket key delete bkt_123 bkey_456 --confirm bkey_456
# deletes the key, exits 0; --confirm did nothing
A misspelled token is silent in the same way. The engine wants to treat an unconsumed --confirm as CLI.CONSENT_UNUSED, the same error a leftover statement flag gets.
#337 first made that rule apply to every command. The real-API e2e suite then failed on two commands, so #337 narrowed the rule: an unconsumed --confirm fails the run only on a command that declares statements. On every other command a leftover --confirm stays silent. This issue tracks applying the rule to every command.
Commands that take --confirm but never consume it
These commands never call ctx.prompt.consent. Their e2e tests still pass --confirm, and users may too:
bucket key delete (packages/cli/src/commands/bucket/key-delete.ts; e2e packages/cli/e2e/bucket.e2e.ts, which passes --confirm <key-id>)
project env delete (packages/cli/src/commands/project/env-delete.ts; e2e packages/cli/e2e/project-lifecycle.e2e.ts, which passes --confirm <name>)
Each needs one of two fixes: ask for consent with a token, as bucket delete does, or drop --confirm from its callers and docs.
Commands that ask for consent
I checked every ctx.prompt.consent call in packages/cli/src:
project transfer, project delete
postgres delete, postgres backup restore, postgres connection delete, postgres connection rotate
bucket delete
service delete, service version delete, service version rollback, service domain delete
Each one asks for consent on every path that reaches the destructive call. The only earlier exits are argument and usage errors, and those fail the run anyway. So none of them leaves a --confirm unconsumed on a successful run.
Done when
bucket key delete and project env delete consume --confirm, or no longer take it.
- The engine reports an unconsumed
--confirm as CLI.CONSENT_UNUSED on every command. That means removing the "declares statements" condition in leftoverConfirmTokens (packages/cli-engine/src/execution/prompts.ts).
- ADR 0006 and the
CLI.CONSENT_UNUSED entry in docs/reference/error-reference.md are updated to match.
The problem
--confirm <token>is a flag every command accepts. When no consent prompt in the run asks for the token, the value is ignored without a word:prisma bucket key delete bkt_123 bkey_456 --confirm bkey_456 # deletes the key, exits 0; --confirm did nothingA misspelled token is silent in the same way. The engine wants to treat an unconsumed
--confirmasCLI.CONSENT_UNUSED, the same error a leftover statement flag gets.#337 first made that rule apply to every command. The real-API e2e suite then failed on two commands, so #337 narrowed the rule: an unconsumed
--confirmfails the run only on a command that declaresstatements. On every other command a leftover--confirmstays silent. This issue tracks applying the rule to every command.Commands that take
--confirmbut never consume itThese commands never call
ctx.prompt.consent. Their e2e tests still pass--confirm, and users may too:bucket key delete(packages/cli/src/commands/bucket/key-delete.ts; e2epackages/cli/e2e/bucket.e2e.ts, which passes--confirm <key-id>)project env delete(packages/cli/src/commands/project/env-delete.ts; e2epackages/cli/e2e/project-lifecycle.e2e.ts, which passes--confirm <name>)Each needs one of two fixes: ask for consent with a token, as
bucket deletedoes, or drop--confirmfrom its callers and docs.Commands that ask for consent
I checked every
ctx.prompt.consentcall inpackages/cli/src:project transfer,project deletepostgres delete,postgres backup restore,postgres connection delete,postgres connection rotatebucket deleteservice delete,service version delete,service version rollback,service domain deleteEach one asks for consent on every path that reaches the destructive call. The only earlier exits are argument and usage errors, and those fail the run anyway. So none of them leaves a
--confirmunconsumed on a successful run.Done when
bucket key deleteandproject env deleteconsume--confirm, or no longer take it.--confirmasCLI.CONSENT_UNUSEDon every command. That means removing the "declares statements" condition inleftoverConfirmTokens(packages/cli-engine/src/execution/prompts.ts).CLI.CONSENT_UNUSEDentry indocs/reference/error-reference.mdare updated to match.