Skip to main content

CLI

The @posteverywhere/cli lets you (or your AI agent) log in, connect every platform, and publish entirely from the terminal — no dashboard navigation required.

npm install -g @posteverywhere/cli      # or: npx @posteverywhere/cli <command>

90-second setup

posteverywhere login                 # opens your browser, saves a key to ~/.posteverywhere
posteverywhere connect instagram # opens the OAuth flow; auto-detects the connected account
posteverywhere accounts # list connected accounts (+ ids & health)
posteverywhere post -c "Hello 🚀" -a 123,456

How login works

A device-grant flow (RFC 8628, like the GitHub CLI):

  1. The CLI calls POST /v1/auth/device and prints a short code (e.g. GUPK-HM3G) plus a URL.
  2. It opens https://app.posteverywhere.ai/device in your browser. You confirm the code (you must be signed in).
  3. The CLI polls POST /v1/auth/device/token until you approve, then receives a scoped API key (read, write, ai) and saves it to ~/.posteverywhere/config.json (chmod 600).

The key is a normal API key — it shows up in Settings → Developers alongside dashboard-generated keys, and you can revoke it there anytime. The plaintext key is shown/saved exactly once and never stored on our servers in plaintext.

How connect works

posteverywhere connect <platform>
posteverywhere reconnect <accountId> # refresh an expired account's token
  • Browser platformsinstagram, facebook, threads, x, linkedin, tiktok, youtube, pinterest. The CLI calls POST /v1/auth/social-connect/start, opens the normal OAuth flow in your browser, and watches for the account to appear, then resolves automatically. No copy-paste of tokens.
  • Bluesky — prompts for your handle + an App Password (Settings → App Passwords). No browser.
  • Telegram — prompts for a bot token (@BotFather) + your channel (add the bot to it as an admin first). No browser.
  • Discord — prompts for a channel webhook URL (Server Settings → Integrations → Webhooks). No browser.

Commands

CommandWhat it does
login / logoutDevice-flow login / remove saved credentials
whoamiShow the authed account, plan & quota
accountsList connected accounts (+ ids & health)
connect <platform>Connect a new account
reconnect <accountId>Re-authorize an account whose token expired
account:health <id>Detailed health for one account
post -c <text> -a <ids> [-s <iso>] [-m <mediaIds>]Publish now (omit -s) or schedule (-s = ISO-8601 UTC)
posts [--status x] [--platform y] [--limit n]List posts
results <postId>Per-platform publish results
retry <postId>Retry failed destinations
upload <imageUrl>Import an image by URL → media_id
caption -t <topic> [--platform x] [--tone y]AI captions
analytics [--period week|month|all]Analytics summary
campaignsList campaigns

For AI agents

Every command accepts --json (auto-on when output is piped) and emits structured JSON, so Claude, Cursor, and other agents can parse results. The package ships a SKILL.md for auto-discovery.

For CI or fully headless agents, skip login and set the key directly:

export POSTEVERYWHERE_API_KEY=pe_live_...   # Settings → Developers
posteverywhere accounts --json

Prefer MCP? Use the hosted endpoint https://mcp.posteverywhere.ai/mcp or npx -y @posteverywhere/mcp — see MCP.

Troubleshooting

  • "Not logged in" — run posteverywhere login, or set POSTEVERYWHERE_API_KEY.
  • connect times out — the browser window must be signed in to the same account your key belongs to. Finish the OAuth there; the CLI resolves within a few seconds.
  • An account "needs reconnect"posteverywhere reconnect <accountId>.
  • Auth precedencePOSTEVERYWHERE_API_KEY env var wins over the saved login key.