๐ฆ ClawHub
ghost cms
by @manifoldor
Manage Ghost CMS blog posts via Admin API. Supports creating, updating, deleting, and listing posts. Use when the user needs to programmatically manage Ghost...
โ๏ธ Configuration
# Install dependencies
pip3 install requests pyjwt --user
Create a Post
As draft (default):
python3 scripts/ghost.py create "My Article Title" "Article content in HTML
" --config "../../projects/fuye/ghost-admin.config.json"
Publish immediately:
python3 scripts/ghost.py create "Breaking News" "Content here
" --status published --config "../../projects/fuye/ghost-admin.config.json"
With tags:
python3 scripts/ghost.py create "Tech News" "Content
" --status published --tags "tech,news,ai" --config "../../projects/fuye/ghost-admin.config.json"
Upload Image
python3 scripts/ghost.py upload cover.png --config "../../projects/fuye/ghost-admin.config.json"
Update a Post
# Update title
python3 scripts/ghost.py update 5f8c3c2e8c3d2e1f3a4b5c6d --title "New Title" --config "../../projects/fuye/ghost-admin.config.json"Update content
python3 scripts/ghost.py update 5f8c3c2e8c3d2e1f3a4b5c6d --content "New content
" --config "../../projects/fuye/ghost-admin.config.json"Publish a draft
python3 scripts/ghost.py update 5f8c3c2e8c3d2e1f3a4b5c6d --status published --config "../../projects/fuye/ghost-admin.config.json"
Delete a Post
python3 scripts/ghost.py delete 5f8c3c2e8c3d2e1f3a4b5c6d --config "../../projects/fuye/ghost-admin.config.json"
List Posts
# List 10 most recent posts (default)
python3 scripts/ghost.py list --config "../../projects/fuye/ghost-admin.config.json"List 20 posts
python3 scripts/ghost.py list 20 --config "../../projects/fuye/ghost-admin.config.json"
๐ Tips & Best Practices
Error: No module named 'jwt'
โ Install: pip3 install pyjwt --user
Error: 401 Unauthorized โ Check your Admin API Key is correct and not expired
Error: 404 Not Found
โ Verify api_url in config file ends with /ghost/api/admin
Error: Config file not found โ Ensure config_path is correct relative to your working directory
Image upload fails โ Check image file exists and is under 10MB โ Supported formats: JPG, PNG, GIF
TERMINAL
clawhub install ghost