Ghost CLI Skill
Manage PHATT MEDIA CLUB (phattmedia.club) via the Ghost Admin API.
Triggers: Ghost blog, PHATT MEDIA CLUB, PMC posts, members, newsletters, tiers, offers, publish post
CLI Invocation
cd /root/.openclaw/workspace/skills/ghost
npx tsx scripts/ghost.ts <command> [options]
# Agent JSON mode
npx tsx scripts/ghost.ts --json <command> [options]
# or: AGENT_JSON=1 npx tsx scripts/ghost.ts <command>
Commands
Posts
posts list [--limit 15] [--status draft|published|all] [--filter <NQL>] [--all]
posts get <id-or-slug>
posts create --title <t> --html <body> [--status draft|published] [--tags tag1,tag2] [--send-email]
posts update <id> [--title] [--html] [--status] [--tags]
posts publish <id> [--send-email]
posts delete <id>
Pages
pages list [--limit 15] [--all]
pages get <id-or-slug>
pages create --title <t> --html <body> [--status draft|published]
pages update <id> [--title] [--html] [--status]
pages delete <id>
Members
members list [--limit 15] [--filter <NQL>] [--all]
members get <id-or-email>
members create --email <e> --name <n> [--tier <id>] [--newsletter <id>]
members update <id> [--name] [--note] [--tier]
members delete <id>
members count
Newsletters
newsletters list
newsletters get <id>
newsletters create --name <n> [--sender-name <n>] [--sender-email <e>]
newsletters update <id> [--name] [--sender-name] [--sender-email]
Tiers & Offers
tiers list
tiers get <id>
offers list
offers get <id>
offers create --name <n> --code <c> --tier <id> --discount-type percent --discount-amount 20
Site
site info # version, title, URL, accent color
Common Workflows
Publish a post:
# Create draft
npx tsx scripts/ghost.ts posts create --title "My Post" --html "<p>Body text</p>"
# Publish (and send to email list)
npx tsx scripts/ghost.ts posts publish <id> --send-email
List members:
npx tsx scripts/ghost.ts members list
npx tsx scripts/ghost.ts members list --all # all pages
npx tsx scripts/ghost.ts members count # just the total
Create a newsletter:
npx tsx scripts/ghost.ts newsletters create \
--name "Weekly Digest" \
--sender-name "PHATT MEDIA CLUB" \
--sender-email "hello@phattmedia.club"
Filter posts by tag (NQL):
npx tsx scripts/ghost.ts posts list --filter "tag:movies+status:published"
Agent JSON Format
{ "ok": true, "command": "posts list", "result": [...], "count": 5 }
{ "ok": false, "command": "posts get", "error": "...", "fix": "..." }
Credentials
Hardcoded in scripts/lib/client.ts. Admin API JWT auth (HS256). No env vars needed.
Notes
- Ghost version: 6.19
--allflag autopaginates any list command--filteruses Ghost NQL syntax:status:published,tag:news,email:user@example.composts publishfetchesupdated_atautomatically before PUT (required by Ghost)