OpenParable
Skip to content
← Back to skills

Post To X

Apps & Automation
post-to-x

Post To X is an Agent Skill for apps & automation published in the AIDotNet/OpenCowork repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Post tweets to X.com (Twitter) using the system browser's login state

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/AIDotNet/OpenCowork/blob/HEAD/resources/skills/post-to-x/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/post-to-x, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

Post to X

Automatically post tweets to X.com (Twitter) using the system Edge/Chrome browser's login state.

Features

  • Automatic login state reuse - Directly uses system browser user data, no need to log in each time
  • Smart login detection - Automatically detects login status, prompts user if not logged in
  • Multi-line content support - Can post tweets containing line breaks
  • Edge/Chrome compatible - Prefers Edge, falls back to Chrome

Prerequisites

pip install playwright
playwright install chromium

Usage

Basic usage

python scripts/post_to_x.py "Your tweet content"

Multi-line content

python scripts/post_to_x.py "First line\nSecond line\n#hashtag"

Examples

# Simple tweet
python scripts/post_to_x.py "Hello X! šŸ‘‹"

# Multi-line tweet
python scripts/post_to_x.py "šŸš€ New product launch!\n\n✨ Feature 1: xxx\n✨ Feature 2: yyy\n\n#ProductLaunch #NewFeature"

Workflow

  1. Close any running Edge/Chrome browser
  2. Script reads system browser user data directory
  3. Launches browser and navigates to x.com
  4. Detects login status (skips if already logged in)
  5. Opens the tweet compose interface
  6. Enters content and posts

First-time usage

If using for the first time:

  1. Close all Edge browser windows
  2. Run the script, it will prompt for login
  3. Log in to X.com in the pop-up browser
  4. After successful login, the script continues automatically
  5. Next time you use it, the login state is already saved, no need to log in again

Troubleshooting

IssueSolution
Prompts for login every timeClose Edge browser before running the script
Post button click failsScript automatically uses JavaScript click
Page load timeoutCheck network connection, or add --wait flag

Technical details

  • Uses Playwright to control Chromium
  • Directly reads %LOCALAPPDATA%\Microsoft\Edge\User Data
  • Login credentials are saved in the original browser data
  • Supports Windows systems