# Codex social media automation

Install the `@genviral/cli` npm package so Codex can shell out to `genviral` from the CLI, IDE extension, desktop app, or Codex Cloud, then scope one API key per workspace. Codex runs `genviral` commands, or its scripted `codex exec` mode, to generate slideshows, images, and video, then schedule and publish across 10 connected platforms.

## What Codex owns

Codex is great at planning, parallel tasks, and running shell commands. Genviral is the only shell command its social workflow needs.

- 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.

## What Genviral executes for Codex

Genviral is the execution layer Codex calls into over one CLI, no separate model or platform wiring.

- Connected social accounts: TikTok, Instagram, YouTube, Pinterest, LinkedIn, Facebook, X, Bluesky, Mastodon, and Telegram 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 in five steps

Each step links to the real surface in the Genviral dashboard. Run them once, then let Codex compose the rest.

- 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.
- 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.
- Connect your social accounts in Genviral. Connect TikTok, Instagram, YouTube, Pinterest, LinkedIn, Facebook, X, Bluesky, Mastodon, and Telegram once in the dashboard. Codex never touches OAuth — it just calls `genviral accounts` and uses the IDs.
- 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.
- 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.

## Recurring Codex workflows by platform

Each workflow follows the same loop: Codex composes the command, Genviral renders and publishes, analytics feeds the next run.

- TikTok: Daily slideshows from a fixed format. Codex generates a 4-slide carousel from the day's trend brief, drafts it as a MEDIA_UPLOAD post, and stops for review before publishing.
- Pinterest: Recurring infographic pins. Cron-runs Codex every 8 hours: it pulls a recipe, generates an infographic, and ships the pin to a chosen board via `pinterest.board_id`.
- YouTube: Shorts from a shared queue. Codex picks the next approved Short from your queue folder, fills `settings.youtube` from metadata, and publishes on the schedule you set in cron.
- Instagram: Reels from an approved media folder. Codex watches your Genviral Media Library folder; new uploads get captioned, hashtagged, and queued without ever leaving the approval pipeline.
- LinkedIn: Posts from release notes & drafts. Codex summarizes this week's engineering output, voice-matches against `brand-voice.md`, and publishes under the company page on a weekly cron.
- Facebook: Cross-post filler for brand-page trust. Codex mirrors the day's TikTok onto the Facebook page 30 minutes later, keeping the brand page warm so paid traffic and approvals stay healthy.

## Why Codex still needs an API layer

You could wire Codex into every platform's API yourself. In practice that is slow and breaks often.

- Meta and TikTok partner approvals can take months -> Genviral fronts those approvals so Codex posts on day one
- Every platform has its own auth, post settings, and quirks -> One endpoint per concept; Genviral maps it per platform
- AI assets need separate model providers and plumbing -> Genviral's AI Studio ships slideshows, images, and video in-API
- Scaling to many accounts gets you shadowbanned and locked out -> Hosted, pre-warmed accounts keep posting reliable past the early stage

## 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, Bluesky, Mastodon, and Telegram. 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.

---

Canonical HTML: https://www.genviral.io/codex
