Facebook uses hidden <input type="file"> elements that are triggered by stylized UI components. To automate video uploads using the agent-browser CLI, follow this workflow.
1. Identify the Hidden Input
Facebook often has multiple hidden file inputs for different media types. Use eval to find the one that accepts video formats (look for video/* or specific extensions like matroska/mp4).
agent-browser eval "Array.from(document.querySelectorAll('input[type=file]')).map(i => i.accept)"Navigate to the group or profile and click the "Write something..." or "Photo/video" button to open the post dialog.
agent-browser click "@e70" # Ref for 'Write something...'Use the upload command targeting the input's accept attribute. agent-browser can interact with these inputs even if they are visually hidden (0x0 size).
# Target the input that handles video formats
agent-browser upload "input[accept*='matroska']" your_video.mp4Facebook needs a few seconds to process the file and enable the "Post" button.
agent-browser wait 5000Once the video is attached, the "Post" button becomes active.
agent-browser fill "@e16" "Your caption goes here! 🚀"
agent-browser click "@e26" # The 'Post' buttonagent-browser open https://www.facebook.com/groups/your_group_id
agent-browser click @e70
agent-browser upload "input[accept*='matroska']" video.mp4
agent-browser wait 5000
agent-browser fill @e16 "Automated Post!"
agent-browser click @e26Generated by Gemini CLI using agent-browser.