What problem does it solve?
This Skill provides comprehensive programmatic access to the Ghost Admin API, automating the creation, editing, and analysis of blog posts, drafts, and other content. It eliminates the need for manual interaction with the Ghost dashboard for complex content management tasks, saving significant time and reducing errors.
Core Features & Use Cases
- Content Management: Programmatically create, update, and delete posts and pages, including setting status (draft, published, scheduled).
- Lexical Content Builder: Construct Ghost's rich Lexical JSON format for advanced content structures, ensuring full editor compatibility.
- Automated Metadata Generation: Automatically generate missing titles, custom excerpts, and relevant tags for posts, ensuring consistency and SEO readiness.
- Use Case: Automatically publish a series of pre-written articles as drafts, complete with SEO-friendly excerpts and relevant tags, without ever logging into the Ghost admin panel. This is ideal for bulk uploads or integrating with external content pipelines.
Quick Start
Ensure GHOST_SITE_URL and GHOST_ADMIN_API_KEY are set in your environment.
This example uses the bundled Node.js script for Lexical content generation.
const { LexicalBuilder, text } = require('./.claude/skills/using-ghost-admin-api/scripts/ghost-lexical-single.js');
const GhostAdminAPI = require('@tryghost/admin-api');
const api = new GhostAdminAPI({
url: process.env.GHOST_SITE_URL,
key: process.env.GHOST_ADMIN_API_KEY,
version: 'v6.0'
});
const content = new LexicalBuilder()
.h1('My Automated Post Title')
.paragraph('This post was created by AI using the Ghost Admin API skill.')
.build();
api.posts.add({
title: "AI-Generated Draft Post",
lexical: JSON.stringify(content),
status: "draft",
custom_excerpt: "A concise summary generated by AI.",
tags: [{ name: "Automation" }, { name: "AI" }]
})
.then(response => console.log('Post created:', response.url))
.catch(error => console.error('Error:', error));