Skip to content

feat(cli): destructive-write confirmation gate#164

Merged
chmmou merged 1 commit into
mainfrom
feat/cli-destructive-confirm-gate
May 16, 2026
Merged

feat(cli): destructive-write confirmation gate#164
chmmou merged 1 commit into
mainfrom
feat/cli-destructive-confirm-gate

Conversation

@chmmou

@chmmou chmmou commented May 16, 2026

Copy link
Copy Markdown
Owner

Wires the global --yes/-y flag (un-hidden) and adds cli.GateDestructive — a reusable confirmation gate future #13 destructive commands call before dispatch. Default: explicit [y/N] prompt; --yes bypasses; non-interactive stdin without --yes refuses with exit 1 (errors.Is-able sentinels ErrConfirmationDeclined/ErrConfirmationRequired). TTY detection consolidated into one shared helper. Safety contract in docs/usage/destructive-writes.md; docs/cli regenerated.

No end-to-end command wiring yet (no #13 write endpoint exists; sessions delete is intentionally prompt-free) — that acceptance box transfers to the first write-command PR.

Refs #109.

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.
@chmmou chmmou merged commit 0895787 into main May 16, 2026
6 checks passed
@chmmou chmmou deleted the feat/cli-destructive-confirm-gate branch May 16, 2026 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant