@datatamer.ai/agentdev 1.0.5 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,430 @@
1
+ # agentdev twitter — Twitter/X CLI
2
+
3
+ Use `agentdev twitter` (or `agentdev x`) for ALL Twitter/X operations. Do NOT attempt to use Twitter APIs directly.
4
+
5
+ ## Prerequisites
6
+
7
+ User must connect their Twitter/X account first:
8
+ 1. Visit /profile page on AgentDev
9
+ 2. Click "Connect Twitter"
10
+ 3. Complete OAuth authorization flow
11
+
12
+ If Twitter is not connected, all commands will fail with instructions to connect.
13
+
14
+ **IMPORTANT:** Twitter API v2 requires specific OAuth scopes. If you see permission errors, reconnect at /profile.
15
+
16
+ ## Tweet Commands
17
+
18
+ ### Create Tweet
19
+
20
+ ```bash
21
+ agentdev twitter tweet create --text "Hello Twitter!"
22
+ ```
23
+
24
+ **Character Limit:** 280 characters (validation enforced)
25
+
26
+ ### Create Reply
27
+
28
+ ```bash
29
+ agentdev twitter tweet create \
30
+ --text "Great point!" \
31
+ --reply-to <tweet-id>
32
+ ```
33
+
34
+ ### Quote Tweet
35
+
36
+ ```bash
37
+ agentdev twitter tweet create \
38
+ --text "This is insightful!" \
39
+ --quote <tweet-id>
40
+ ```
41
+
42
+ **Or use the dedicated quote command:**
43
+
44
+ ```bash
45
+ agentdev twitter quote <tweet-id> --text "Amazing thread!"
46
+ ```
47
+
48
+ ### Create Thread
49
+
50
+ ```bash
51
+ agentdev twitter tweet thread --text "First tweet
52
+ ---
53
+ Second tweet
54
+ ---
55
+ Third tweet"
56
+ ```
57
+
58
+ **Thread Format:**
59
+ - Separate tweets with `---`
60
+ - Each tweet must be ≤ 280 characters
61
+ - Minimum 2 tweets per thread
62
+
63
+ ### List Your Tweets
64
+
65
+ ```bash
66
+ agentdev twitter tweet list --count 20
67
+ ```
68
+
69
+ ### View Tweet Details
70
+
71
+ ```bash
72
+ agentdev twitter tweet view <tweet-id>
73
+ ```
74
+
75
+ Shows:
76
+ - Tweet text
77
+ - Author information
78
+ - Metrics (replies, retweets, likes, views)
79
+ - Timestamp
80
+ - Tweet URL
81
+
82
+ ### Search Tweets
83
+
84
+ ```bash
85
+ agentdev twitter tweet search "AI agents" --count 10
86
+ ```
87
+
88
+ ### Delete Tweet
89
+
90
+ ```bash
91
+ agentdev twitter tweet delete <tweet-id> --confirm
92
+ ```
93
+
94
+ **Important:** Requires `--confirm` flag to prevent accidental deletions.
95
+
96
+ ## Timeline Commands
97
+
98
+ ### View Home Timeline
99
+
100
+ ```bash
101
+ agentdev twitter timeline home --count 10
102
+ ```
103
+
104
+ Shows tweets from people you follow (chronological order).
105
+
106
+ ### View Mentions
107
+
108
+ ```bash
109
+ agentdev twitter timeline mentions --count 10
110
+ ```
111
+
112
+ Shows tweets that mention your @ handle.
113
+
114
+ ## Profile Commands
115
+
116
+ ### View Your Profile
117
+
118
+ ```bash
119
+ agentdev twitter profile
120
+ ```
121
+
122
+ ### View Another User's Profile
123
+
124
+ ```bash
125
+ agentdev twitter profile --username elonmusk
126
+ ```
127
+
128
+ Shows:
129
+ - Name and username
130
+ - Bio
131
+ - Follower/following counts
132
+ - Tweet count
133
+ - Verification status
134
+
135
+ ## Follow/Unfollow
136
+
137
+ ### Follow User
138
+
139
+ ```bash
140
+ agentdev twitter follow @username
141
+ ```
142
+
143
+ ### Unfollow User
144
+
145
+ ```bash
146
+ agentdev twitter unfollow @username
147
+ ```
148
+
149
+ **Note:** Username can be provided with or without @ symbol.
150
+
151
+ ## Engagement Commands
152
+
153
+ ### Like Tweet
154
+
155
+ ```bash
156
+ agentdev twitter like <tweet-id>
157
+ ```
158
+
159
+ ### Unlike Tweet
160
+
161
+ ```bash
162
+ agentdev twitter unlike <tweet-id>
163
+ ```
164
+
165
+ ### Retweet
166
+
167
+ ```bash
168
+ agentdev twitter retweet <tweet-id>
169
+ ```
170
+
171
+ ### Remove Retweet
172
+
173
+ ```bash
174
+ agentdev twitter unretweet <tweet-id>
175
+ ```
176
+
177
+ ## Rate Limits
178
+
179
+ Twitter API v2 has the following rate limits:
180
+
181
+ **Tweets:**
182
+ - **200 tweets per 15 minutes** (user context)
183
+ - **50 tweet deletions per 15 minutes**
184
+
185
+ **Timeline:**
186
+ - **180 requests per 15 minutes**
187
+
188
+ **Search:**
189
+ - **180 requests per 15 minutes**
190
+
191
+ **User Lookups:**
192
+ - **900 requests per 15 minutes**
193
+
194
+ **Engagement:**
195
+ - **1000 likes per 24 hours**
196
+ - **50 retweets per 15 minutes**
197
+ - **400 follows per day**
198
+
199
+ If rate limit is exceeded, you'll receive an error with reset time.
200
+
201
+ ## Error Handling
202
+
203
+ | Error | Meaning | Action |
204
+ |-------|---------|--------|
205
+ | "Twitter not connected" | User hasn't connected Twitter | Direct user to /profile |
206
+ | "Token expired" | OAuth token expired | User must reconnect at /profile |
207
+ | "Rate limit exceeded" | Hit API rate limits | Wait until reset time |
208
+ | "Duplicate tweet" | Posted same content recently | Wait or change content |
209
+ | "Insufficient permissions" | Missing OAuth scopes | Reconnect at /profile |
210
+ | "Resource not found" | Invalid tweet/user ID | Check ID and try again |
211
+ | "Tweet exceeds 280 characters" | Text too long | Shorten tweet |
212
+
213
+ ## Agent Task Examples
214
+
215
+ ### Example 1: Daily Update
216
+
217
+ When asked to "post a status update on Twitter":
218
+
219
+ ```bash
220
+ agentdev twitter tweet create --text "Working on exciting AI features today! 🚀 #AI #Development"
221
+ ```
222
+
223
+ ### Example 2: Thread About Progress
224
+
225
+ When asked to "create a thread about today's accomplishments":
226
+
227
+ ```bash
228
+ agentdev twitter tweet thread --text "Today's accomplishments (🧵):
229
+ ---
230
+ 1. ✅ Shipped new Twitter integration for agentdev
231
+ ---
232
+ 2. ✅ Added comprehensive error handling
233
+ ---
234
+ 3. ✅ Created detailed documentation
235
+ ---
236
+ Excited to see what tomorrow brings! #BuildInPublic"
237
+ ```
238
+
239
+ ### Example 3: Engage with Mentions
240
+
241
+ When asked to "check my Twitter mentions":
242
+
243
+ ```bash
244
+ agentdev twitter timeline mentions --count 20
245
+ ```
246
+
247
+ ### Example 4: Search and Engage
248
+
249
+ When asked to "find tweets about AI agents and engage":
250
+
251
+ ```bash
252
+ # Search for relevant tweets
253
+ agentdev twitter tweet search "AI agents" --count 10
254
+
255
+ # Like interesting tweets
256
+ agentdev twitter like <tweet-id>
257
+
258
+ # Retweet great content
259
+ agentdev twitter retweet <tweet-id>
260
+
261
+ # Reply with value
262
+ agentdev twitter tweet create \
263
+ --text "Great insights! We're building similar capabilities at AgentDev" \
264
+ --reply-to <tweet-id>
265
+ ```
266
+
267
+ ### Example 5: Follow Thought Leaders
268
+
269
+ When asked to "follow AI thought leaders":
270
+
271
+ ```bash
272
+ agentdev twitter follow @AndrewYNg
273
+ agentdev twitter follow @ylecun
274
+ agentdev twitter follow @karpathy
275
+ ```
276
+
277
+ ### Example 6: Daily Analytics
278
+
279
+ When asked to "how did my latest tweet perform?":
280
+
281
+ ```bash
282
+ # Get your recent tweets
283
+ agentdev twitter tweet list --count 1
284
+
285
+ # View detailed metrics
286
+ agentdev twitter tweet view <tweet-id>
287
+ ```
288
+
289
+ ### Example 7: Clean Up Old Tweets
290
+
291
+ When asked to "delete that embarrassing tweet":
292
+
293
+ ```bash
294
+ # Find the tweet
295
+ agentdev twitter tweet list --count 20
296
+
297
+ # Delete it
298
+ agentdev twitter tweet delete <tweet-id> --confirm
299
+ ```
300
+
301
+ ### Example 8: Engage with Timeline
302
+
303
+ When asked to "catch up on Twitter":
304
+
305
+ ```bash
306
+ # View home timeline
307
+ agentdev twitter timeline home --count 20
308
+
309
+ # Like good content
310
+ agentdev twitter like <tweet-id>
311
+
312
+ # Retweet great finds
313
+ agentdev twitter retweet <tweet-id>
314
+ ```
315
+
316
+ ## Required OAuth Scopes
317
+
318
+ The following scopes are automatically requested during OAuth flow:
319
+
320
+ **Read Scopes:**
321
+ - `tweet.read` - Read tweets and timelines
322
+ - `users.read` - Read user profiles
323
+ - `follows.read` - Read followers/following
324
+ - `like.read` - Read likes
325
+
326
+ **Write Scopes:**
327
+ - `tweet.write` - Create and delete tweets
328
+ - `follows.write` - Follow/unfollow users
329
+ - `like.write` - Like/unlike tweets
330
+
331
+ **Additional:**
332
+ - `offline.access` - Long-lived refresh tokens
333
+
334
+ ## Command Aliases
335
+
336
+ The Twitter command group supports an alias for convenience:
337
+
338
+ ```bash
339
+ agentdev x tweet create --text "Using the x alias!"
340
+ ```
341
+
342
+ Both `agentdev twitter` and `agentdev x` work identically.
343
+
344
+ ## Notes
345
+
346
+ - All tweets are posted as the authenticated user
347
+ - Tweet IDs can be found in URLs: `twitter.com/user/status/<tweet-id>`
348
+ - Twitter URLs work for both twitter.com and x.com
349
+ - Deleted tweets cannot be recovered
350
+ - Rate limits reset every 15 minutes (for most endpoints)
351
+ - Character count includes URLs (which are shortened to ~23 chars)
352
+ - Media uploads coming in Phase 2
353
+ - Threads are created by replying to previous tweet in chain
354
+
355
+ ## Troubleshooting
356
+
357
+ ### "Duplicate tweet" Error
358
+
359
+ Twitter prevents posting identical content too frequently.
360
+
361
+ **Solutions:**
362
+ - Wait a few minutes before posting again
363
+ - Modify the tweet text slightly
364
+ - Add a timestamp or unique identifier
365
+
366
+ ### "Token expired" Error
367
+
368
+ OAuth tokens expire after a period of inactivity.
369
+
370
+ **Solution:**
371
+ - Visit /profile and reconnect Twitter account
372
+ - Tokens will refresh automatically going forward
373
+
374
+ ### "Insufficient permissions" Error
375
+
376
+ Your OAuth scopes may be outdated.
377
+
378
+ **Solution:**
379
+ - Disconnect Twitter at /profile
380
+ - Reconnect to grant updated scopes
381
+ - Try the command again
382
+
383
+ ### Tweet Not Appearing
384
+
385
+ Tweets may take a few seconds to propagate.
386
+
387
+ **Solutions:**
388
+ - Wait 10-30 seconds
389
+ - Check Twitter app/website directly
390
+ - Verify tweet wasn't caught by spam filters
391
+
392
+ ### Can't Find Tweet ID
393
+
394
+ Tweet IDs are in the URL.
395
+
396
+ **Example:**
397
+ ```
398
+ URL: https://twitter.com/user/status/1234567890
399
+ Tweet ID: 1234567890
400
+ ```
401
+
402
+ **Or use search:**
403
+ ```bash
404
+ agentdev twitter tweet search "your tweet text" --count 1
405
+ ```
406
+
407
+ ## Best Practices
408
+
409
+ ### Avoid Rate Limits
410
+ - Don't post more than 50 tweets in short succession
411
+ - Space out bulk operations (likes, follows)
412
+ - Cache timeline data instead of frequent fetches
413
+
414
+ ### Engagement
415
+ - Reply with value, not spam
416
+ - Like genuinely interesting content
417
+ - Only retweet what your followers would find useful
418
+ - Personalize connection requests
419
+
420
+ ### Content Quality
421
+ - Proofread before posting (no edit feature in API)
422
+ - Use threads for complex topics
423
+ - Include relevant hashtags (2-3 max)
424
+ - Add context to quote tweets
425
+
426
+ ### Safety
427
+ - Never share sensitive information
428
+ - Review tweets before posting
429
+ - Use `--confirm` flag for deletions
430
+ - Keep API tokens secure