Skip to content

feat: add delete command for deleting tweets#63

Open
chris-sev wants to merge 2 commits intosteipete:mainfrom
chris-sev:add-delete-command
Open

feat: add delete command for deleting tweets#63
chris-sev wants to merge 2 commits intosteipete:mainfrom
chris-sev:add-delete-command

Conversation

@chris-sev
Copy link

@chris-sev chris-sev commented Jan 24, 2026

For adding deleting tweets. Not sure if we want this in the CLI. But with great power comes... hilarious tweets?


This PR adds a bird delete command for deleting tweets.

Changes

  • Add DeleteTweet to fallback query IDs (using VaenaVgh5q5ih7kvyVjgtg)
  • Add deleteTweet method to TwitterClient posting mixin
  • Create new delete.ts command file
  • Register delete command in CLI program

Usage

# Delete a single tweet by ID
bird delete 1234567890123456789

# Delete a tweet by URL
bird delete https://x.com/user/status/1234567890123456789

# Delete multiple tweets at once
bird delete 111111111 222222222 333333333

# JSON output
bird delete 1234567890123456789 --json

Implementation

The implementation follows the same patterns as other mutation commands (unbookmark, etc.):

  • Uses GraphQL DeleteTweet mutation
  • Handles 404s by refreshing query IDs and retrying
  • Falls back to generic GraphQL endpoint on persistent 404s
  • Uses tweet-specific referer header (matches other mutations)
  • Verifies deletion was acknowledged before returning success
  • Returns success/error status for each tweet
  • Supports --json output flag
  • Exits with code 1 if any deletion fails

All existing tests pass. 🎉

- Add DeleteTweet to fallback query IDs (VaenaVgh5q5ih7kvyVjgtg)
- Add deleteTweet method to TwitterClient posting mixin
- Create new delete.ts command file
- Register delete command in CLI program

Usage: bird delete <tweet-id-or-url...>

Supports both tweet IDs and full URLs, can delete multiple tweets in one call.
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c00d8ba050

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

- Add fallback to TWITTER_GRAPHQL_POST_URL on persistent 404
- Use tweet-specific referer header (matches other mutations)
- Verify delete_tweet exists in response before reporting success
- Add --json flag for JSON output support
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