planpo.st
FeaturesFor AI agentsRevenue trackingPlatformsPricingBlogSupport
Sign inStart free trial →
planpo.st

Social scheduling with revenue built in. One platform for creators and businesses who treat social as a growth engine.

Product

SchedulerFor creatorsFor agenciesCompare toolsAlternativesPricing

Channels

InstagramLinkedInX (Twitter)ThreadsFacebookYouTubeTikTokAll channels →

AI agents

MCP serverFor AI agentsClaude CodeCursorChatGPTGemini CLIAll agents →

Revenue

Revenue trackingRevenue attributionStripeShopifyRevenueCatAll integrations →

Resources

DocsMCP toolsAPI referenceBlogAboutSupportContactPrivacyTerms

Compare planpo.st

  • planpo.st vs Postiz
  • planpo.st vs Buffer
  • planpo.st vs Hootsuite
  • planpo.st vs Later
  • planpo.st vs Sprout Social
  • planpo.st vs SocialBee
  • planpo.st vs Planable
  • planpo.st vs Metricool
  • planpo.st vs Loomly
  • planpo.st vs Publer
  • planpo.st vs Post Bridge
  • planpo.st vs Mixpost
  • planpo.st vs Blotato
  • planpo.st vs Typefully
  • planpo.st vs RecurPost
  • planpo.st vs Post Planner
  • All comparisons →
  • Alternatives →
© 2026 planpo.st · all rights reservedstatus: ● all systems normal
  1. Home
  2. /AI agents
  3. /Codex CLI
  4. /YouTube
Codex CLI · YouTube

How to post to YouTube from Codex CLI

Codex CLI uploads the demo file from disk and fills the YouTube fields from the code it has been working in all session.

Start 7-day free trial →Codex CLI setup docs
On this pageStepsWhat worksSettingsPromptsLimitsRevenueFAQ

How do I post to YouTube from Codex CLI?

Add the planpo.st MCP server to Codex CLI, connect YouTube once in the dashboard, then ask. The first three steps are one-time.

  1. 1

    Create an API key and add planpo.st to Codex CLI

    Make a scoped key in planpo.st under Settings. Add a [mcp_servers.planpost] table to ~/.codex/config.toml, or run codex mcp add and answer the prompts. The hosted form reads the token from the environment variable named in bearer_token_env_var, so export PLANPOST_API_KEY in your shell first.

  2. 2

    Confirm the server is connected

    Start Codex and run /mcp to check that planpost is connected.

  3. 3

    Connect YouTube

    Connect the YouTube channel in the dashboard under Connections. planpo.st asks Google for upload and read access only, and get_connection_link gives the agent a URL for you to open.

  4. 4

    Know what the post needs

    A YouTube post needs one video. Set platformSettings.youtube.title, or the title is cut from the post text, and set privacyStatus if the video should not be public.

  5. 5

    Ask in your terminal

    Say what to post and when. Codex CLI finds the YouTube connection, creates the post, and tells you whether it was scheduled or kept as a draft, with the reason.

Hosted
[mcp_servers.planpost]
url = "https://mcp.planpo.st/mcp"
bearer_token_env_var = "PLANPOST_API_KEY"
Local
[mcp_servers.planpost]
command = "npx"
args = ["-y", "planpost-mcp"]

[mcp_servers.planpost.env]
PLANPOST_API_KEY = "pk_live_xxx"

Config location: ~/.codex/config.toml, or .codex/config.toml in a trusted project. Replace pk_live_xxx with your own key.

Hosted or local for Codex CLI?

For Codex CLI I would use hosted with bearer_token_env_var, since the config file then holds no secret and can be shared. Use local when you would sooner keep the key in the config file's env table than in your shell profile.

  • The hosted form reads the token from an environment variable rather than the file, so export PLANPOST_API_KEY in your shell.
  • `codex mcp add` does the same thing interactively if you would rather not edit TOML.

The full walkthrough is on the Codex CLI setup page.

What can Codex CLI do on YouTube?

It can upload a video or a Short with a title, description, tags, category, visibility and the made-for-kids flag. It cannot add the video to a playlist or publish anything that is not a video.

Video

One video file per post, with title up to 100 characters and description up to 5,000.

Short

60 s

postType "short". A vertical video of 60 seconds or less is treated as a Short without it. #Shorts is added to the title when it is not already there.

Visibility

public, unlisted or private through privacyStatus. Unlisted is handy for a link you send to a client before the real release.

Not available

limits

Playlists, because the connection has upload and read scopes only. Community posts and image posts.

YouTube needs a video file on every post, and Codex CLI can take it from disk: it calls upload_media for a presigned URL, PUTs the file there with a shell command, and passes the returned asset into create_post. Files already uploaded come back from list_media, ready to reuse.

Which settings does a YouTube post take?

YouTube reads the most settings of any network here, seven of them, and all are optional. Two deserve attention before the first upload: title, and privacyStatus, which defaults to public.

FieldAllowed valuesIf you leave it outWorth knowing
platformSettings.youtube.titleText, cut to 100 charactersThe post text, cut to 100 characters, then the file nameMissing returns the warning youtube_title_missing. The post is still scheduled.
platformSettings.youtube.descriptionText, cut to 5,000 charactersThe post textLinks in descriptions are clickable.
platformSettings.youtube.privacyStatus"public", "unlisted" or "private""public"The key is privacyStatus. A key called visibility is not read, and the video goes out public.
platformSettings.youtube.tagsArray of stringsNo tagsSent as given.
platformSettings.youtube.categoryIdA YouTube category ID as a string"22", People & BlogsScience & Technology is "28".
platformSettings.youtube.madeForKidstrue or falsefalseSent as the self-declared made-for-kids flag.
platformSettings.youtube.isShorttrue or falseSet from postType "short"Also true when the video is vertical and 60 seconds or less.
media, platformMedia.youtubeOne videoNone, requiredNo media saves the post as a draft with media_required, images only with video_required.

What do I type to post to YouTube from Codex CLI?

Plain requests work. Each example lists the tool calls Codex CLI makes in response.

1. Upload, unlisted first

You say

The video is at ./out/demo.mp4. Upload it to YouTube as unlisted for Tuesday 17:00, title "How the approval flow works", description from the README, tags planpost, mcp, scheduling.

Tool calls

upload_media({ filename: "demo.mp4", contentType: "video/mp4", size: <bytes> })
PUT <file> to the returned URL (shell)
create_post({ content: "<description text>", platformSettings: { youtube: { title: "How the approval flow works", privacyStatus: "unlisted", tags: ["planpost", "mcp", "scheduling"], categoryId: "28" } }, media: [<video>], connectionIds: ["<youtube id>"], schedule: "tuesday 17:00" })

One scheduled upload that will be unlisted. Leave privacyStatus out and the same call publishes it to everyone.

2. A Short

You say

The video is at ./out/demo.mp4. Schedule it as a YouTube Short for tomorrow 07:00, title "One prompt, seven networks".

Tool calls

upload_media({ filename: "demo.mp4", contentType: "video/mp4", size: <bytes> })
PUT <file> to the returned URL (shell)
create_post({ content: "<one line>", postType: "short", platformSettings: { youtube: { title: "One prompt, seven networks" } }, media: [<video>], connectionIds: ["<youtube id>"], schedule: "tomorrow 07:00" })

A scheduled Short. The published title reads "One prompt, seven networks #Shorts", because the tag is appended when missing.

3. A video rendered from a template

You say

Use the notes in TODO.md under Done. Pick the strongest line, render it with a quote video template in 9:16, and schedule the result to YouTube as a Short on Friday 12:00.

Tool calls

list_video_templates()
create_video({ templateId: "<quote template>", fields: { quoteText: "..." }, aspectRatio: "9:16" })
get_video_status({ id: "<render id>" })
create_post({ content: "<caption>", postType: "short", platformSettings: { youtube: { title: "<title>" } }, media: [<rendered video>], connectionIds: ["<youtube id>"], schedule: "friday 12:00" })

A rendered vertical video and a scheduled Short, with no camera and no file on your side. The agent polls get_video_status until the render reports completed.

What stops a YouTube post from Codex CLI?

The tag on a card is the code that comes back in the tool result.

Public unless you say otherwise

privacyStatus defaults to public. If the plan is to review the upload first, say unlisted or private in the prompt.

Video only, one file

video_required

The first attachment must be a video. A post with only images is saved as a draft.

Titles stop at 100 characters

youtube_title_missing

Longer titles are cut. With no title, the post text is used and cut the same way, which rarely reads like a title.

#Shorts is added for you

On a Short the tag is appended to the title, and the title is trimmed to make room inside the 100.

No playlists

Adding to a playlist needs a broader Google scope than planpo.st requests. Do that step in YouTube Studio.

Language is sent as English

The upload sets the default language to en. For a channel in another language, correct it in YouTube Studio after publishing.

The token comes from your shell

Codex CLI

The hosted config names an environment variable, it does not hold the key. If PLANPOST_API_KEY is not exported in the shell that starts Codex, every call fails with an authorization error.

Can Codex CLI tell me what a YouTube post earned?

Yes, through the description. Links in a YouTube description are clickable, so a tracked link there gives clicks that payments are matched to, and a video keeps being found for months. get_revenue_overview returns totals and recent transactions. App makers who publish demos usually read this next to RevenueCat.

RevenueCat integration How revenue attribution works

Codex CLI and YouTube: questions people ask

Will the video be public as soon as it publishes?
Yes, unless platformSettings.youtube.privacyStatus says "unlisted" or "private". The default is "public".
How does it decide a video is a Short?
postType "short" makes it one. So does a vertical video of 60 seconds or less. Either way #Shorts is added to the title.
What happens when Codex CLI sends a YouTube post that breaks a rule?
It is told at once. The usual case on YouTube is a post with images and no video: the post is kept as a draft and the tool result carries video_required plus the fix, which Codex CLI applies with update_post.
Where does the config go?
In ~/.codex/config.toml, or .codex/config.toml in a trusted project. It is TOML, not JSON, which trips people who paste a snippet from another client. Once it loads, the YouTube tools are available in every session.
Does the key have to be in the file?
Not for the hosted server. bearer_token_env_var names a variable and Codex reads the key from your environment, so the file can be shared. The local form puts it under [mcp_servers.planpost.env]. Neither choice changes what you can post to YouTube.

Keep going

YouTube from other agents

Claude Code to YouTubeCursor to YouTubeClaude Desktop to YouTubeChatGPT to YouTubeGemini CLI to YouTubeGoogle Antigravity to YouTubeHermes Agent to YouTube

Other networks from Codex CLI

Codex CLI to ThreadsCodex CLI to LinkedInCodex CLI to InstagramCodex CLI to XCodex CLI to FacebookCodex CLI to TikTok

Background

Codex CLI overviewCodex CLI setupYouTube scheduling guideMCP tool reference