Skip to content

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

@scottlovegrove

Description

@scottlovegrove

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions