Run Postcapy commands from scripts and CI pipelines with structured JSON output and stable exit codes.
Developers
Postcapy provides a structured Artisan CLI (postcapy:*) for scripting, operational tooling, and CI/CD automation. Every command follows a strict JSON contract and deterministic exit codes so scripts can parse results reliably.
Command contract#
Every postcapy:* command:
- Requires
--workspace=<public-ulid>and--actor=<public-ulid>. - Accepts
--request-id=<public-ulid>for end-to-end correlation and Symfony's global--no-interactionflag. - Emits exactly one JSON object: successful responses go to
stdoutand errors go tostderr. Both includerequest_id.
Terminal
php artisan postcapy:channels:list \
--workspace=01JXYZWORKSPACE000000000000 \
--actor=01JXYZACTOR0000000000000000 \
--no-interactionNote
Just like the REST API and MCP server, YouTube channels and posts targeting YouTube are excluded from CLI commands.
Stable exit codes#
| Exit code | Meaning |
|---|---|
0 |
Success (JSON payload written to stdout). |
1 |
Internal failure. |
2 |
Invalid or incomplete input arguments or options. |
3 |
Authentication, authorization, entitlement, or not-found failure. |
4 |
Idempotency or optimistic-concurrency conflict. |
5 |
Rate-limited, provider failure, or capability unavailability. |
Available commands#
| Command | Description |
|---|---|
postcapy:channels:list |
List connected channels for the workspace. |
postcapy:channels:schema |
Inspect a channel's posting schema, constraints, and provider settings. |
postcapy:channels:tool |
Query a channel's live option lists (such as boards or categories). |
postcapy:posts:list |
List workspace posts with optional filters. |
postcapy:posts:create |
Create a draft, scheduled post, or immediate publication. |
postcapy:posts:cancel |
Cancel an unpublished scheduled post. |
postcapy:posts:status |
Inspect a post's publishing state and recent delivery attempts. |
postcapy:media:upload |
Upload a local image or video file to the workspace media library. |
postcapy:media:import |
Import media into the library from a public HTTPS URL. |
postcapy:analytics:channel |
Read collected metrics for a connected channel. |
postcapy:analytics:post |
Read collected metrics for a published post. |
Inspecting options#
Run php artisan help <command> to inspect typed arguments, defaults, and available flags for any command:
Terminal
php artisan help postcapy:posts:create