> ## Documentation Index
> Fetch the complete documentation index at: https://docs.postlybee.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI introduction

> Automate PostlyBee from terminals, scripts, CI jobs, and AI agents.

The PostlyBee CLI wraps the Public API in an installable `postlybee` command. It is designed for repeatable automation: every command returns JSON, every Workspace operation uses the same user API Token and tenant checks as the SDK, and self-hosted installations can select a different API origin.

## Installation

```bash theme={null}
npm install -g postlybee-cli
postlybee --help
```

Node.js 18 or newer is required.

## Quick start

```bash theme={null}
postlybee auth:login
postlybee workspaces:list
postlybee accounts:list --workspace YOUR_WORKSPACE_ID
postlybee posts:list --workspace YOUR_WORKSPACE_ID
```

When a Token can access exactly one Workspace, commands automatically select it. With multiple Workspaces, pass `--workspace`, set `POSTLYBEE_WORKSPACE_ID`, or save a default during `auth:login`.

## Commands overview

| Command              | Description                                     |
| -------------------- | ----------------------------------------------- |
| `auth:login`         | Validate and securely store an API Token.       |
| `auth:status`        | Verify saved credentials and list Workspaces.   |
| `auth:logout`        | Remove saved credentials.                       |
| `workspaces:list`    | List Workspaces allowed by the Token.           |
| `accounts:list`      | List connected social accounts.                 |
| `accounts:connect`   | Create a provider OAuth URL.                    |
| `accounts:settings`  | Read provider settings and available tools.     |
| `accounts:trigger`   | Run a provider discovery tool.                  |
| `accounts:delete`    | Remove a connected account.                     |
| `posts:list`         | List posts in a UTC date range.                 |
| `posts:create`       | Create posts from JSON.                         |
| `posts:delete`       | Delete a post and its thread segments.          |
| `posts:missing`      | Find provider content for a missing release ID. |
| `posts:connect`      | Attach the selected provider release ID.        |
| `posts:status`       | Move a post between draft and scheduled state.  |
| `posts:settings`     | Merge provider-specific post settings.          |
| `media:*`            | Upload, import, or generate media.              |
| `analytics:*`        | Read account and post analytics.                |
| `notifications:list` | Read Workspace notifications.                   |
| `ping`               | Verify Token and Workspace access.              |
| `find-slot`          | Find an account's next posting slot.            |

## Global options

```text theme={null}
-t, --token <token>       Token for this command only
-w, --workspace <id>      Target Workspace
--base-url <url>          Self-hosted API origin
--raw-json                Compact single-line JSON
```

Run `postlybee <command> --help` for command-specific options.
