Developer Beta: ghst cli

Hi everyone,

Wanted to share a new ghst CLI tool we’ve been working on - as a developer beta - which allows you to interact with Ghost publications from the command line.

In short, this allows you (or an LLM like Claude, or Codex) to automate tasks within Ghost using a set of pre-built tools. Pretty much everything you can do in Ghost Admin, you can do using this CLI.

For example:

  • Create/edit posts and publish them
  • Import or export members
  • Download/upload/activate themes
  • Find out which post got the most traffic last month
  • Post an update to the social web
  • Check your latest newsletter open rate
  • Create a new paid tier or special offer

Here’s a quick demo of how it works:

It’s pretty fun! While the demo shows off a lighthearted example of writing a post about cats, the point of the tool is not “AI can write content for you now” - but rather that you can automate site administration for whatever tasks matter to you.

Personally, I’ve found it really useful for making quick changes and updates to my site, or doing customer (member) support just by saying things like “go and give [Jamie Larson] a complimentary subscription” out loud.

But, this tool does come with a big disclaimer:

:warning: Important warning :warning:

CLI tools are powerful, and ghst includes support for destructive actions, such as deleting posts and members. There are multiple safety features, confirmation steps, and built-in guardrails to avoid accidents, but allowing AI agents to interact with CLI tools always comes with some risk that they may do something you don’t want them to.

For this reason, this tool is currently only recommended for use by developers who are comfortable navigating terminal apps, and LLM / bash permissions.

As always: It’s good practice to make sure you have backups

With that said,

I’ve been using this in production for a few weeks now, and it’s been a great experience so far. I’d love to hear what you think, and any open source contributions are welcomed!

18 Likes

Interesting! If I’m not wrong, it’s sort of a “packaged gctools”? Anyways, I’ll check it out.
Thanks!

2 Likes

Well… this is timely!

3 Likes

Funny, I was just stubbing out a workflow in n8n to use as an MCP server. This is a much better path!

2 Likes

I currently go from Notion → n8n → Ghost. Would love to see a better way of doing this.

(Notion is where I hold all of my context… not sure if that’s a future Ghost thing)

2 Likes

hi @AlanSoon , I think that N8N is a bit old fashioned nowadays. Maybe have a look at claude code and see if how it can connect with notion and ghost so you will have your context and you can publish your articles, do curation, do almost everything honestly.

1 Like

Very cool. Claude Code has made me see the value of CLIs. Ghost is much easier to use than WordPress, but a CLI option certainly can’t hurt.

Very cool. Even if CLI does not replace the whole of UI, I think tools like Claude in Crhome eventually willl…

It’s really cool seeing Ghost getting closer to AI; thanks for bringing this out.

The lack of mass edit and/or selecting topics (by tags, dates, or whatever) will be complemented by tools like this.

I wonder if it could help to keep translated post edits automated.

This was SO useful…! I was able to migrate over 1000 WordPress posts to my new Ghost website using this MCP. Incredible. Worked like a charm.

3 Likes

Woah that’s cool - did it convert formatting and everything, too?

Insteresting ! I’ve been relying a lot on the api so far but my agent often had issues preparing the posts content.

I’ll try and tell it to use this tool instead to see if I get better results.

Thanks !

Are you not concerned about the security implications of making it easier to use tools like Claude?

There was a bit of back and forth. It took two attempts:

Migration v2 is running in the background. This uses ghst post create --from-json which correctly converts HTML→Lexical. Each post gets:

  • Full HTML content (WordPress body + styled comments section)

  • Original slug preserved

  • Original published_at date

  • All tags (WP categories + tags merged)

  • Draft status (for your review before publishing)

I was working w/ Opus and it made these improvements:

  1. Technorati tags → Ghost tags — Extracting tag names from Technorati blocks and adding them as proper Ghost tags, then removing the block

  2. Inline Technorati links — Stripping the dead links, keeping just the text

  3. Image alignment — Converting alignleft/alignright/aligncenter to Ghost-compatible figure styling

  4. YouTube shortcodes — Converting [youtube] to proper iframe embeds

  5. Flash/SWF embeds — Replacing with “Flash no longer supported” placeholder

  6. <!--more--> tags — Removed

  7. WP block comments — Removed

  8. Empty paragraphs / &nbsp; — Removed

  9. Double <br> breaks — Normalized

  10. WP smiley images — Converted to emoji

  11. Comments — Re-applied with HTML card markers (also fixes the 19 that failed in the first pass)

I also had it review the assets in each post, which sadly suffers from a lot of link rot:

It offered this report of what it accomplished:

  1. Lexical comment fix — 707 posts updated with properly formatted HTML card comments

  2. Large post fix — 29 large posts (that hit the 64KB JSON limit) re-created with comments

  3. Duplicate cleanup — 40 duplicates removed

Final state: 1,021 draft posts in Ghost (1,001 from WordPress + ~20 pre-existing).

2 Likes

Oh wow :exploding_head: that’s incredible, I haven’t done anything that big yet! Gotta try

I’ve previously used Claude via Warp to automate Ghost, it and worked well without a CLI. It seemed to already know the Ghost Admin API and could use curl to make the requests.

But using Ghost this way has exposed a couple of bugs in the Admin API which remain unpatched.

Attempting to send emails for posts via created via API can result in silent failure: I submitted a fix for that in July, 2025. https://github.com/TryGhost/Ghost/pull/24517

If you don’t want to save a new revision of a post, that’s also broken. I submitted a patch for that three weeks ago. It’s still waiting for an initial response. https://github.com/TryGhost/Ghost/issues/26677 Both of these bugs stem from the same root assumption that since the Ghost Admin API works for the web interface it must work correctly in general. But the API allows some edge cases that are used by the web. If Ghost is going to provide truly first-class support for a CLI using the Admin API, these edge cases need to be addressed.

I’ve put together a very basic SKILL.md file to enable it in OpenClaw. I can now articulate changes to my site over a chat interface, and it (mostly) happens for me!

I’m continuing to update this today, I’ve just added a section on how you can make minor changes by grabbing the lexical content and editing it directly, for tweaking small things like URLs and spelling.

This is great, John!

I practically live in terminal, and write most posts for my blog in Helix/Vim — and pull the ones I write in the editor as markdown via the Admin API — so I’m always glad to see first-class support for TUIs.

1 Like

Interesting. You blog in Notion, @AlanSoon ?

yes – I draft in Notion, and when done, send it over to Ghost (via n8n) where I press publish.

1 Like