Doist / Doist/twist-cli

Ensure all destructive/state-changing commands require --yes confirmation

Open
#134 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
3
Forks
1
Avg merge
2h 4m
Merged PRs (30d)
14

Description

Problem

Currently only tw thread delete requires the --yes flag before executing. All other destructive and state-changing commands execute immediately without confirmation.

Commands that execute without --yes today:

Deletes (irreversible):

  • tw msg delete — permanently deletes a conversation message
  • tw comment delete — permanently deletes a thread comment

Archive/state changes:

  • tw thread done — archives a thread
  • tw conversation done — archives a conversation

Why this matters

From the 7 Principles for Agent-Friendly CLIs, Principle 4 (Safe Retries and Explicit Mutation Boundaries):

Agents retry, resume, and replay commands more frequently than humans. Dangerous mutations require explicit flags.

Agents operating in retry loops won't notice if a delete ran twice — and for archive operations, because they're idempotent (archiving an already-archived item is a no-op), an agent won't get an error signal that it already ran. The --yes flag acts as an explicit acknowledgement that the agent intended the mutation.

The existing thread delete implementation is the reference pattern:

  • Without --yes: shows what would happen and exits (non-destructive preview)
  • With --json but without --yes: errors with "--yes is required to execute deletion in --json mode"
  • With --yes: executes the operation

Scope

All of the following should follow the thread delete pattern:

Command Type Currently requires --yes
tw thread delete Delete ✅ Yes
tw msg delete Delete ❌ No
tw comment delete Delete ❌ No
tw thread done Archive ❌ No
tw conversation done Archive ❌ No

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the existing tw thread delete implementation as the reference pattern, then locate the handlers for tw msg delete, tw comment delete, tw thread done, and tw conversation done. Verify each command's behavior without --yes, with --json, and with --yes; done means all five commands require explicit confirmation consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.