PostlyBee CLI

A social media CLI for AI agents

Any agent that can run shell commands can post through PostlyBee. Install the CLI, give it a scoped API token, and the agent can schedule posts, upload local media, and read analytics with predictable JSON output.

  • Works with any agent that has a shell, with or without MCP support
  • JSON output and exit codes that agents and scripts can parse
  • Upload images and videos straight from disk

$0 charged today, cancel anytime. API access is included in every paid plan.

How do I give an AI agent the PostlyBee CLI?

Install the CLI where the agent runs, sign it in with an API token, and tell the agent how to use it.

  1. 1

    Create a scoped API token

    In Settings → Public API, create a pbk_ token limited to the workspaces and scopes the agent needs.

  2. 2

    Install and sign in

    Install postlybee-cli with npm, then run postlybee auth:login or set environment variables.

  3. 3

    Tell your agent about it

    Add a short note to your agent’s instructions so it knows to use postlybee and to ask before posting.

MCP server URL

https://api.postlybee.com/mcp

auth:login reads the token through a hidden prompt, checks it, and saves it to ~/.postlybee/credentials.json with owner-only permissions.

  1. 1Install the CLI globally.
  2. 2Run postlybee auth:login and paste your token when asked.
  3. 3Run postlybee ping to confirm the token and workspace.
npm install -g postlybee-cli
postlybee auth:login
postlybee ping
Read the full CLI documentation

Connection options

CLI or MCP server?

Both reach the same PostlyBee workspace. Pick the one your agent supports best.

  • PostlyBee CLI

    Best for: agents that run shell commands, scripts, and CI

    Works with any agent that can use a terminal, even without MCP support. It can upload files from disk and covers the full Public API, including deleting posts.

  • PostlyBee MCP server

    Best for: Claude, ChatGPT, Cursor, and other MCP clients

    Nothing to install, OAuth sign-in, and tools the agent discovers on its own. Deleting posts is not available through MCP.

Capabilities

What can an agent do with the CLI?

The CLI wraps the PostlyBee Public API in commands with JSON in and JSON out.

  • Schedule and draft posts

    Create posts and threads from a JSON file, inline data, or stdin, and move them between draft and scheduled.

  • Upload local media

    Upload an image or MP4 straight from disk with media:upload, or import one from a public HTTPS URL.

  • Find posting slots

    Ask for the next available slot for any connected account with find-slot.

  • Handle platform settings

    Read each account’s settings schema and run account tools, such as listing Pinterest boards.

  • Read analytics

    Get analytics for a connected account or for a single published post.

  • Script-friendly by design

    Every command prints JSON, exits with 0 on success and 1 on errors, and reports the scope it needed.

How it works

How an agent posts with the CLI

The agent runs postlybee commands like any other shell tool and reads the JSON they print. A typical run lists accounts, checks a channel’s settings, writes a post as JSON, and pipes it to posts:create.

postlybee --raw-json accounts:list
postlybee --raw-json find-slot ACCOUNT_ID
jq -n --arg account "ACCOUNT_ID" --arg content "Hello from my agent" \
  '{type: "draft", date: "2026-10-06T09:00:00.000Z", shortLink: false, tags: [],
    posts: [{integration: {id: $account},
             value: [{content: $content, image: []}], settings: {}}]}' \
  | postlybee --raw-json posts:create --stdin

Safety

Give each agent only the scopes it needs

Unlike the MCP server, the CLI can delete posts and connected accounts, and posts:delete does not ask for confirmation so scripts stay non-interactive. Token scopes are how you keep an agent in bounds.

Research and reporting

accounts:read, posts:read, and analytics:read let an agent look but not change anything.

Drafting and scheduling

Add posts:write and media:write only in the environment that should create posts.

Never needed by most agents

Leave out accounts:write, which can connect and delete social accounts.

Example prompts

What can you ask an agent to do with the CLI?

~/my-app · agentExample

> Use the postlybee CLI to schedule this announcement to LinkedIn and X on Monday at 9 AM.

  • ● postlybee --raw-json accounts:list└ Found LinkedIn and X
  • ● postlybee --raw-json accounts:settings LINKEDIN_ID└ Loaded LinkedIn settings

● Here are both versions. I shortened the X post to fit.

LinkedInMon, 9:00 AM

We just opened our public API. Build on top of your data with scoped tokens and clear docs.

XMon, 9:00 AM

Our public API is open. Scoped tokens, clear docs, build away.

? Create both posts for Monday at 9:00 AM? (y/n) y

● postlybee --raw-json posts:create --stdin

✓ 2 posts scheduled

Platforms

Which platforms can an agent post to with the CLI?

The CLI posts to any channel connected in your PostlyBee workspace.

Which guide?

CLI, MCP server, or a coding agent guide?

Many agents support both. Use the guide for your agent when there is one; use the CLI for everything else.

  • PostlyBee CLI(this page)

    For any agent with a shell, plus scripts and CI. Covers the full Public API, including media uploads from disk.

  • MCP server

    For Claude, ChatGPT, Cursor, and other MCP clients. Nothing to install and OAuth sign-in.

    See the MCP setup guide
  • Claude Code

    Anthropic’s coding agent. It can use the CLI, but the MCP setup is simpler.

    Read the Claude Code guide

Pricing and security

How much does it cost?

The CLI is free to install. It uses the PostlyBee Public API, which is included in every paid plan, starting from $9.99 per month, with a 7-day free trial.

How is access secured?

pbk_ tokens are limited to the workspaces and scopes you choose, and access ends as soon as the token owner stops managing a workspace.

Something not working?

Run postlybee ping to check the token and workspace. Errors are JSON, and a 403 lists the scope the command needed.

FAQ

PostlyBee CLI FAQ

Get started

Give your agent a social media CLI

Start your free trial, create a scoped token, and install postlybee-cli in a minute.