Post to X from Codex
Codex can post to X (Twitter) through Postiz. Install the Postiz skill or add the Postiz MCP server to Codex, connect your X account in Postiz, then ask in plain English. Codex drafts the tweet or thread, uploads media, sets who can reply, targets an X Community if you want, and schedules it.
Please make sure there is always a human in the loop.
Last updated: September 2026
How do I post to X from Codex?
Set up Codex once with the Postiz skill or the Postiz MCP server, connect X in Postiz, then ask. The whole setup takes a few minutes.
Setup, then just ask
# One-time setup, option A: Postiz skill + CLI
npx skills add gitroomhq/postiz-agent
export POSTIZ_API_KEY=your_api_key # or: postiz auth:login
# One-time setup, option B: Postiz MCP server (OAuth, no key)
codex mcp add postiz --url https://mcp.postiz.com/mcp-oauth-dynamic
codex mcp login postiz
# Then just ask Codex:
> Post a thread about our launch on X,
schedule it for tomorrow at 9am
Codex: Done! Your X post is scheduled.X-Specific Features
Reply Controls
Control who can reply to your posts: everyone, people you follow, mentioned users, subscribers, or verified accounts only.
Thread Support
Ask for a thread and Codex splits it into separate tweets, posted in order.
Community Posting
Post directly to X Communities by providing a community URL. Reach targeted audiences with relevant content.
Simple Text Posts
Quickly publish text-only tweets with hashtags, mentions, and links. No media upload required for basic posts.
Media Attachments
Attach images or videos to your posts. Upload media through Postiz and include it seamlessly in your scheduled tweets.
Scheduled Posting
Schedule posts with precise timestamps. Queue up a week of content in minutes and let Postiz handle the publishing.
How does Codex post to X?
You describe what you want in plain language and Codex handles the Postiz calls for you. Here is how a typical conversation goes.
Find Your X Integration
Ask Codex whether your X account is connected. It also checks which options the platform supports.
Example conversation
> Is my X account connected to Postiz?
Codex: Yes — your X account is connected
and ready. Want me to post something?Compose Your Content
Describe your tweet or thread. Ask for a thread and Codex splits it into separate tweets; mention an image or video and it uploads it for you.
Example conversation
> Draft an X post about our new
feature launch
Codex: Here's a draft for X:
"We just shipped something big..."
Want me to add media and schedule it?Schedule & Publish
Schedule your post for a specific time or publish immediately. Set reply controls and optionally target an X Community.
Example conversation
> Yes — add screenshot.png and schedule
it for tomorrow at 9am
Codex: Done! Scheduled on X for
tomorrow at 9:00 AM.X Settings Reference
Mention any of these in plain language and Codex sets them for you. These are the X options it can apply to any post.
| Field | Type | Description |
|---|---|---|
__type | string | Must be "x" |
who_can_reply_post | string | Who can reply: everyone, following, mentionedUsers, subscribers, verified |
community | string | X Community URL to post into |
Common Configurations
Ask Codex for any of these common X scenarios and it applies the matching settings.
Public Post — Everyone Can Reply
Just ask
> Post it with: Public Post — Everyone Can Reply
Codex: Got it. Applying:
who_can_reply_post: everyoneFollowers Only Replies
Just ask
> Post it with: Followers Only Replies
Codex: Got it. Applying:
who_can_reply_post: followingCommunity Post with Verified Replies
Just ask
> Post it with: Community Post with Verified Replies
Codex: Got it. Applying:
who_can_reply_post: verified
community: https://x.com/i/communities/1234567890Mentioned Users Only
Just ask
> Post it with: Mentioned Users Only
Codex: Got it. Applying:
who_can_reply_post: mentionedUsersWhat is Codex?
Codex is OpenAI's coding agent. It runs as the Codex CLI in your terminal (npm install -g @openai/codex), as an IDE extension, and in the cloud, and it can run shell commands and call MCP servers, which is how it drives Postiz. Codex is not ChatGPT: ChatGPT is the chat assistant on chatgpt.com and connects to Postiz differently (see the ChatGPT guide). For the full setup, start at the Codex + Postiz hub.
Terminal & IDE Native
Codex runs in your terminal or IDE. You type what you want in plain English and it handles Postiz for you — no extra configuration needed.
Autonomous Execution
Codex runs commands inside a sandbox with approval rules you control, and works through multi-step tasks like discovering channels, uploading media, and scheduling X posts.
Parallel Tasks
Run multiple Codex tasks simultaneously. Schedule posts to different platforms in parallel while Codex handles other coding work.
How Postiz Works with Codex
Codex discovers Postiz two ways: the postiz skill, which it loads from .agents/skills or ~/.agents/skills and which you can invoke with $postiz, or the Postiz MCP server added with codex mcp add. Either way it learns the available tools and chains them for X workflows.
- ✓Install the Postiz skill with npx skills add, or add the Postiz MCP server with codex mcp add
- ✓Codex loads skills from .agents/skills and reads SKILL.md to learn the Postiz CLI
- ✓Authenticate with POSTIZ_API_KEY or postiz auth:login; the MCP route uses OAuth instead
- ✓Codex runs commands in its sandbox and asks for approval based on your permission settings
- ✓Works alongside your coding tasks in parallel
Install Postiz
# Install the Postiz skill
npx skills add gitroomhq/postiz-agent
# Set your API key
export POSTIZ_API_KEY=your_api_key
# Or add the Postiz MCP server instead (OAuth, no API key)
codex mcp add postiz --url https://mcp.postiz.com/mcp-oauth-dynamic
codex mcp login postiz
# Then ask, interactively or headless
codex "list my social media integrations"
codex exec "post today's changelog to X"X Posting with Codex
Tell Codex what to post from your terminal or IDE — it discovers your integrations via Postiz and handles the entire publishing workflow.
Just Ask Codex
Terminal and IDE integration
Tell Codex what to post from your terminal or IDE — it discovers your integrations via Postiz and handles the entire publishing workflow.
Codex CLI
$ codex "Post to X about our
new feature launch, schedule for
tomorrow at 9am"
Codex: I'll handle that.
Found your X integration.
Composing and scheduling the post.
Done! Your post is scheduled.
Post ID: abc-123Parallel Tasks
Multiple tasks at once
Codex can handle multiple tasks in parallel. Schedule posts to different platforms while it works on other coding tasks simultaneously.
Codex Parallel Tasks
# Run multiple posting tasks in parallel
$ codex "Schedule a post about our
launch to X for tomorrow 9am" &
$ codex "Write a LinkedIn article
about our new feature and schedule
for tomorrow noon" &
$ codex "Fix the bug in auth.ts"
# All three tasks run simultaneouslyWhy Codex + Postiz for X
Codex's autonomous execution makes Postiz a natural fit. The agent reads the SKILL.md to understand every available command, then autonomously chains them together for X workflows.
- ✓Runs in your terminal or IDE — just type what you want
- ✓Autonomous execution in sandboxed environments
- ✓Parallel task support — post while coding
- ✓Reads SKILL.md for automatic command discovery
- ✓Cross-post to X + other platforms in a single session
- ✓Powered by OpenAI's most capable models
SKILL.md (loaded by Codex from .agents/skills)
---
name: postiz
description: Social media automation
CLI for scheduling posts across
30+ platforms including X
homepage: https://docs.postiz.com/public-api/introduction
---
# Loaded by Codex from .agents/skills
# Invoke explicitly with $postiz
# Available Commands
- postiz integrations:list
- postiz integrations:settings <id>
- postiz posts:create
- postiz upload <file>
- postiz analytics:platform <id>
# X Settings
who_can_reply_post, communityAlso Works with Claude Code
Postiz works with any AI agent that can run commands or call MCP tools — you ask, the agent does the work. That includes Anthropic's Claude Code: see the Claude Code X guide, or the Postiz Agent page for any other agent.
Claude Code
by Anthropic
Claude reads the Postiz skill so it knows what it can do, then autonomously discovers your X integration, composes your tweet or thread, applies reply settings, and schedules the post.
Claude Code
> Post a thread about our product launch
on X, schedule for tomorrow, everyone
can reply
Claude: Done! Scheduled on X for
tomorrow at 9:00 AM.Can Codex post to X and other platforms at once?
Schedule the same content to X and other platforms in a single request. Each platform gets its own settings.
Example
> Post "Excited to announce our new feature!" to
X and LinkedIn tomorrow at 9am, then schedule
a daily tip on X every weekday at 10am
Codex: Done! Scheduled:
- X + LinkedIn: tomorrow 9:00 AM
- Daily tips on X: Mon-Fri 10:00 AMReply Options
Everyone
everyoneFollowing
followingMentioned Users
mentionedUsersSubscribers
subscribersVerified
verifiedWhat can I ask Codex to post on X?
Codex takes plain-English prompts in an interactive session, as a one-off codex exec command, or through the $postiz skill. These are the kinds of prompts people type for X.
Prompts for X
> Post a 5-tweet thread on X summarizing CHANGELOG.md for
the last release, schedule for tomorrow 9am, everyone can reply
$ codex exec "Tweet today's top commit message from this repo on X
with the screenshot in ./assets/demo.png"
> $postiz Post this to our X Community
https://x.com/i/communities/123, replies from verified accounts onlyWhat X rules should Codex follow?
These are the X limits and required settings Postiz enforces. Codex reads them from postiz integrations:settings, and you can mention any of them in your prompt.
- ✓Standard X accounts get 280 characters per post; longer posts need X Premium. Ask Codex to keep each tweet under the limit.
- ✓who_can_reply_post is required: everyone, following, mentionedUsers, subscribers, or verified. Codex fills it from your wording.
- ✓Ask for a thread and Codex splits the text into ordered tweets, each with its own optional media.
- ✓Images and video must go through postiz upload first; raw file paths and external URLs are rejected.
- ✓To post into an X Community, give the full community URL (x.com/i/communities/...) for the community setting.
Codex and X FAQ
How do I post to X from Codex?
Install the Postiz skill with npx skills add gitroomhq/postiz-agent, or add the Postiz MCP server with codex mcp add postiz --url https://mcp.postiz.com/mcp-oauth-dynamic. Connect X in Postiz once, then ask Codex in plain English what to post and when. Codex resolves the X settings, uploads any media, and schedules the post.
Can Codex control who replies to my X posts?
Yes. X lets you limit replies to everyone, accounts you follow, mentioned users, subscribers, or verified accounts. In Postiz this is the who_can_reply_post setting, which Codex fills when you say something like "only people I follow can reply". It applies per post, so each tweet in a campaign can differ.
Can Codex post threads to X?
Yes. Ask for a thread and Codex splits your content into ordered tweets, each with its own optional image or video, and Postiz publishes them as replies in sequence. Keep each tweet within the character limit; Codex will rewrite long sections if you ask it to keep every post under 280 characters.
Can Codex post to X on a schedule without me watching?
Yes. Postiz stores scheduled X posts and publishes them at the chosen time, so Codex does not need to stay open. For unattended runs, call codex exec with your prompt from a script or cron job. Keep a human reviewing the output, since Codex will publish exactly what it is told to publish.
Do I need a Postiz API key to post to X from Codex?
Not with the MCP route. Run codex mcp login postiz and Codex signs in to your Postiz account over OAuth, so it only reaches channels you already connected, including X. The CLI skill route needs either postiz auth:login or a POSTIZ_API_KEY environment variable. Your X login itself never leaves Postiz.
Is posting to X from Codex the same as posting from ChatGPT?
No. Codex is OpenAI's coding agent for your terminal and IDE, and it reaches Postiz through the Postiz skill or MCP server. ChatGPT is the chat assistant on chatgpt.com, which connects to Postiz as an app or custom MCP connector. Both can publish to X; see the ChatGPT guide for that setup.
Related Codex and X guides
Start at the Codex hub for setup, or jump to another platform Codex can post to through Postiz.
Codex + Postiz overview
→Setup, skill vs MCP comparison, codex exec automation, and FAQ for OpenAI Codex.
Post to LinkedIn from Codex
→LinkedIn settings, prompts, and rules for Codex.
Post to Facebook from Codex
→Facebook settings, prompts, and rules for Codex.
Post to Reddit from Codex
→Reddit settings, prompts, and rules for Codex.
Post to Warpcast from Codex
→Warpcast settings, prompts, and rules for Codex.
X channel on Postiz
→How Postiz connects to X, features, and setup outside of any agent.
Postiz MCP server
→The OAuth MCP endpoint Codex, ChatGPT, Claude, and Cursor can all connect to.
Postiz Agent CLI
→The postiz CLI and skill that any AI agent can drive from a shell.
Post to social media from ChatGPT
→The chat-app route, for when you are not in a terminal.
Postiz pricing
→7-day free trial, with MCP, CLI and API access on every plan.
Start posting to X
Install Postiz Agent and automate your X content strategy with AI-powered scheduling and publishing.