<!-- Generated from the canonical OpenPost public page. Do not edit this build artifact. -->

Title: Automation
Description: Use the CLI, MCP, or the OpenPost n8n node.
Canonical: https://docs.openpo.st/guides/automation
Source: [https://docs.openpo.st/guides/automation](https://docs.openpo.st/guides/automation)

# Automation

OpenPost's CLI, MCP server, and n8n node use the same workspace permissions as the web app. Create a separate, revocable token for each automation. A workspace-bound token is the safest default.

## CLI

Install the matching release binary from [GitHub Releases](https://github.com/getopenpost/openpost/releases). The CLI talks to a running OpenPost instance.

Log in with a browser flow:

```sh
openpost auth login https://app.openpo.st
```

For a headless shell, print the verification URL and code:

```sh
openpost auth login https://app.openpo.st --device
```

For CI, pass an existing token through stdin:

```sh
printf '%s\n' "$OPENPOST_TOKEN" | openpost auth login https://app.openpo.st --with-token
```

Choose a workspace and inspect connected accounts:

```sh
openpost workspace list
openpost workspace use personal
openpost account list
```

Connect new social accounts in the web app at `https://app.openpo.st/settings?tab=accounts`. The CLI deliberately has no provider credential flow.

Create a draft, then schedule a post:

```sh
openpost post create --content "Launch note" --accounts x
openpost post create --content "Launch note" --accounts x --schedule "tomorrow 2pm"
```

Use `--schedule next-slot` to use the next available workspace slot. Use `openpost post list --status scheduled` to inspect scheduled work. Use `publication create` for format-first video and link publications.

## AI assistants

Connect OpenPost to [Cursor](https://docs.openpo.st/mcp/cursor), [ChatGPT](https://docs.openpo.st/mcp/chatgpt), or [Claude](https://docs.openpo.st/mcp/claude) through MCP. Each guide covers sign-in, workspace access, a first test, and connection troubleshooting.

Use `mcp:read` for inspection and reports, or `mcp:full` when the assistant needs to create, edit, schedule, or publish. The [MCP overview](https://docs.openpo.st/mcp) explains remote OAuth, developer tokens, and the local bridge.

## n8n

Install `@getopenpost/n8n-nodes-openpost` from **Settings → Community nodes** in n8n. The package requires Node.js 22.22 or newer in the n8n runtime.

Create an OpenPost credential in n8n with **Base URL** `https://app.openpo.st`, without `/api` or `/api/v1`, and an OpenPost API token. Use a workspace-bound `api:write` token for workflows that write.

The node includes workspace, account, media, schedule, and publication actions. Create, Schedule, and Publish Now are separate actions. Use n8n's Schedule Trigger or Webhook node to start a workflow. Import the package's `list-workspaces` example first to verify the credential, then replace its workspace ID with yours.

If n8n runs in Docker, `localhost` means the n8n container. Use the OpenPost Compose service name or `host.docker.internal` when the services share a machine.
