Convert your Ghost Blog posts to Markdown with an elegant CLI. Convert all or selected blog Posts or Pages and aother functionnalities!
Report Bug
.
Request Feature
Ghost Blog Buster is an interactive CLI allowing you to interact with your Ghost Blog directly via the Ghost Content API. From the cli you will be able to:
- 🌪️ Choose between Content API or Admin API (for members or blog post content behind subscribption)
- 📚 Export specific or all blog Posts in Markdown format to the folder of your choice.
- ⚙️ Display or export to JSON your Tags, Tiers, Authors, Members (Admin API only)
- 📶 Connect / Disconnect from the Blog
This tool was developped and tested mostly for Ghost versions 5.x.
- Ghost 5^
- TypeScript
- Clack to build beautiful prompts.
- @ts-ghost/content-api for TypeSafe 🦾 interaction with the Ghost Content API.
Use directly with npx
npx @ts-ghost/ghost-blog-buster
Or install globally
npm install -g @ts-ghost/ghost-blog-buster
Then, in a new SHELL session, launch with
ghost-blog-buster
If you want to bypass the interactive prompts, you can use the CLI with pipeable commands.
For example if we already configured the URL and the Content API key, we can export all the posts to the ./posts
folder with the following command:
ghost-blog-buster export posts --output ./posts
-
--host
or-h
: The URL of the blog (if not provided, it will check your config file that is filled by the interactive prompt) -
--key
or-k
: The Content API key (if not provided, it will check your config file that is filled by the interactive prompt) -
--output
or-o
: The destination folder. If no output is provided, content will go to stdout.
Full example:
ghost-blog-buster export posts --host https://astro-starter.digitalpress.blog --key e9b414c5d95a5436a647ff04ab --output ./posts
Available export
ghost-blog-buster --help
This export use the Admin API and require you to provide the Admin API key. An Admin API key is different from the Content API key. You can either use a Staff access token, visible at the bottom of a Ghost User profile or you can find it in your Ghost Admin panel, in the Integrations section.
This is useful if your Blog Posts contain a free preview, paid content and you want to export everything.
ghost-blog-buster export-admin posts --output ./posts
-
--host
or-h
: The URL of the blog (if not provided, it will check your config file that is filled by the interactive prompt) -
--key
or-k
: The Content API key (if not provided, it will check your config file that is filled by the interactive prompt) -
--output
or-o
: The destination folder. If no output is provided, content will go to stdout.
Full example:
ghost-blog-buster export-admin posts --host https://astro-starter.digitalpress.blog --key 1efedd9db174adee2d23d982:4b74dca0219bad629852191af326a45037346c2231240e0f7aec1f9371cc14e8 --output ./posts
Available export-admin <resource>
resources:
posts
pages
members
You can use >
to pipe the content into a file or something else.
ghost-blog-buster export authors --host https://astro-starter.digitalpress.blog --key e9b414c5d95a5436a647ff04ab > authors.json
- [ ] Interact with more content
- [ ] Customize the frontmatter output
- [x] Usage without interactive prompts, pipeable cmds
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- If you have suggestions for adding or removing projects, feel free to open an issue to discuss it, or directly create a pull request after you edit the README.md file with necessary changes.
- Please make sure you check your spelling and grammar.
- Create individual PR for each suggestion.
- Please also read through the Code Of Conduct before posting your first idea as well.
Distributed under the MIT License. See LICENSE for more information.
- PhilDL - Creator