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

# CLI

> 75 commands to manage posts, brands, agents, and AI content — from your terminal.

<CardGroup cols={2}>
  <Card title="Post Publishing" icon="paper-plane">
    Create, schedule, publish, retry, AI-rewrite, and AI-score posts across X, LinkedIn, YouTube, Instagram, and Threads.
  </Card>

  <Card title="Brand & Agent Management" icon="tag">
    Manage brands, platform connections, and AI-powered autonomous posting agents.
  </Card>

  <Card title="AI Content Generation" icon="sparkles">
    Generate ideas, create carousels, clip videos, and search knowledge bases with AI.
  </Card>

  <Card title="Built-in MCP Server" icon="robot">
    Run `ap mcp` to expose 55 tools to Claude Desktop, Cursor, or any AI agent.
  </Card>
</CardGroup>

## Install

```bash theme={null}
npm install -g @autoposting.ai/cli
```

Both `autoposting` and `ap` (short alias) are available after install.

## Quick Start

```bash theme={null}
# Authenticate
export AUTOPOSTING_API_KEY=sk-social-your-key

# Create and publish a post
ap posts create --brand my-brand --text "Hello world!" --platforms x,linkedin
ap posts publish <post-id>

# Set a default brand, then omit --brand everywhere
ap config set-context --brand my-brand
ap posts create --text "Launch day!" --platforms x,linkedin \
  --media ./hero.png --at 2026-07-01T09:00:00Z --account x=@myhandle

# Run an AI agent
ap agents run <agent-id>

# Generate content ideas
ap ideas generate --topic "AI trends" --count 5

# Health check
ap doctor
```

## Command Domains

| Domain         | Commands | Description                                                                                                      |
| -------------- | :------: | ---------------------------------------------------------------------------------------------------------------- |
| Posts          |    10    | Create (media, threads, per-account, scheduled, bulk), publish, schedule/unschedule, retry, AI-rewrite, AI-score |
| Brands         |     9    | CRUD, platform auth status, default-account defaults                                                             |
| Agents         |     8    | Create, run, toggle, view run history                                                                            |
| Knowledge Base |     7    | Create, search, ingest URLs, list docs                                                                           |
| Clips          |     6    | Upload, import, render, manage video clips                                                                       |
| Carousels      |     6    | Create, AI-generate, convert to post draft                                                                       |
| Webhooks       |     6    | Create, test, manage event hooks                                                                                 |
| Auth           |     5    | Device-code/browser login, profiles, switch, status                                                              |
| Ideas          |     4    | AI-generate, enrich, manage ideas                                                                                |
| Config         |     3    | Default brand context (set/get/unset)                                                                            |
| Billing        |     2    | Plan status, credit balance                                                                                      |
| Workspaces     |     2    | List, switch workspace                                                                                           |
| Usage          |     1    | Publishing statistics                                                                                            |
| Utility        |     6    | doctor, whoami, open, update, completion, mcp                                                                    |

## Output Modes

| Mode        | When              | Format                   |
| ----------- | ----------------- | ------------------------ |
| Interactive | TTY terminal      | Tables, spinners, colors |
| JSON        | `--json` or piped | Clean JSON for parsing   |
| Quiet       | `--quiet`         | Errors only, no spinners |

## Global Flags

| Flag              | Description                                                                 |
| ----------------- | --------------------------------------------------------------------------- |
| `--api-key <key>` | Override API key                                                            |
| `--json`          | JSON output                                                                 |
| `--quiet`         | Suppress non-essential output                                               |
| `--format <type>` | `auto` (default — table on a terminal, JSON when piped), `table`, or `json` |
| `--jq <expr>`     | Filter JSON output with a minimal jq expression (e.g. `.[].id`)             |
| `--no-color`      | Disable colors                                                              |

<CardGroup cols={2}>
  <Card title="Installation" icon="download" href="/cli/installation">
    Install, configure, and verify the CLI.
  </Card>

  <Card title="Commands" icon="terminal" href="/cli/commands">
    Full command reference with flags and examples.
  </Card>

  <Card title="MCP Server" icon="robot" href="/mcp/overview">
    Let AI assistants manage social media for you.
  </Card>

  <Card title="TypeScript SDK" icon="brackets-curly" href="/sdks/typescript">
    Programmatic API access in Node.js.
  </Card>
</CardGroup>
