How to Automate Scheduled X Posts with Codex and xurl
Most social-media automation tutorials stop at “call the API on a cron job.” That works, but it leaves the hard questions unanswered. Which account is the automation using? How does it avoid posting the same story twice? What happens when an API request times out after X has already accepted the post? And where should an AI agent’s editorial freedom end? I recently built a scheduled X publishing…
To create a scheduled X publishing workflow with Codex and xurl, you'll need to follow several steps. First, set up an X developer application with read-and-write permissions using the X Developer Console. Configure user authentication settings, including app permissions, type, callback URI, website URL, and environment. After creating the application, obtain the OAuth 2.0 Client ID and Client Secret.
Next, install xurl using Homebrew on a Mac with access to Scheduled tasks. Verify that xurl is available and then create an X Developer Application using the xurl command. Save the credentials privately and authorize the account locally using the xurl auth oauth2 command. Replace "my_handle" with the handle of the X account you want to manage and authorize.
After verifying the setup, create a fixed-account Codex skill named "xurl-post" to own the deterministic write boundary. This skill will prevent the Codex AI agent from casually choosing an account or improvising the publishing command. Ensure that the Codex skill checks for duplicates in the account history, drafts the post, and publishes it according to the editorial policy.
Finally, set up a Codex scheduled task that researches, checks history, drafts, and publishes posts using the xurl command and the fixed-account skill.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.