Most commands print a one-line human-readable header, then the full JSON result.
posts:missing prints JSON with no header, posts:delete prints only a confirmation line, and the auth:* commands print human-readable status text. To pipe into jq, drop the header first:Global options
Environment variables
Stored OAuth2 credentials in
~/.postqueen/credentials.json take priority over both POSTQUEEN_API_KEY and POSTQUEEN_API_URL; the API URL then comes from the credentials file. If neither credentials nor a key is present, any command that talks to the API exits with code 1 and prints ❌ Error: No authentication found., an Options: header, then two numbered lines naming your options. All four go to stderr, so redirect with 2>&1 if you want them in a log.Auth
Integrations
Posts
Flags for posts:create
-c and -m pair by index in the order they are passed, so the second -m attaches to the second -c. Omitting a -m in the middle shifts every later media value onto the wrong item; only a trailing -c can safely be left without media. To leave a middle item empty, use --json instead.Campaign files with --json
When one piece of content per channel is not enough, drop the flags and describe the whole campaign in a file:
type, date, shortLink and tags, plus one posts entry per channel with its own integration.id, value array and settings object. You can omit __type in the settings block. The backend fills it in from each post’s integration ID.
The full annotated example, including per-provider settings for Reddit, LinkedIn, and YouTube, lives in Managing Posts.
Post lifecycle
Analytics
analytics:post returns {"missing": true}, the post published but never got a usable platform ID. Run posts:missing then posts:connect to link it, and analytics start flowing. The response shape: Analytics.
Upload
What each command calls
Every command is a thin wrapper over the Public API. The CLI joinsPOSTQUEEN_API_URL (default https://api.postqueen.ai) with the paths below, and sends your key in a raw Authorization header with no Bearer prefix.
posts:create is rate limited to 30 requests per hour on PostQueen Cloud. Running her yourself? Raise API_LIMIT.Scripting and CI
You drop aposts:create into a deploy script, it works from your terminal, and then it fails the moment a machine runs it. Four behaviors account for most of that gap.
A header line comes before the JSON. integrations:list opens with 🔌 Connected Integrations: and upload opens with ✅ File uploaded successfully!, so jq chokes on the first token. Strip line one with tail -n +2. Two commands break the pattern: posts:missing prints bare JSON and pipes straight through, and posts:delete prints a confirmation line with no JSON at all.
Anything that fails exits 1. Errors go to stderr behind a ❌ and results stay on stdout, so a failed command falls out of your pipeline instead of feeding it half a result. set -e catches it. Every message and its cause: Troubleshooting.
Cron does not read your shell profile. The export POSTQUEEN_API_KEY=... sitting in your ~/.zshrc is invisible to a crontab entry, and the job dies on ❌ Error: No authentication found. before it sends anything. That line goes to stderr, so a crontab redirecting only stdout captures nothing and the failure looks silent. Give cron the key in its own environment, and redirect with 2>&1.
A script that gates first, then uploads and posts:
Next steps
Managing Posts
Threads, campaigns, and the full JSON file format
Troubleshooting
Every CLI error message and its fix
Platform Examples
Ready-made commands per network
Public API
Skip the CLI and call the API directly