Hi all,
Publishing a post with several images by hand in the editor always cost me ~15 minutes of plumbing per piece — paste the body, upload each image one by one, fill in title/slug/excerpt/tags, build the cards. So I wrote a small CLI that does it in one command and open-sourced it (MIT), in case it’s useful to anyone here.
ghost-md-publisher — you write in Markdown with YAML front-matter, and it publishes to Ghost via the Admin API:
npm install -g @oksigenia/ghost-md-publisher
ghost-publish ./my-article/
What it handles:
- Images — finds local images (body, HTML and
feature_image), processes them withsharp(resize, format, EXIF) and uploads them, rewriting the paths. - Native Ghost cards — image captions, video embeds (YouTube/Vimeo/Odysee/Rumble) and the Product Card, all from simple Markdown.
- Upsert by slug — if the slug already exists it updates the post instead of duplicating it.
- Validation before sending — checks Ghost’s limits (excerpt 300, alt 191…) and the front-matter up front, so you don’t fail after uploading images.
- Creates the post as a draft by default, so nothing goes live without you.
Free and MIT, published to npm with provenance (OIDC trusted publishing, no tokens).
- GitHub: GitHub - OksigeniaSL/ghost-md-publisher: Publish articles to Ghost from Markdown with YAML front-matter — image processing, native cards, create/update via Admin API. · GitHub
- npm: https://www.npmjs.com/package/@oksigenia/ghost-md-publisher
I’d love feedback: what’s missing, what would make it fit your workflow better? Happy to add it to the roadmap. Thanks!