← Back to blog

Post to X and Bluesky at the Same Time Every Morning With Codex

·post to X and Blueskycross-post X BlueskyCodex scheduled taskssocial media automationAI agent

Post to X and Bluesky at the Same Time Every Morning With Codex

If you post to X and Bluesky, you already know the routine: write a thought, paste it into one site, paste it into the other, fix whatever the second one complains about, and check later that both actually went out. It takes two minutes, which is exactly why it gets skipped on busy mornings.

This recipe hands that routine to Codex. You keep one running list of post ideas. Every weekday at 9 am, Codex takes the next idea, writes a version for each site, publishes both, and logs the links. When you’re done you’ll have:

Setup takes about 20 minutes (longer if you need to install Node.js), most of it signing in to your accounts.

Before you start, two things this recipe assumes. It’s a publishing recipe, not a deep dive into Codex internals: posts go out through the PublishPort desktop app, which you install and sign in to X and Bluesky. And because the posts leave from your own machine and your own signed-in accounts, the computer has to be on at 9 am. If that doesn’t describe you, or several people share the account, skip to the cloud-AI option under Variations.

The recipe

Keep this sentence handy; you’ll paste it into Codex in step 2:

Read https://www.publishport.app/skill.md and follow it to set up PublishPort for me, then treat posts.md in this folder as my queue of post ideas: take the first idea that isn't marked done, write one version for X (280 characters or fewer) and one for Bluesky (300 characters or fewer), show me both, and post them to my X and Bluesky accounts once I approve; after that works, create a scheduled task that does the same every weekday at 9 am without asking, marks the idea done, and appends both links to log.md.

That one message gets Codex to install the publishing skill, ask you for a single authorization click, run a supervised test post to both sites, and create the weekday task. The skill file is a short public instruction sheet you can read first: it tells Codex how to sign in, check which accounts are connected, publish, and confirm the post is live. Every AI you’ve authorized is listed on your account page, where you can revoke it any time.

Step 0: Get three things ready

1. The ChatGPT desktop app (Codex lives inside it). Install it from OpenAI’s download page and sign in. Scheduled tasks are created and managed in the desktop app or on the web; per OpenAI’s docs, the Codex CLI and IDE extension don’t have the Scheduled interface. Web tasks also can’t work in a folder on your computer, so use the desktop app for this recipe.

2. The PublishPort desktop app, signed in to X and Bluesky. Install it from the download page, open Platform accounts, click Sign in on X and on Bluesky, sign in the way you normally do in the browser window that opens, then click I’ve signed in. Once both show Signed in you’re set (walkthrough). Codex publishes through those sessions, so you don’t create developer keys or API tokens for either site. The trade-off is that publishing runs through PublishPort rather than your own API code.

3. Node.js and a posts.md file. The publishing command runs on Node.js. Not sure you have it? Ask Codex to run node -v; if nothing comes back, install the LTS release from nodejs.org. Then create a folder called social, and inside it a file posts.md with one idea per line, rough is fine:

- Tip: batch your replies once a day instead of checking all day
- Lesson from this week: shorter posts got more replies than threads
- Behind the scenes: how I plan a week of content in 20 minutes

You don’t need polished copy. Codex turns each line into a post for each site, and the quality of your ideas matters more than the polish. Stock 10 to 15 lines to start so the first few weeks run without you touching it.

Step 1: Open the folder in Codex

Open the ChatGPT desktop app, switch to Codex, and open the social folder as your workspace. It doesn’t need to be a Git repository: OpenAI’s docs note that in non-version-controlled projects, scheduled tasks run directly in the project directory, which is what we want.

Step 2: Paste the recipe and approve once

Send the recipe. Here’s what happens next:

  1. Codex reads the instructions and installs the PublishPort skill, so future chats already know how to publish.
  2. It runs the login command and gives you an authorization link and a confirmation code. Open the link, sign in or create a PublishPort account, check that the code matches, and click Authorize. The link is valid for 10 minutes; ask for a new one if it expires.
  3. It checks your computer and accounts and reports that X and Bluesky are ready.
  4. It takes the first idea and shows you the X version and the Bluesky version side by side. Edit freely (“less formal on Bluesky”), then reply “post it”.
  5. Both posts go out; Codex shows you the links and writes them to log.md, then marks the idea done in posts.md.

Codex will ask you to approve a few commands along the way. That’s its default safety behavior; approve them while you’re watching.

Open both links and look. This is the moment to catch anything you’d want different in every future post: how a link in the text renders on Bluesky, whether the line breaks survived, whether the tone is right on each site. If something’s off, tell Codex now and ask it to remember the rule in the task prompt in step 4.

Why one idea becomes two posts

X and Bluesky look alike but differ in the details that make a copy-pasted post fail, which is why the recipe asks for two versions instead of one:

Bluesky’s command can also set a language tag on each post (--langs en), which helps people filtering by language find you.

Step 3: Let the scheduled task reach the network (once)

This is the one fiddly step, and a single message handles it. Skip it and the 9 am run fails at the first publish with a network error. Scheduled tasks run unattended with your default sandbox settings (OpenAI docs). The default workspace-write sandbox blocks network access, and every publish needs the network.

OpenAI’s answer is rules: allow one command prefix outside the sandbox instead of opening everything up. The easy way, and the one to use, is to let Codex do it; send this in the same chat, approve what it asks, then restart the app:

Install the publishport CLI globally with npm, then add a rule to ~/.codex/rules/default.rules that allows commands starting with "publishport" to run outside the sandbox. Tell me when to restart the app.

If you’d rather do it by hand (you don’t have to):

  1. Install the publishing command globally:

    npm install -g publishport
  2. Open (or create) .codex/rules/default.rules in your home folder and add:

    prefix_rule(
        pattern = ["publishport"],
        decision = "allow",
        justification = "PublishPort publishing needs network access",
    )
  3. Quit and reopen the ChatGPT desktop app so the rule loads.

Only commands that start with publishport run outside the sandbox; everything else stays restricted.

Step 4: Check the scheduled task

The recipe already asked Codex to create the task. Open Scheduled in the sidebar and you should see a weekday 9 am task on the social folder.

If it isn’t there, or you’d rather build it yourself, create a standalone task in Scheduled (each run starts fresh from the saved prompt), choose the social project, set it to weekdays at 9 am, and paste this prompt:

This is a pre-approved weekday publishing task. Follow these rules and publish without asking me to confirm.

1. Open posts.md and take the first idea not marked done. If there is none, stop and tell me the list is empty.
2. Write one post for X (280 characters or fewer, punchy, at most one hashtag) and one for Bluesky (300 characters or fewer, conversational, no hashtags). Check the publishport guide for each platform for the current options before publishing.
3. Publish to X, then to Bluesky, using the publishport command (installed globally).
4. If either command errors or times out, don't re-run it. Look at that account's latest posts first; retry once only if the post really isn't there. If it still fails, skip that site and say why in the summary.
5. Mark the idea done in posts.md, append both links and the time to log.md, then give me a one-line summary.

Each scheduled run starts cold from this saved prompt, and PublishPort’s instructions tell an AI to show a person the content before its first post in a session. Nobody is watching at 9 am, so the approval has to be written into the prompt itself.

OpenAI recommends testing a prompt by hand before scheduling it and reviewing the first few runs. You did the manual test in step 2, so tomorrow at 9 just open Scheduled and read the run; the log file gives you both links.

Variations

If something doesn’t run

Where to take it next

Once posts go out on their own, replies are the next thing to pile up; AI auto-replies to DMs and comments covers how to decide what the AI answers and what it hands back to you.

The free plan covers setting all of this up; plan limits and pricing are on the pricing page.