Codex social media automation
Use OpenAI Codex as your control layer. Genviral handles the connected accounts, AI media, scheduling, publishing, and the analytics that feed the next batch.
- Codex owns planning, code, and parallel terminal tasks
- Genviral publishes to 8 platforms from one API key
- One npm install + one API key — no MCP server to operate
CLI runs anywhere Node 20.19+ runs · @genviral/cli on npm
# Install Codex and Genviral$ npm i -g @openai/codex @genviral/cli# Scope a key to one workspace$ export GENVIRAL_API_KEY="public_id.secret"# Have Codex draft your first post$ codex exec "draft a TikTok post about today's top trend"
Two layers
Codex reasons. Genviral executes.
Codex is great at planning, parallel tasks, and running shell commands. Genviral is great at being the only shell command your social workflow needs.
Codex owns
CLI, IDE, app, or cloud
Codex ships as a CLI, IDE extension, desktop app, and a cloud environment — plus GitHub, Slack, and Linear integrations. The same `genviral` shell call works from every surface.
Parallel subagents
Codex can fan a job out across sandboxed subagents and Codex Cloud tasks. Run one task per account or one per platform without stomping local state.
Project-aware via AGENTS.md
Drop conventions, prompts, and standing rules into AGENTS.md and Codex obeys them across runs — the same place you describe your Genviral defaults.
Scripted via codex exec & GH Action
Codex doesn't own scheduling, but `codex exec` and the official GitHub Action are the recurring units. Wire them into cron, Actions, or any runner you already operate.
Genviral owns
Connected social accounts
TikTok, Instagram, YouTube, Pinterest, LinkedIn, Facebook, X, and Bluesky behind one API key — no Meta or TikTok partner approval wait.
AI media generation
Slideshows, images, and videos rendered through Genviral's AI Studio. No separate model wiring — Codex calls one endpoint and gets a finished asset.
Cross-platform scheduling
One queue, every platform. Idempotent posting via `external_id`, retry-safe drafts, and per-account cooldowns Codex can drive from one endpoint.
Analytics feedback loop
Genviral feeds last-30-day performance back to Codex so the next batch rewrites hooks against whichever format actually outperformed.
Setup
From zero to a sample post in 5 steps
Each step links to the real surface in your dashboard. Run them once, then let Codex compose the rest.
- 01Step 1 of 5
Install the Genviral CLI
The npm package publishes the `genviral` binary that Codex shells out to. Codex reasons, then runs shell commands — Genviral is the command surface for everything social.
View on npmInstall once, globally
- 02Step 2 of 5
Create a scoped API key
Create one key per workspace Codex is allowed to drive. Drop it into `GENVIRAL_API_KEY` in your shell or your project's `.env` so Codex inherits it on every run.
Create API keySet the key once for your shell
- 03Step 3 of 5
Connect your social accounts in Genviral
Connect TikTok, Instagram, YouTube, Pinterest, LinkedIn, Facebook, X, and Bluesky once in the dashboard. Codex never touches OAuth — it just calls `genviral accounts` and uses the IDs.
Connect accountsConfirm Codex can see your accounts
- 04Step 4 of 5
Drop the skill into Codex's skills folder (optional)
The Genviral skill ships an opinionated `SKILL.md`, slideshow workflow, and a feedback loop tuned for social. Codex auto-loads it when it lives under `~/.codex/skills/`. Skip this step to use the CLI directly.
View the skill on GitHubClone the skill into Codex's skills directory
- 05Step 5 of 5
Ask Codex to run one sample post
Have Codex generate one slideshow, render it, and create the post. Review caption, slides, and account before you wire it into a recurring task. Use `codex` for an interactive TUI or `codex exec` for one-shot, scriptable runs.
Read related guidesOne-shot, scriptable invocation
Use cases
Six recurring Codex workflows
Each one follows the same loop: Codex composes the command, Genviral renders and publishes, analytics feeds the next run.
TikTok
Daily slideshows from a fixed format
Pinterest
Recurring infographic pins
YouTube
Shorts from a shared queue
Instagram
Reels from an approved media folder
LinkedIn
Posts from release notes & drafts
Facebook
Cross-post filler for brand-page trust
Why an API layer
Codex still needs a real execution surface
You could wire Codex into every platform's API yourself. In practice that's slow and breaks often. Here's the comparison.
Wire it yourself
Meta and TikTok partner approvals can take months
Every platform has its own auth, post settings, and quirks
AI assets need separate model providers and plumbing
Scaling to many accounts gets you shadowbanned and locked out
Genviral does this
Genviral fronts those approvals so Codex posts on day one
One endpoint per concept; Genviral maps it per platform
Genviral's AI Studio ships slideshows, images, and video in-API
Hosted, pre-warmed accounts keep posting reliable past the early stage
Guides
What to read before you wire this up
The developer surfaces are the source of truth. Each link is one of the integration points Codex calls under the hood.
- Read guide
All Genviral developer surfaces
Side-by-side of the REST API, the CLI, the agent skill, and the hosted accounts add-on. Pick the integration that matches your runtime.
- Read guide
Genviral Partner API reference
Full request/response shapes for every endpoint Codex will call. `create-post`, `slideshows/*`, `analytics/*`, and the Studio routes are the high-traffic ones.
- Read guide
Hermes Agent + Genviral
The hosted-agent variant: same API surface, but Hermes owns memory and cron natively instead of you wiring them in CI.
- Read guide
OpenClaw social media skill
The same skill Codex uses, packaged for OpenClaw runtimes. Useful if you want a continuous, self-improving agent loop.
FAQ
Codex social media questions
The details teams ask before handing recurring social workflows to a coding agent.
What is Codex?
Codex is OpenAI's coding agent. It runs as a CLI, an IDE extension (VS Code, JetBrains), a desktop app, in Codex Cloud, and through GitHub, Slack, and Linear integrations. It plans multi-step tasks, runs shell commands inside a sandbox, and reads stdout back into its reasoning. Codex access is included with ChatGPT Plus, Pro, Business, Edu, and Enterprise plans. That same shell-out behavior is exactly how it drives Genviral — by calling the `genviral` binary.
How does Codex post to social media?
Codex itself doesn't ship with platform connectors. You give it the `@genviral/cli` package and an API key. Codex then runs `genviral` shell commands for accounts, slideshows, posts, analytics, and trends — Genviral handles auth, rendering, scheduling, and publishing to every supported network. The same setup works from the Codex CLI, IDE extension, desktop app, or Codex Cloud.
Do I need the Genviral skill, or just the CLI?
Either works. The CLI alone is enough for one-off tasks or simple scripts. The skill (cloned into `~/.codex/skills/genviral/`) ships an opinionated SKILL.md, slideshow workflow, and feedback loop that Codex auto-loads alongside its other skills, plugins, and subagents — useful once you have a recurring strategy.
Which platforms can Codex post to through Genviral?
TikTok, Instagram, YouTube, Pinterest, LinkedIn, Facebook, X, and Bluesky. Analytics coverage is strongest for TikTok, Instagram, and YouTube. Codex publishes from your connected accounts via one API key — no Meta or TikTok partner approval wait.
Can Codex run on a schedule?
Codex itself is invoked on demand, but `codex exec` (non-interactive) and the official Codex GitHub Action are the schedulable units. Wire them into cron, systemd, or Actions and Codex can be the one composing each batch on its scheduled run. For built-in scheduling without your own runner, see the Hermes Agent integration.
Does this need an MCP server?
No. Codex supports MCP natively, but Genviral doesn't require it — Codex calls the `genviral` binary directly over the shell, the same way it runs `git` or `jq`. One less process to keep alive, and no MCP-specific wire format to maintain. If you already operate an MCP server, the CLI still works alongside it.
What approval mode should I use for posting?
Start with Codex's default approval mode: review every command before it runs. Use draft destinations (TikTok MEDIA_UPLOAD, YouTube unlisted, Instagram private) for the first runs. Only graduate to higher-autonomy modes — including `--dangerously-bypass-approvals` — after you've watched Codex draft a few posts end-to-end without surprises.
Get started
Give Codex a real social media backend
Connect your accounts, scope an API key, and let Codex drive a CLI built for generated content, scheduled posts, teams, and analytics.