Postonus

Set up with an agent

A runbook for a coding agent. It connects Postonus to the agent and drafts a first post.

Last updated on

After postonus login, the CLI prints this line for you to paste into your coding agent (Claude Code, Cursor, Codex, or any agent that can run commands):

Set up Postonus for me. Fetch https://postonus.com/docs/setup.md and follow it.

The rest of this page is for the agent.

Instructions for the agent

Do the steps in order. Run each command yourself. Stop and ask the user only where a step says so. Do not publish or schedule a post without the user's approval.

1. Check the CLI and the sign-in

postonus --version
postonus whoami
  • If postonus is not found, install it: npm install -g @postonus/cli (Node 22.12 or later).
  • If whoami exits with code 3, the user is not signed in. Tell the user to run postonus login, approve the code in the browser, and tell you when it is done. You cannot approve it for them.
  • If the user has more than one workspace, run postonus workspaces list and ask which one to use. Add --workspace <id> to every later command.

2. Connect the Postonus MCP server to yourself

postonus mcp serves the twelve Postonus tools over stdio with the login from step 1. It needs no second OAuth step and no API key. Add it to the client you run in:

ClientDo this
Claude Codeclaude mcp add --scope user postonus -- postonus mcp
Codexcodex mcp add postonus -- postonus mcp
CursorAdd "postonus": { "command": "postonus", "args": ["mcp"] } under mcpServers in ~/.cursor/mcp.json
OtherRegister a stdio server with the command postonus and the argument mcp

Most clients load a new server only in a new session. Tell the user to restart or reload the client. Until then, use the CLI for the steps below.

If you cannot change your own configuration, skip this step. The CLI does everything the tools do.

3. Find the channels

postonus channels list --json

If the list is empty, the user must connect an account. Tell the user to run this in their own terminal, because it opens a browser for the platform's sign-in:

postonus channels connect

Bluesky and Telegram use a credential form instead. Send the user to Integrations in the dashboard at https://app.postonus.com for those two. Run postonus channels list again when the user says it is done.

4. Save a first draft

Ask the user what to post, or offer a short first post about what they are working on. Save it as a draft:

postonus post "<text>" --channel <channel-id> --draft --json

The draft has no send time. Nothing is published. Show the user the text and the url from the response.

5. Schedule it after the user approves

Only when the user says yes:

postonus queue schedule <post-id> --optimal

--optimal picks the next recommended time for the channel. Use --at <RFC 3339 time with an offset> for an exact time.

6. Report

Tell the user, in a few lines:

  • Which account and workspace you used.
  • Whether the MCP server is added, and that the client needs a restart to load it.
  • Which channels are connected.
  • The draft or scheduled post, with its link.

Exit codes

Every command takes --json. A failure prints one error object, { code, message, data: { violations } }, and exits with a code you can branch on:

CodeMeans
0Success
2Bad input. Read violations, fix, run again
3Not signed in, or the sign-in expired
4Plan or quota limit. Tell the user
5Rate limit. Wait, then run again

See Commands for every flag, and For agents for the API and the hosted MCP server.

On this page