Automate X with Codex
Schedule tweets, control reply permissions, post threads, and publish to X Communities โ all from the command line or through your AI agent.
Please make sure there is always a human in the loop.
Post to X in Seconds
Terminal
# Install the skill
npx skills add gitroomhq/postiz-agent
# Set your API key
export POSTIZ_API_KEY=your_api_key
# Find your X integration
postiz integrations:list
# Schedule a post on X
postiz posts:create \
-c "Hello world! #buildinpublic" \
-s "2025-01-15T09:00:00Z" \
--settings '{"who_can_reply_post":"everyone"}' \
-i "your-x-integration-id"
# Post a thread (multiple -c flags)
postiz posts:create \
-c "Thread time! Here's what I learned this week..." \
-c "1/ First, always ship small increments." \
-c "2/ Second, get feedback early and often." \
-c "3/ Third, automate everything you can." \
-s "2025-01-15T10:00:00Z" \
--settings '{"who_can_reply_post":"everyone"}' \
-i "your-x-integration-id"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
Create multi-tweet threads by passing multiple -c flags. Each flag becomes a separate tweet in the thread, 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 It Works
Find Your X Integration
List your connected accounts and grab your X integration ID. You can also fetch available settings to see what options are supported.
Discovery
# List all integrations
postiz integrations:list
# Filter for X
postiz integrations:list | jq \
'.[] | select(.identifier=="x")'
# Get X settings schema
postiz integrations:settings <x-id>Compose Your Content
Write your tweet or thread. Use multiple -c flags to create threads. Add media with the -m flag after uploading through Postiz.
Compose
# Simple tweet
postiz posts:create \
-c "Just shipped a new feature!" \
--settings '{"who_can_reply_post":"everyone"}' \
-i "x-id"
# Thread with multiple tweets
postiz posts:create \
-c "Big announcement incoming..." \
-c "We just hit 10k users!" \
-c "Here's what we learned along the way." \
--settings '{"who_can_reply_post":"everyone"}' \
-i "x-id"Schedule & Publish
Schedule your post for a specific time or publish immediately. Set reply controls and optionally target an X Community.
Post Creation
postiz posts:create \
-c "Check out our latest blog post!" \
-s "2025-03-01T09:00:00Z" \
--settings '{
"who_can_reply_post": "everyone",
"community": "https://x.com/i/communities/123"
}' \
-i "x-id"X Settings Reference
Every X post accepts these platform-specific settings via the --settings flag.
| 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
Copy-paste these settings for common X posting scenarios.
Public Post โ Everyone Can Reply
settings.json
{
"who_can_reply_post": "everyone"
}Followers Only Replies
settings.json
{
"who_can_reply_post": "following"
}Community Post with Verified Replies
settings.json
{
"who_can_reply_post": "verified",
"community": "https://x.com/i/communities/1234567890"
}Mentioned Users Only
settings.json
{
"who_can_reply_post": "mentionedUsers"
}What is Codex?
Codex is OpenAI's autonomous coding agent that handles software engineering tasks โ writing features, fixing bugs, and answering questions about your codebase. It works via CLI and IDE integrations, and can execute shell commands like Postiz.
CLI & IDE Native
Codex runs from your terminal or IDE. It executes shell commands directly, making Postiz integration seamless โ no extra configuration needed.
Autonomous Execution
Codex works in sandboxed cloud environments, autonomously running commands, reading output, and chaining multi-step workflows like social media posting.
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 when you install it globally. It reads the SKILL.md to understand available commands and can autonomously chain them for social media workflows.
- โInstall Postiz Agent globally with npx skills add
- โCodex reads the SKILL.md and learns all Postiz commands
- โPOSTIZ_API_KEY must be set in environment
- โCodex executes commands in sandboxed environments
- โ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
# Codex discovers Postiz commands
# from the SKILL.md automatically
codex "list my social media integrations"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.
CLI Workflow
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.
Running: postiz integrations:list
Found your X integration.
Running: postiz posts:create ...
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.
- โCLI-native โ runs from your terminal or IDE
- โ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 (auto-discovered)
---
name: postiz
description: Social media automation
CLI for scheduling posts across
30+ platforms including X
metadata:
codex:
requirements:
env:
- POSTIZ_API_KEY
binaries:
- 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 Agent works as a CLI tool with any AI agent that can execute shell commands โ including Anthropic's Claude Code.
Claude Code
by Anthropic
Claude reads the SKILL.md file to learn all available Postiz commands, 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 will automatically run:
postiz integrations:list
postiz posts:create \
-c "Big news! We just launched..." \
-c "Here's what makes it special..." \
-c "Try it out today at..." \
-s "2025-03-02T09:00:00Z" \
--settings '{"who_can_reply_post":
"everyone"}' \
-i "x-id"X + Other Platforms
Schedule the same content to X and other platforms in a single command. Each platform gets its own settings.
Terminal
# Post to X and LinkedIn simultaneously
postiz posts:create \
-c "Excited to announce our new feature! #buildinpublic" \
-s "2025-03-01T09:00:00Z" \
--settings '{"who_can_reply_post":"everyone"}' \
-i "x-id,linkedin-id"
# Batch schedule a week of X content
for day in 1 2 3 4 5; do
postiz posts:create \
-c "Day $day tip! #dailytips" \
-s "2025-03-0${day}T10:00:00Z" \
--settings '{"who_can_reply_post":"everyone"}' \
-i "x-id"
doneReply Options
Everyone
everyoneFollowing
followingMentioned Users
mentionedUsersSubscribers
subscribersVerified
verifiedStart posting to X
Install Postiz Agent and automate your X content strategy with AI-powered scheduling and publishing.
Ready to get started?
Grow your social media presence with Postiz.
Schedule, analyze, and engage with your audience.
Open-source social media scheduling tool