--- description: "X.com (Twitter) platform operations playbook for agent-browser. Covers browse, engagement, content creation, social graph, profile, navigation, and lists operations with tested step-by-step agent-browser commands." allowed-tools: - Bash user-invocable: true --- # X.com (Twitter) — Agent Browser Playbook Platform-specific operation sequences for agent-browser on x.com. Each operation documents: preconditions, step-by-step agent-browser commands, verification method, and known pitfalls. **Status**: All sections (1-7) tested and documented. **Tested with**: agent-browser 0.24.0, Chrome CDP on port 9222, account @mashijiann. **Last updated**: 2026-05-06 --- ## Table of Contents - [1. Browse & Read](#1-browse--read) - [1.1 Open Home Timeline](#11-open-home-timeline) - [1.2 Open a Specific Tweet by URL](#12-open-a-specific-tweet-by-url) - [1.3 Search Tweets by Keyword](#13-search-tweets-by-keyword) - [1.4 View a User Profile](#14-view-a-user-profile) - [1.5 Read Tweet Thread / Replies](#15-read-tweet-thread--replies) - [1.6 Read Notifications](#16-read-notifications) - [1.7 Read DMs (Direct Messages)](#17-read-dms-direct-messages) - [2. Engagement — React to Content](#2-engagement--react-to-content) - [2.1 Like a Tweet](#21-like-a-tweet) - [2.2 Unlike a Tweet](#22-unlike-a-tweet) - [2.3 Retweet (Repost)](#23-retweet-repost) - [2.4 Undo Retweet](#24-undo-retweet) - [2.5 Bookmark a Tweet](#25-bookmark-a-tweet) - [2.6 Remove Bookmark](#26-remove-bookmark) - [3. Content Creation](#3-content-creation) - [3.1 Post a New Tweet (Text Only)](#31-post-a-new-tweet-text-only) - [3.2 Post a Tweet with Image](#32-post-a-tweet-with-image) - [3.3 Reply to a Tweet](#33-reply-to-a-tweet) - [3.4 Quote Tweet](#34-quote-tweet) - [3.5 Delete Own Tweet](#35-delete-own-tweet) - [4. Social Graph](#4-social-graph) - [4.1 Follow a User](#41-follow-a-user) - [4.2 Unfollow a User](#42-unfollow-a-user) - [4.3 View Followers List](#43-view-followers-list) - [4.4 View Following List](#44-view-following-list) - [5. Profile Management](#5-profile-management) - [5.1 View Own Profile](#51-view-own-profile) - [5.2 Edit Bio / Display Name](#52-edit-bio--display-name) - [5.3 Pin a Tweet](#53-pin-a-tweet) - [6. Navigation & Utility](#6-navigation--utility) - [6.1 Switch Between Tabs (For You / Following)](#61-switch-between-tabs-for-you--following) - [6.2 Scroll to Load More Tweets](#62-scroll-to-load-more-tweets) - [6.3 Handle Login Popups / Modals](#63-handle-login-popups--modals) - [6.4 Handle Cookie Consent Banner](#64-handle-cookie-consent-banner) - [6.5 Dismiss "Turn on notifications" Prompt](#65-dismiss-turn-on-notifications-prompt) - [7. Lists](#7-lists) - [7.1 View Own Lists](#71-view-own-lists) - [7.2 View a List Timeline](#72-view-a-list-timeline) - [7.3 Browse List Members](#73-browse-list-members) - [7.4 Create a New List](#74-create-a-new-list) - [7.5 Add Member to List](#75-add-member-to-list) - [7.6 Remove Member from List](#76-remove-member-from-list) - [7.7 Delete a List](#77-delete-a-list) --- > **Device targeting:** Operations run against desktop Chrome by default. To > operate the mobile web surface, set `DEVICE_PROFILE=ios|android` in `.env` or > prefix agent-browser commands with `-p ios|android`. When logging an action, > pass `--device ` for provenance (it does not change dedup — a like is > account-level). ## 1. Browse & Read ### 1.1 Open Home Timeline **Goal**: Navigate to the home timeline and confirm it loaded. **Preconditions**: Logged in (Chrome CDP session with cookies). **Steps**: ```bash agent-browser open https://x.com/home ``` **Verification**: ```bash # Title should contain "Home / X" agent-browser get title # URL should be https://x.com/home agent-browser get url # Snapshot should show region "Your Home Timeline" and tab "For you" agent-browser snapshot -i -c -s '[role="region"]' ``` **Key Elements**: - Navigation sidebar: `navigation "Primary"` — contains links: Home, Search and explore, Notifications, Direct Messages, Grok, Premium, Bookmarks, Profile - Timeline tabs: `tab "For you"` (default selected), `tab "Following"`, possibly custom tabs - Compose area: `textbox "Post text"` — inline compose on home page - Account button: `button "Account menu"` — shows logged-in username - Timeline region: `region "Your Home Timeline"` — contains tweet `article` elements **Known Issues**: - None --- ### 1.2 Open a Specific Tweet by URL **Goal**: Navigate directly to a tweet and read its content. **Preconditions**: Have the tweet URL (e.g. `https://x.com/user/status/123456`). **Steps**: ```bash agent-browser open "https://x.com//status/" ``` **Verification**: ```bash # Title should contain the author's name and tweet content preview agent-browser get title # URL should match the tweet URL agent-browser get url # Snapshot should show the tweet article with full text and engagement buttons agent-browser snapshot -i -c -s 'article' ``` **Key Elements** (tweet detail page): - Tweet article: `article` — contains full tweet text, author info, engagement stats - Author links: `link " Verified account"`, `link "@"` - Timestamp: `link "