feat(twitter): add --images flag to post command#666
feat(twitter): add --images flag to post command#666artshooter wants to merge 1 commit intojackwener:mainfrom
Conversation
Support attaching up to 4 images when posting tweets via `opencli twitter post "text" --images /path/a.png,/path/b.jpg`. Uses the existing CDP DOM.setFileInputFiles mechanism (page.setFileInput) to inject files into Twitter's file input. Includes proper file validation, graceful error handling for older extensions, and polling-based upload readiness detection instead of fixed delays. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
One concrete issue here: the new "wait for image upload" check is using the tweet button enabled state as the upload-complete signal, but That means So for a text+image tweet this can silently post the text without the images, or with only a partially finished upload, while still reporting success. I think the wait condition needs to watch an actual media-upload completion signal in the DOM, not the generic button enabled state. There also does not seem to be any test coverage for the new image path. The diff only changes |
Summary
--imagesoption totwitter postcommand, supporting up to 4 images (comma-separated paths)page.setFileInput()(CDPDOM.setFileInputFiles) to attach files to Twitter's file inputstatSyncchecks), graceful error handling for older extensions, and polling-based upload readiness detectionUsage
Test plan
npx tsc --noEmitpassesnpm testpasses (456 passed)🤖 Generated with Claude Code