feat(twitter): add tweets command for fetching user's recent posts#1098
Merged
feat(twitter): add tweets command for fetching user's recent posts#1098
Conversation
Adds `opencli twitter tweets <username> [--limit N]` to pull a user's most recent chronological tweets via the UserTweets GraphQL endpoint. Long posts resolve via note_tweet, pinned entries are skipped, and retweets are flagged. QueryIds resolve dynamically through `resolveTwitterQueryId` with hardcoded fallbacks.
luxiaolei
pushed a commit
to luxiaolei/OpenCLI
that referenced
this pull request
Apr 21, 2026
…ackwener#1098) * feat(twitter): add tweets command for fetching a user's recent posts Adds `opencli twitter tweets <username> [--limit N]` to pull a user's most recent chronological tweets via the UserTweets GraphQL endpoint. Long posts resolve via note_tweet, pinned entries are skipped, and retweets are flagged. QueryIds resolve dynamically through `resolveTwitterQueryId` with hardcoded fallbacks. * fix(twitter): expose retweet flag in tweets output (cherry picked from commit 9339565)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
opencli twitter tweets <username> [--limit N]— pulls a user's most recent chronological tweets via Twitter'sUserTweetsGraphQL endpoint.UserByScreenNamenote_tweet.note_tweet_results.result.text; falls back tolegacy.full_textTimelinePinEntryso output is strictly chronologicallegacy.retweeted_status_resultorRT @prefixviews.countis stringly-typed in the payload — coerced toNumberresolveTwitterQueryId(shared withlikes.js), with hardcoded fallbacks if discovery failsVerified live against
@jakevin7pulling both 10 and 20 tweets.Test plan
npm run build— manifest regenerates with the new entrynpm test— full suite passes (1615 passed, 2 skipped)npx vitest run clis/twitter/tweets.test.js— 6 new tests greenopencli twitter tweets jakevin7 --limit 20 -f jsonreturns 20 tweets with populated fields