DownloadCLI & Automation Guide (bin/quickwp, Markdown, Sync & Webhooks)
QuickWP v3.0 includes a zero-dependency multi-site CLI (bin/quickwp) and an outbound webhook dispatcher designed for scripting, cron jobs, backups, and external automations (n8n, Make, Zapier, Slack, Telegram).
Running the CLI
From the QuickWP root directory (or via vendor/bin/quickwp when installed with Composer):
php bin/quickwp help
All commands accept --json for machine-readable JSON output and --site=<key> to target a specific site from quick-sites.php.
Commands Reference
1. List Configured Sites
php bin/quickwp site:list
php bin/quickwp site:list --json
2. Health Check (Single Site or All Sites)
php bin/quickwp site:check --site=main
php bin/quickwp site:check --all
php bin/quickwp site:check --all --json
Returns exit code 0 if all checked sites are reachable and authenticated, or 1 if any site fails (ideal for monitoring/cron).
3. List Posts or Pages
php bin/quickwp post:list --site=main --per-page=10 --status=any
php bin/quickwp post:list --type=page --search="about" --json
4. Create Post / Page from Markdown File (with Frontmatter)
Create a .md file with optional YAML-style frontmatter:
---
title: "QuickWP v3.0 Release"
slug: quickwp-v3-release
status: draft
excerpt: "Multi-site CLI, webhooks, MCP server, and AI Concierge."
categories: [1, 4]
tags: [12, 18]
featured_image: ./cover.jpg
---
# QuickWP v3.0
Publish clean HTML directly from Markdown, with automatic local image uploads.
- Multi-site CLI (`bin/quickwp`)
- Outbound webhooks with HMAC-SHA256
- Local MCP server (`bin/quickwp-mcp`)
Publish it:
php bin/quickwp post:create --site=main --file=article.md
# Override status or featured image from CLI:
php bin/quickwp post:create --site=main --file=article.md --status=publish --featured-image=./hero.png
If featured_image points to a local readable file, QuickWP automatically uploads it to the WordPress Media Library and sets featured_media.
5. Upload Local Media
php bin/quickwp media:upload --site=main --file=./cover.jpg --title="Cover" --alt="Hero banner"
php bin/quickwp media:upload --site=main --file=./cover.jpg --featured-for=83
6. Export Content Backup (JSON + Markdown)
php bin/quickwp export --site=main --type=post --out=./backup/posts
php bin/quickwp export --site=main --type=page --out=./backup/pages --json
Writes both <slug>-<id>.json (full WordPress REST payload) and <slug>-<id>.md (frontmatter + content) for every item across all pages (listAll()).
7. Cross-Site Sync (staging ? prod)
# Creates a draft copy on prod (default status = draft for safety)
php bin/quickwp sync --from=staging --to=prod --type=post --id=83
# Update an existing target item and publish
php bin/quickwp sync --from=staging --to=prod --type=post --id=83 --target-id=201 --status=publish
> Note: SyncService performs a thin content sync (title, content, excerpt, slug, template, and menu_order for pages). It does not migrate media attachments, taxonomies, or meta/ACF yet.
8. AI Concierge Draft from CLI
php bin/quickwp ai:draft --site=main --prompt="Scrie un rezumat īn romān? despre..." --url=https://example.com/news --lang=ro
See MCP Server & AI Concierge for provider configuration.
Outbound Webhooks
Instead of bloating QuickWP with OAuth integrations for social networks or chat apps, configure optional outbound webhooks in quick-config.php (or per-site in quick-sites.php):
'webhooks' => [
'post.published' => 'https://n8n.example.com/webhook/quickwp-post',
'page.published' => ['https://hooks.example.com/page', 'https://hooks.example.com/audit'],
'*' => 'https://hooks.example.com/all-events',
],
'webhook_secret' => 'your-random-hmac-secret',
Payload & Headers
When a post or page is published via Web UI, CLI, MCP, or Sync, QuickWP sends a fire-and-forget POST request (5s timeout):
-
`Content-Type: application/json; charset=utf-8`
-
`X-QuickWP-Event: post.published`
-
`X-QuickWP-Signature: sha256=<hmac-hex>` (when
webhook_secret is set)
{
"event": "post.published",
"timestamp": "2026-12-05T14:00:00+00:00",
"data": {
"id": 83,
"title": "QuickWP v3.0 Release",
"link": "https://example.com/quickwp-v3-release/",
"site": "main"
}
}
Verifying the HMAC Signature (Receiver Example)
$rawBody = file_get_contents('php://input');
$headerSig = $_SERVER['HTTP_X_QUICKWP_SIGNATURE'] ?? '';
$expected = 'sha256=' . hash_hmac('sha256', $rawBody, 'your-random-hmac-secret');
if (!hash_equals($expected, $headerSig)) {
http_response_code(401);
exit('Invalid signature');
}
|