Run your social media from any AI agent with the SociaHive CLI.
If your agent can run a shell command, it can use SociaHive. The SociaHive CLI turns each action into one command and prints the result as JSON.
https://www.sociahive.com/api/mcpSociaHive CLI and SociaHive at a glance
- How it connects
- Shell commands that call SociaHive’s MCP server
- Sign-in
- SOCIAHIVE_API_KEY environment variable
- What you need
- A SociaHive trial or paid plan; Node 18.17 or newer
- Best for
- Agents with a shell, scripts, CI jobs and bulk uploads
- Not for
- Chat apps that can’t run commands; use the MCP server there
Set it up in SociaHive CLI.
Needs a SociaHive trial or paid plan.
Connect SociaHive to SociaHive CLI
Your server address
https://www.sociahive.com/api/mcpSociaHive CLI
Any terminal, or any agent that runs shell commands
- 1
Run npm install -g sociahive (Node 18.17 or newer).
- 2
In SociaHive, open Settings → API keys and make a key.
- 3
Run export SOCIAHIVE_API_KEY= with your key, in the shell your agent uses.
- 4
Optional: run npx skills add sociahive/sociahive-mcp so your agent knows the commands and when to use them.
Then: Run sociahive accounts list, or ask your agent to.
Install in SociaHive CLI
Install
Make a key in SociaHive: Settings → API keys.
npm install -g sociahive export SOCIAHIVE_API_KEY=sk_your-api-key
First commands
Each prints JSON your agent can read.
sociahive accounts list
sociahive calendar
sociahive posts create --text "We just shipped dark mode" \
--platforms '[{"platform":"linkedin"}]' --media-file shot.png \
--scheduled-at "tomorrow 9am"
sociahive insights --weeks 8
sociahive --helpSkill
Optional. Teaches agents like Claude Code, Codex and Cursor when to use each command.
npx skills add sociahive/sociahive-mcp
Things to ask first.
Copy one into a chat once you are connected.
Every account with the id the other commands need.
The files are uploaded and the carousel is queued.
What beat your average, with the number of posts behind each result.
What is the SociaHive CLI?
The SociaHive CLI is a command line tool, published on npm as sociahive, for scheduling and publishing posts, uploading media, reading analytics and managing automations. Each command calls one tool on SociaHive’s MCP server, so it can do what a connected AI app can do.
It is made for scripts and for AI agents that run shell commands: coding agents like Claude Code, Codex and Cursor, and self-hosted assistants that have a terminal. Results come back as JSON, which agents read easily.
Use it when your agent has a shell but no easy way to add an MCP server, or when a job involves local files. One command can upload a folder of images and schedule them to any of the 22 platforms SociaHive posts to.
Can SociaHive CLI post on a schedule?
The CLI does not run on a timer by itself. Pair it with whatever already does: cron, a CI schedule, or an agent with scheduled tasks.
Most of the time you don’t need that. sociahive posts create with --scheduled-at hands the time to SociaHive, and the post goes out then whether or not the agent is still running.
Everything SociaHive CLI can do in SociaHive.
Schedule posts
Write a post and queue it at your best time, on any account you connected.
Post right now
Publishes straight away, after you confirm in the chat.
See your calendar
Everything that is scheduled, across all your accounts.
Read your numbers
Reach, saves and engagement per post, and what to post more of.
Build DM automations
Describe it in one sentence. It builds the flow as a draft for you to turn on.
Check your automations
Which flows are live and how often each one fires.
Reuse what works
Save your best posts to an evergreen queue and reshare them later.
Move posts in bulk
Shift a whole day of posts in one go, keeping their times.
What SociaHive CLI gets: the SociaHive MCP server.
One address, https://www.sociahive.com/api/mcp. The same server works in every AI tool on this site.
MCP (Model Context Protocol) is the open standard AI tools use to reach outside apps. SociaHive runs a hosted MCP server, so there is nothing to install or keep running: SociaHive CLI calls it over the internet and acts in your SociaHive account. These are the tools it uses most. See every tool and the API.
| Tool | What it does |
|---|---|
| list_accounts | Lists the social accounts you connected to SociaHive. |
| create_scheduled_post | Writes a post, with text, images or video, for one or more accounts. |
| schedule_post | Queues a post at a time you pick or at your best time. |
| find_next_slot | Finds the next free slot in your posting schedule. |
| publish_post_now | Publishes straight away, after you confirm. |
| upload_media_from_url | Copies an image or video from a public link into your media. |
| get_scheduler_calendar | Shows what is scheduled, across all accounts. |
| get_post_analytics | Reads reach, likes, comments and saves per post. |
| get_content_insights | Finds which formats and topics beat your usual numbers. |
| generate_flow | Builds a DM automation from one sentence, as a draft. |
| list_flows_with_stats | Lists your automations, which are live and how often they run. |
| bulk_reschedule_posts | Moves many scheduled posts in one go. |
One connection, every channel.
Connect each account once in SociaHive and SociaHive CLI can post to it. Scheduling covers 22 platforms; X needs a paid plan.
DM automations run on Instagram, Facebook, Messenger and WhatsApp on every paid plan, and on Telegram on Pro and Agency.
Is it safe to let SociaHive CLI post for you?
You approve the connection
Sign in to SociaHive and approve, or use an API key you can delete at any time. The agent never sees your social passwords.
Read-only if you want
Tick “Read-only access” when you connect and the agent can look at everything and change nothing.
Nothing goes live by surprise
Publishing right now asks for your yes in the chat. Automations it builds start as drafts until you turn them on.
Revoke in one click
Settings → Connected apps in SociaHive cuts the agent off on its next request. API keys are deleted under Settings → API keys.
Commands that publish right away or delete something stop and ask for confirmation. The --yes flag skips that, so don’t let an agent add it on its own; tell it to stop and show you the summary instead.
SociaHive CLI or another AI tool?
Every one of them connects to the same SociaHive account.
| Agent | Kind | How it connects | Best for |
|---|---|---|---|
| SociaHive CLI | Build your own | Shell commands that call SociaHive’s MCP server | Agents with a shell, scripts, CI jobs and bulk uploads |
| ChatGPT | Chat assistant | A custom MCP plugin on chatgpt.com, with the SociaHive server address | Writing captions and scheduling them in the same chat |
| Claude Code | Coding agent | The SociaHive plugin, or claude mcp add with the server address | Bulk work from files: CSVs, changelogs, release notes |
| OpenAI dots | Autonomous agent | Custom MCP server added in ChatGPT, then allowed for the dot | Watching your calendar and automations between check-ins |
What does it cost?
The CLI is free and MIT licensed. It needs Node 18.17 or newer and a SociaHive plan with API access.
On SociaHive, MCP access is part of the 7-day trial and every paid plan, from Creator up. There is no extra charge per tool call. See plans.
Included in the trial.
And on every paid plan. 7-day free trial for the paid features. No credit card required.
Connect SociaHive CLITroubleshooting SociaHive CLI.
- Error: SOCIAHIVE_API_KEY environment variable is not set.
- Export the key in the same shell or process your agent runs in. A key set in another terminal tab is not visible to it.
- The agent says the sociahive command is not found.
- Install the CLI with npm install -g sociahive on the machine where the agent runs, and check that npm’s global bin folder is on its PATH.
- A command returns a pending confirmation instead of running.
- That is the safety check for publishing and deleting. Read the summary, then confirm in SociaHive or run the command again with --yes yourself.
- It asks me to upgrade
- MCP access is part of the SociaHive trial and every paid plan. On the free plan the agent can connect, but each request answers with an upgrade link.
- An account is missing
- The agent only sees accounts connected in SociaHive. Connect it under Connected accounts, then ask the agent to list your accounts again.
- A post did not go out
- Ask the agent for the post’s status, or open it in SociaHive. A failed post shows the platform’s reason, for example an expired login that needs reconnecting.
- It says it is not allowed to change anything
- You connected with read-only access. Remove SociaHive under Settings → Connected apps and connect again without ticking it.
FAQ
Which AI agents can use the SociaHive CLI?
Any agent that can run shell commands and read their output, such as Claude Code, Codex, Cursor’s agent or a self-hosted assistant with a terminal.
Do I need an API key?
Yes. The CLI reads it from SOCIAHIVE_API_KEY. Make one in SociaHive under Settings → API keys, and delete it there to cut off access.
What is the difference between the MCP server, the skill and the CLI?
The MCP server is the address an AI app connects to. The CLI calls that same server from a terminal. The skill is a short guide that teaches an agent when to use which CLI command.
Can an agent post on a schedule without me?
It can schedule posts for later, and SociaHive sends each at its time. Posting right away asks for confirmation unless someone passes --yes.
Can it upload images and videos from my computer?
Yes. sociahive upload sends JPEG, PNG, WebP, MP4 and MOV files and prints their URLs, and posts create --media-file uploads and schedules in one command.
Which platforms can it post to?
All 22 platforms SociaHive schedules to, including Instagram, TikTok, LinkedIn, YouTube and Telegram channels. X needs a paid SociaHive plan.
Can it post or change things without asking me?
Automations it builds start as drafts, with every step written out, until they are turned on. Publishing a post right away needs your yes in the chat. If you only want it to look, tick “Read-only access” when you connect: it can read everything and change nothing.
Which plans include it?
The 7-day trial and every paid plan. On the free plan your assistant can still connect, but each request answers with a link to upgrade instead of running.
How do I disconnect it?
Open Settings → Connected apps in SociaHive and revoke it. It is cut off on its very next request. You can also remove the connector in your assistant.


