Skip to content

feat: add bookmark and bookmark-to-folder CLI commands#62

Open
iammarcin wants to merge 2 commits intosteipete:mainfrom
iammarcin:feat/bookmark-commands
Open

feat: add bookmark and bookmark-to-folder CLI commands#62
iammarcin wants to merge 2 commits intosteipete:mainfrom
iammarcin:feat/bookmark-commands

Conversation

@iammarcin
Copy link

Problem

The engagement mixin already exposes client.bookmark() but there's no CLI command to use it. Users can unbookmark tweets (bird unbookmark) but cannot add bookmarks via CLI.

Solution

Adds two new commands:

  • bird bookmark <tweet-id-or-url> - bookmark a tweet
  • bird bookmark-to-folder <tweet-id-or-url> --folder-id <id> - bookmark to a specific folder

Also adds bookmarkTweetToFolder to query IDs and constants to support the folder functionality.

Changes

  • src/commands/bookmark.ts - new command mirroring unbookmark
  • src/commands/bookmark-to-folder.ts - new command with --folder-id option
  • src/lib/twitter-client-engagement.ts - added bookmarkToFolder() method
  • src/lib/twitter-client-constants.ts - added bookmarkTweetToFolder query ID
  • src/lib/query-ids.json - added bookmarkTweetToFolder query ID
  • src/cli/program.ts - registered new commands

Testing

Tested end-to-end on a production integration. Both commands work correctly with cookie-based auth.


Vibe coded with Claude Opus 4.5.

The engagement mixin already exposes client.bookmark() but there was no CLI
command to use it. This adds:

- `bird bookmark <tweet-id-or-url>` - bookmark a tweet
- `bird bookmark-to-folder <tweet-id-or-url> --folder-id <id>` - bookmark to folder

Also adds bookmarkTweetToFolder to query IDs and constants.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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: 34f1bd95cc

ℹ️ 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".

"FavoriteTweet": "lI07N6Otwv1PhnEgXILM7A",
"CreateBookmark": "aoDbu3RHznuiSkQ9aNM67Q",
"DeleteBookmark": "Wlmlj2-xzyS1GN3a6cj-mQ",
"bookmarkTweetToFolder": "4KHZvvNbHNf07bsgnL9gWA",

Choose a reason for hiding this comment

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

P2 Badge Add new operation to query-id refresh list

The new bookmarkTweetToFolder entry in query-ids.json will be dropped the next time scripts/update-query-ids.ts runs, because its TARGET_OPERATIONS list does not include this operation. That means the refresh process will never update this query ID and the CLI will eventually fail once the ID rotates (even if other IDs are kept current). Consider adding bookmarkTweetToFolder to TARGET_OPERATIONS so the refresh script preserves and updates it.

Useful? React with 👍 / 👎.

Ensures the query ID is preserved during refresh cycles.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@iammarcin
Copy link
Author

Good catch! Added bookmarkTweetToFolder to TARGET_OPERATIONS in the update script (198f95a).

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