Prerequisites
- Node.js 20 or later
Install
- npm
- npx (one-shot)
autoposting and ap (short alias) are available after install.
Setup
Authenticate
Set your API key via environment variable or browser login:Add to your shell profile (Auth priority:
- Environment Variable
- Browser Login
~/.zshrc, ~/.bashrc) for persistence.The CLI talks to
https://app.autoposting.ai/api-proxy by default. Override it with the
AUTOPOSTING_BASE_URL environment variable (or ap auth login --base-url) for staging or self-hosted backends.Verify
CI/CD Usage
For CI/CD pipelines, use theAUTOPOSTING_API_KEY environment variable with --json and --quiet flags:
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Authentication error |
| 3 | Validation error |
| 4 | Not found |
| 5 | Rate limited |
| 6 | Server error |
Commands
Full command reference with flags and examples.
MCP Setup
Connect AI assistants to your account.
TypeScript SDK
Programmatic API access in Node.js.
API Reference
Explore the REST API directly.