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

Title: Command-line interface
Description: Install the openpost CLI, sign in, and publish from a shell or script.
Canonical: https://docs.openpo.st/guides/cli
Source: [https://docs.openpo.st/guides/cli](https://docs.openpo.st/guides/cli)

# Command-line interface

Run OpenPost from a shell, a script, or CI. The CLI talks to a running OpenPost instance over HTTPS and follows the same workspace access rules as the web app. For unattended automation, create a separate token for each integration and bind it to one workspace when possible.

## Install the CLI

Install the binary matching your server release from [GitHub Releases](https://github.com/getopenpost/openpost/releases). When a flag in this guide differs from your installed version, run `openpost help` or `openpost <group> <command> --help`; live help is the source of truth.

## Sign in

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 or another unattended shell, pass a token through stdin:

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

Check the saved context before a workspace-scoped action:

```sh
openpost auth status --json
openpost workspace list --json
```

## Choose a workspace and 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 and schedule a post

Use `post` for short text and threads:

```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` for format-first content such as link shares, image posts, carousels, stories, and video. Validate before publishing:

```sh
openpost publication create --content-profile link_share --accounts company-linkedin --url https://example.com/release --content "Release notes"
openpost publication validate <publication-id>
openpost publication publish-now <publication-id>
```

Inspect `openpost provider readiness` before a new provider workflow, and `openpost provider capabilities --provider <key>` before choosing a publication profile.

## Use the openpost-cli agent skill

If you work through an AI coding assistant, install the `openpost-cli` skill instead of pasting CLI flags by hand. It carries the safe command patterns for authentication, drafting, validation, scheduling, recovery, and comment moderation:

```sh
npx skills add https://github.com/getopenpost/openpost --skill openpost-cli
```

Browse it in the directory at [skills.sh/getopenpost/openpost](https://www.skills.sh/getopenpost/openpost). Agents that follow the Agent Skills discovery spec can also fetch it directly from [openpo.st/.well-known/agent-skills/openpost-cli.tar.gz](https://openpo.st/.well-known/agent-skills/openpost-cli.tar.gz).

## Next steps

- Prefer an assistant conversation instead? Connect through [MCP](https://docs.openpo.st/mcp).
- Run steps on a timer or webhook? Build an [n8n workflow](https://docs.openpo.st/guides/automation#build-an-n8n-workflow).
