Skip to content

feat: add thread deletion support#133

Merged
scottlovegrove merged 3 commits intomainfrom
scottl/delete-thread
Apr 3, 2026
Merged

feat: add thread deletion support#133
scottlovegrove merged 3 commits intomainfrom
scottl/delete-thread

Conversation

@scottlovegrove
Copy link
Copy Markdown
Collaborator

Summary

  • Adds tw thread delete <thread-ref> command with --yes confirmation, --dry-run, and --json flags
  • Batch-fetches thread and session user to validate ownership before deletion
  • Uses process.exitCode = 1 + return (not process.exit(1)) to avoid leaving the early spinner stuck

Closes #130

Test plan

  • npm run type-check passes
  • All 342 tests pass (npm test)
  • Lint clean (npm run lint)
  • Skill file in sync (npm run check:skill-sync)
  • Manual: tw thread delete <own-thread-url> shows confirmation prompt
  • Manual: tw thread delete <own-thread-url> --yes deletes the thread
  • Manual: tw thread delete <other-user-thread-url> --yes shows ownership error

🤖 Generated with Claude Code

Add `tw thread delete <thread-ref>` command with ownership validation,
`--yes` confirmation flag, and `--dry-run`/`--json` support.

Closes #130

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@doistbot doistbot requested a review from rmartins90 April 3, 2026 22:53
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@scottlovegrove scottlovegrove self-assigned this Apr 3, 2026
@scottlovegrove scottlovegrove added the 👀 Show PR PR must be reviewed before or after merging label Apr 3, 2026
Copy link
Copy Markdown
Member

@doistbot doistbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR introduces the tw thread delete command complete with confirmation safeguards, dry-run capabilities, and ownership validation, which is a great addition to our thread management tools. The careful approach to handling early spinner exits and verifying permissions ensures a safe foundation for destructive actions. A few adjustments have been flagged regarding the ordering of validation checks—specifically moving the dry-run check before network calls and prioritizing the public channel guard—along with refining the --json flag's behavior during preview and unconfirmed states to guarantee reliable scriptability.

Share FeedbackReview Logs

Comment thread src/commands/thread/delete.ts
Comment thread src/commands/thread/delete.ts
Comment thread src/commands/thread/delete.ts
Comment thread src/commands/thread/delete.ts
- Move assertChannelIsPublic before ownership check for consistency
- Error with non-zero exit when --json used without --yes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@scottlovegrove scottlovegrove merged commit eed878c into main Apr 3, 2026
4 checks passed
@scottlovegrove scottlovegrove deleted the scottl/delete-thread branch April 3, 2026 23:05
doist-release-bot bot added a commit that referenced this pull request Apr 3, 2026
## [2.23.0](v2.22.1...v2.23.0) (2026-04-03)

### Features

* add thread deletion support ([#133](#133)) ([eed878c](eed878c))
@doist-release-bot
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 2.23.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link
Copy Markdown

@rmartins90 rmartins90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released 👀 Show PR PR must be reviewed before or after merging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add thread deletion support to the CLI

3 participants