npm package: @posterly/cli

Terminal access to the posterly API

Use the posterly CLI to authenticate, validate your setup, inspect accounts and platform schemas, schedule posts, manage webhooks, and run Google Business workflows from scripts or your own terminal.

no global install required
npx -y @posterly/cli@latest auth:login
npx -y @posterly/cli@latest doctor --pretty
npx -y @posterly/cli@latest accounts:list --pretty

Published on npm

Run with npx or install globally when you want a permanent posterly command.

JSON by default

Pipe output to jq, CI logs, support scripts, or your own automation without parsing dashboard pages.

Same API key

The same API add-on unlocks REST API, MCP, and CLI access through the public /api/v1 surface.

CLI workflows

Built for the jobs people actually run in a terminal

The CLI should not compete with the dashboard. It should make repeatable, inspectable API work feel fast and safe.

Validate a setup before it fails

Use doctor to confirm Node, package freshness, API origin safety, auth presence, and live /whoami access before a script schedules anything.

npx -y @posterly/cli@latest doctor --pretty

Inspect accounts and schemas

List connected accounts, inspect platform settings, and pull composer-grade platform schemas before building an automation.

posterly accounts:list --pretty
posterly platforms:schema --platform instagram --pretty

Schedule and repair posts

Create posts, update status, inspect missing content, repair release IDs, and delete draft or scheduled groups with explicit confirmation.

posterly posts:create --account-id 123 --caption "Launching soon"
posterly posts:status 123 --status paused --confirm --pretty

Run local business operations

Manage Google Business reviews, review links, profile audits, public replies, and standing profile gallery media from the same terminal flow.

posterly gbp:media --account-id 123 --pretty
posterly gbp:add-media --account-id 123 --source-url https://example.com/front.jpg --category COVER --confirm

Source of truth

CLI over the API, not a second product

posterly keeps /api/v1 as the contract. MCP gives AI agents a tool interface over it. The CLI gives people and scripts a terminal interface over the same public routes.

  • Doctor calls /api/v1/whoami instead of inventing a separate health path.
  • Platform validation uses the generated platform manifest from the API registry.
  • Google Business media commands call the same /api/v1/google-business/media routes as MCP.
  • Command output stays JSON-first for scripts, support handoffs, and CI logs.

Command reference

Enough commands to start, without burying the docs

Full request and response details live in the API docs. This page keeps the terminal workflow easy to scan.

TaskCommand
Authenticateposterly auth:login
Health checkposterly doctor --pretty
Identityposterly whoami --pretty
Accountsposterly accounts:list --pretty
Platform schemaposterly platforms:schema --platform instagram --pretty
Create postposterly posts:create --account-id 123 --caption "Launching soon"
Google Business mediaposterly gbp:media --account-id 123 --pretty
Webhooksposterly webhooks:list --pretty

Safe automation

Practical guardrails for real scripts

The CLI is designed for repeatable operational work: clear JSON, explicit confirmation on destructive commands, local config hardening, and URL checks before API keys are sent.

Hidden API key prompt for local auth
POSTERLY_API_KEY support for CI
Explicit --confirm on risky writes
Refuses non-local http API origins by default
Uses /api/v1 routes as source of truth
Doctor exits nonzero when setup is not healthy

Start with a health check

If you can run doctor and whoami, your terminal has the same authenticated foundation as REST API and MCP clients.

first smoke test
npx -y @posterly/cli@latest doctor --pretty
npx -y @posterly/cli@latest whoami --pretty

FAQ

What is the posterly CLI?

The posterly CLI is a terminal interface for the posterly API. It lets developers, agencies, support teams, and CI jobs authenticate, validate setup, inspect accounts, schedule posts, upload media, manage webhooks, and run Google Business workflows without opening the dashboard.

Do I need to install the CLI globally?

No. You can run it with npx using npx @posterly/cli@latest. A global install is optional if you want a permanent posterly command on your machine.

Does the CLI use the same API as MCP?

Yes. The CLI calls the public posterly API under /api/v1. MCP is the AI-agent interface over the same API, while the CLI is the human and script interface.

How do I check whether my CLI setup works?

Run posterly doctor --pretty. It checks Node, the API origin, whether an API key is configured, whether the key works against /api/v1/whoami, and whether a newer CLI package is published.

Can I use the CLI in CI or scripts?

Yes. Set POSTERLY_API_KEY in the environment and use JSON output by default. Use --pretty for local reading and keep live keys out of shell history.