feat: require --yes on msg/comment delete and thread/conversation done#9
Merged
Merged
Conversation
…versation done Ports Doist/twist-cli#190. Extends the existing `tdc thread delete` `--yes` confirmation pattern to the remaining destructive/state-changing commands: `tdc msg delete`, `tdc comment delete`, `tdc thread done`, and `tdc conversation done`. Without `--yes`, each command prints a preview and exits without mutating. With `--json` and no `--yes`, it rejects with `MISSING_YES_FLAG`. `--dry-run` still short-circuits before the `--yes` gate. Motivation: agents replay/retry commands more freely than humans; idempotent archive operations produce no error signal on repeat, and deletes can silently run twice. Requiring `--yes` makes mutation intent explicit. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
doistbot
reviewed
May 28, 2026
Member
doistbot
left a comment
There was a problem hiding this comment.
Thanks scottlovegrove for your contribution 😎 👊. This is a clean port of the --yes confirmation pattern that keeps the tests and skill documentation perfectly in sync.
Few things worth tightening:
- Adjust the placement of the
--yescheck inconversation done(after lookup to avoid masking invalid refs) andcomment delete(before remote checks to save unnecessary API calls during previews). - Move the
yes?: booleanproperty into a shared mutation options type insrc/lib/options.tsinstead of redefining it locally in each command handler.
- Move `yes?: boolean` into the shared `MutationOptions` type so each destructive command no longer redefines it locally. - Reorder `conversation done` to fetch the conversation before the gate so invalid refs surface a proper error instead of `MISSING_YES_FLAG`. - Move the `comment delete` and `msg delete` gates to the very top (before any remote calls) so previews don't trigger fetches or validation API calls. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
doist-release-bot Bot
added a commit
that referenced
this pull request
May 28, 2026
## [1.3.0](v1.2.0...v1.3.0) (2026-05-28) ### Features * require --yes on msg/comment delete and thread/conversation done ([#9](#9)) ([2e82d30](2e82d30))
Contributor
|
🎉 This PR is included in version 1.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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
Ports Doist/twist-cli#190. Extends the existing
tdc thread delete--yesconfirmation pattern to the remaining destructive/state-changing commands:tdc msg delete,tdc comment delete,tdc thread done, andtdc conversation done.--yes: prints a preview (Would delete message 42/Would archive: …) and exits without mutating.--jsonwithout--yes: throwsMISSING_YES_FLAG— matchesthread delete.--dry-runstill short-circuits before the--yesgate (validation pre-checks continue to run, consistent with existing dry-run behavior).thread/delete.tsstyle.Why
Agents replay/retry commands more freely than humans; idempotent archive operations produce no error signal on repeat, and deletes can silently run twice. Requiring
--yesmakes the mutation intent explicit. See Principle 4 of the 7 Principles for Agent-Friendly CLIs.Test plan
npm test— 684/684 pass (added preview,--json --yessuccess, and--json→MISSING_YES_FLAGcases to each command's test file)npm run type-check— cleannpm run lint:check— cleannode scripts/check-skill-sync.js— skill in synctdc msg delete <id>→ preview;--yes→ deletes;--jsonalone → errors.tdc comment delete <id>→ preview;--yes→ deletes;--jsonalone → errors.tdc thread done <id>→ preview;--yes→ archives;--jsonalone → errors;--dry-runalone → preview (no--yesneeded).tdc conversation done <id>→ same as above.tdc thread deletebehavior unchanged.🤖 Generated with Claude Code