Post from your terminal
posthoop post clip.mp4 --to instagram,tiktok uploads the file and schedules the post. It works in a script, a CI job, or any coding agent that can run a command.
# check it, then post it$ posthoop post clip.mp4 --to instagram,tiktok \ --caption "Shop tour" --dry-run$ posthoop post clip.mp4 --to instagram,tiktok \ --caption "Shop tour" --at 2027-01-12T09:00:00Z- Works in
- Any terminal
- Needs
- Node 22.18 or newer
- Sign-in
- A Posthoop API key
- Commands
- 5
Set it up
Install it
The CLI is an npm package. It needs Node 22.18 or newer.
npm install -g posthoopCreate an API key
In Posthoop, open Settings and create an API key with Publishing access. Copy it. You only see it once.
Sign in
Paste the key when asked. The CLI checks it and saves it in
~/.config/posthoop/config.json, readable only by you.posthoop loginCheck your accounts
This lists the accounts the key can post to. If yours are there, you're set.
posthoop accounts
Post a video
Name the file, the caption and where it goes. Add --at with a time to schedule it, or leave it off to post now.
posthoop post clip.mp4 \
--caption "Three things before you open a shop" \
--to instagram,tiktok,youtube \
--at 2027-01-12T09:00:00ZThe five commands
| Command | What it does |
|---|---|
posthoop login | Saves your API key. Use --url if you run your own Posthoop server. |
posthoop accounts | Lists your connected accounts and whether each is ready to post. |
posthoop post <files> | Uploads up to 35 photos or videos and posts or schedules them. Takes --caption, --to, --at and --dry-run. |
posthoop posts | Lists your posts and where each one stands. |
posthoop status <id> | Shows one post and how it went on each platform. |
Every command except login prints JSON, so a script or an agent can read the answer.
The details that save a failed post
A dry run that uploads nothing
Add
--dry-runand Posthoop checks the file and caption against every account you named. You get the problems per platform and no post is made.It checks before it uploads
Even without
--dry-run, the CLI validates first. If the video won't fit a platform, you find out before waiting for a long upload.Pick the account by handle
With two accounts on one platform, write
--to instagram:@yourshop. Otherwise the platform's name is enough.Platform settings as flags
--privacyfor TikTok and YouTube,--boardfor Pinterest. TikTok posts are visible only to you unless you pass--privacy.
In a script or CI job
Where nobody is around to type a key, set it in the environment. posthoop login reads POSTHOOP_API_KEY and won't prompt.
export POSTHOOP_API_KEY="your key"
posthoop login --url https://posthoop.com
posthoop post release.mp4 --caption "v2 is out" --to x,linkedin,blueskyCLI or MCP server?
Use the MCP server in chat apps like Claude and ChatGPT. It signs in with a click and the app asks before it posts.
Use the CLI where there's a shell. Claude Code, Codex and Cursor can all run posthoop post without any setup beyond the key, and so can a cron job. The CLI does less than the MCP server on purpose. Queues, drafts, bulk scheduling and analytics are in the MCP server and the REST API.
Questions
Does the CLI need ffmpeg?
No, but it helps. If ffprobe is installed the CLI reads a video's length and size for you. Without it, pass --duration in seconds, and --width and --height for YouTube.
How big a file can I upload?
Up to 1 GB per file, and up to 35 files in one post. Files go straight to Posthoop's storage.
Can I post a carousel from the CLI?
Yes. List several files after posthoop post. Each platform's own limits apply, so a mixed photo and video carousel works on Instagram and Threads.
Can an AI agent use it?
Yes. Any agent that can run shell commands can call it, and the JSON output is easy for it to read. Tell it to run with --dry-run first.
Where is my API key stored?
In ~/.config/posthoop/config.json, or under XDG_CONFIG_HOME if you set it. The file is readable only by your user. Revoke the key in Posthoop's settings if the machine is lost.
Can I schedule to the queue or save a draft from the CLI?
Not yet. The CLI posts now or at a set time. Queues and drafts are in the dashboard, the MCP server and the REST API.