feat(cli): destructive-write confirmation gate#164
Merged
Conversation
Wire the global --yes/-y flag (un-hidden again) and add cli.GateDestructive: a reusable confirmation gate every future #13 destructive command calls before its SOAP dispatch. Default is an explicit [y/N] prompt; --yes bypasses it; a non-interactive stdin without --yes refuses with exit 1. Declined/required map to ExitUserError via the exported, errors.Is-able sentinels ErrConfirmationDeclined / ErrConfirmationRequired. TTY detection is extracted to a single shared stdinIsTTY() (config init/add-profile reuse it). Safety contract documented in docs/usage; docs/cli regenerated so --yes is advertised again. No command is wired end-to-end yet: no #13 write endpoint exists and sessions delete is intentionally prompt-free. That acceptance box transfers to the first write-command PR. Refs #109.
This was referenced May 16, 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.
Wires the global
--yes/-yflag (un-hidden) and addscli.GateDestructive— a reusable confirmation gate future #13 destructive commands call before dispatch. Default: explicit[y/N]prompt;--yesbypasses; non-interactive stdin without--yesrefuses with exit 1 (errors.Is-able sentinelsErrConfirmationDeclined/ErrConfirmationRequired). TTY detection consolidated into one shared helper. Safety contract indocs/usage/destructive-writes.md;docs/cliregenerated.No end-to-end command wiring yet (no #13 write endpoint exists;
sessions deleteis intentionally prompt-free) — that acceptance box transfers to the first write-command PR.Refs #109.