productivity
Ghost CMS Lua API for KosmoKrator Agents
Agent-facing Lua documentation and function reference for the Ghost CMS KosmoKrator integration.Lua Namespace
Agents call this integration through app.integrations.ghost.*.
Use lua_read_doc("integrations.ghost") inside KosmoKrator to discover the same reference at runtime.
Call Lua from the Headless CLI
Use kosmo integrations:lua when a shell script, CI job, cron job, or another coding CLI should run a deterministic
Ghost CMS workflow without starting an interactive agent session.
kosmo integrations:lua --eval 'dump(app.integrations.ghost.api_delete({path = "example_path", query = "example_query"}))' --json kosmo integrations:lua --eval 'print(docs.read("ghost"))' --json
kosmo integrations:lua --eval 'print(docs.read("ghost.api_delete"))' --json Workflow file
Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.
local ghost = app.integrations.ghost
local result = ghost.api_delete({path = "example_path", query = "example_query"})
dump(result) kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json integrations:lua exposes app.integrations.ghost, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.ghost.default.* or app.integrations.ghost.work.* when you configured named credential accounts.
MCP-only Lua
If the script only needs configured MCP servers and does not need Ghost CMS, use the narrower mcp:lua command.
# Use mcp:lua for MCP-only scripts; use integrations:lua for this integration namespace.
kosmo mcp:lua --eval 'dump(mcp.servers())' --json Agent-Facing Lua Docs
This is the rendered version of the full Lua documentation exposed to agents when they inspect the integration namespace.
Ghost CMS Lua API Reference
Namespace: app.integrations.ghost
Ghost tools use the Ghost Admin API with an Admin API key in id:secret format. Update calls usually require the current updated_at value from Ghost to avoid overwriting stale content.
Content
local posts = app.integrations.ghost.list_posts({
params = { limit = 10, include = "tags,authors" }
})
local post = app.integrations.ghost.get_post({
id = "post-id",
params = { formats = "html,lexical", include = "tags,authors" }
})
app.integrations.ghost.create_post({
post = {
title = "Launch notes",
html = "<p>Hello</p>",
status = "draft"
}
})
Pages use the same pattern with list_pages, get_page, create_page, update_page, and delete_page.
Taxonomy And Authors
local tags = app.integrations.ghost.list_tags({ params = { limit = 100 } })
local authors = app.integrations.ghost.list_authors({})
Tag mutation tools accept a tag object and wrap it in Ghost’s native tags payload.
Members And Monetization
local members = app.integrations.ghost.list_members({
params = { filter = "status:free" }
})
local tiers = app.integrations.ghost.list_tiers({})
local offers = app.integrations.ghost.list_offers({})
local newsletters = app.integrations.ghost.list_newsletters({})
Use member, tier, and offer create/update tools only when the connected Admin API key has the matching Ghost permissions.
Webhooks And Site
local webhooks = app.integrations.ghost.list_webhooks({})
local site = app.integrations.ghost.get_site({})
Raw API Helpers
Use api_get, api_post, api_put, and api_delete for safe relative Admin API paths. Full URLs and parent-directory paths are rejected.
local response = app.integrations.ghost.api_get({
path = "/posts",
query = { limit = 5 }
})Raw agent markdown
# Ghost CMS Lua API Reference
Namespace: `app.integrations.ghost`
Ghost tools use the Ghost Admin API with an Admin API key in `id:secret` format. Update calls usually require the current `updated_at` value from Ghost to avoid overwriting stale content.
## Content
```lua
local posts = app.integrations.ghost.list_posts({
params = { limit = 10, include = "tags,authors" }
})
local post = app.integrations.ghost.get_post({
id = "post-id",
params = { formats = "html,lexical", include = "tags,authors" }
})
app.integrations.ghost.create_post({
post = {
title = "Launch notes",
html = "<p>Hello</p>",
status = "draft"
}
})
```
Pages use the same pattern with `list_pages`, `get_page`, `create_page`, `update_page`, and `delete_page`.
## Taxonomy And Authors
```lua
local tags = app.integrations.ghost.list_tags({ params = { limit = 100 } })
local authors = app.integrations.ghost.list_authors({})
```
Tag mutation tools accept a `tag` object and wrap it in Ghost's native `tags` payload.
## Members And Monetization
```lua
local members = app.integrations.ghost.list_members({
params = { filter = "status:free" }
})
local tiers = app.integrations.ghost.list_tiers({})
local offers = app.integrations.ghost.list_offers({})
local newsletters = app.integrations.ghost.list_newsletters({})
```
Use member, tier, and offer create/update tools only when the connected Admin API key has the matching Ghost permissions.
## Webhooks And Site
```lua
local webhooks = app.integrations.ghost.list_webhooks({})
local site = app.integrations.ghost.get_site({})
```
## Raw API Helpers
Use `api_get`, `api_post`, `api_put`, and `api_delete` for safe relative Admin API paths. Full URLs and parent-directory paths are rejected.
```lua
local response = app.integrations.ghost.api_get({
path = "/posts",
query = { limit = 5 }
})
``` local result = app.integrations.ghost.api_delete({path = "example_path", query = "example_query"})
print(result) Functions
api_delete Read
Call a safe relative Ghost Admin API path with DELETE.
- Lua path
app.integrations.ghost.api_delete- Full name
ghost.ghost_api_delete
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | yes | Relative API path. |
query | object | no | Optional query parameters. |
api_get Read
Call a safe relative Ghost Admin API path with GET.
- Lua path
app.integrations.ghost.api_get- Full name
ghost.ghost_api_get
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | yes | Relative API path. |
query | object | no | Optional query parameters. |
api_post Read
Call a safe relative Ghost Admin API path with POST.
- Lua path
app.integrations.ghost.api_post- Full name
ghost.ghost_api_post
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | yes | Relative API path. |
payload | object | no | JSON body. |
query | object | no | Optional query parameters. |
api_put Read
Call a safe relative Ghost Admin API path with PUT.
- Lua path
app.integrations.ghost.api_put- Full name
ghost.ghost_api_put
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | yes | Relative API path. |
payload | object | no | JSON body. |
query | object | no | Optional query parameters. |
create_member Write
Create a Ghost member.
- Lua path
app.integrations.ghost.create_member- Full name
ghost.ghost_create_member
| Parameter | Type | Required | Description |
|---|---|---|---|
member | object | yes | Member payload. |
create_offer Write
Create a Ghost offer.
- Lua path
app.integrations.ghost.create_offer- Full name
ghost.ghost_create_offer
| Parameter | Type | Required | Description |
|---|---|---|---|
offer | object | yes | Offer payload. |
create_page Write
Create a Ghost page.
- Lua path
app.integrations.ghost.create_page- Full name
ghost.ghost_create_page
| Parameter | Type | Required | Description |
|---|---|---|---|
page | object | yes | Page payload. |
create_post Write
Create a new blog post in Ghost CMS. Supports setting title, HTML content, status (draft or published), featured flag, tags, and authors.
- Lua path
app.integrations.ghost.create_post- Full name
ghost.ghost_create_post
| Parameter | Type | Required | Description |
|---|---|---|---|
title | string | yes | Post title. |
html | string | no | Post content as HTML. |
status | string | no | Post status. Defaults to "draft" if not specified. |
featured | boolean | no | Whether the post is featured (default: false). |
tags | array | no | Array of tag objects or tag name strings, e.g. ["News", {"name": "Engineering"}]. |
authors | array | no | Array of author objects or author email strings, e.g. ["admin@example.com"]. |
excerpt | string | no | Custom post excerpt / meta description. |
feature_image | string | no | URL for the featured/cover image. |
create_tag Write
Create a Ghost tag.
- Lua path
app.integrations.ghost.create_tag- Full name
ghost.ghost_create_tag
| Parameter | Type | Required | Description |
|---|---|---|---|
tag | object | yes | Tag payload. |
create_tier Write
Create a Ghost membership tier.
- Lua path
app.integrations.ghost.create_tier- Full name
ghost.ghost_create_tier
| Parameter | Type | Required | Description |
|---|---|---|---|
tier | object | yes | Tier payload. |
create_webhook Write
Create a Ghost webhook.
- Lua path
app.integrations.ghost.create_webhook- Full name
ghost.ghost_create_webhook
| Parameter | Type | Required | Description |
|---|---|---|---|
webhook | object | yes | Webhook payload. |
delete_member Write
Delete a Ghost member.
- Lua path
app.integrations.ghost.delete_member- Full name
ghost.ghost_delete_member
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | Member ID. |
delete_page Write
Delete a Ghost page by ID.
- Lua path
app.integrations.ghost.delete_page- Full name
ghost.ghost_delete_page
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | Page ID. |
delete_post Write
Delete a Ghost post by ID.
- Lua path
app.integrations.ghost.delete_post- Full name
ghost.ghost_delete_post
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | Post ID. |
delete_tag Write
Delete a Ghost tag.
- Lua path
app.integrations.ghost.delete_tag- Full name
ghost.ghost_delete_tag
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | Tag ID. |
delete_webhook Write
Delete a Ghost webhook.
- Lua path
app.integrations.ghost.delete_webhook- Full name
ghost.ghost_delete_webhook
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | Webhook ID. |
get_author Read
Get a Ghost author/user by ID.
- Lua path
app.integrations.ghost.get_author- Full name
ghost.ghost_get_author
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | Author/user ID. |
params | object | no | Optional query parameters. |
get_current_user Read
Get the currently authenticated Ghost admin user. Useful for verifying API credentials and checking user role/permissions.
- Lua path
app.integrations.ghost.get_current_user- Full name
ghost.ghost_get_current_user
| Parameter | Type | Required | Description |
|---|---|---|---|
fields | string | no | Comma-separated list of fields to return (e.g. "id,name,email,role"). |
get_member Read
Get a Ghost member by ID.
- Lua path
app.integrations.ghost.get_member- Full name
ghost.ghost_get_member
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | Member ID. |
params | object | no | Optional query parameters. |
get_newsletter Read
Get a Ghost newsletter by ID.
- Lua path
app.integrations.ghost.get_newsletter- Full name
ghost.ghost_get_newsletter
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | Newsletter ID. |
params | object | no | Optional query parameters. |
get_offer Read
Get a Ghost offer by ID.
- Lua path
app.integrations.ghost.get_offer- Full name
ghost.ghost_get_offer
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | Offer ID. |
params | object | no | Optional query parameters. |
get_page Read
Get a Ghost page by ID.
- Lua path
app.integrations.ghost.get_page- Full name
ghost.ghost_get_page
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | Page ID. |
params | object | no | Optional query parameters. |
get_post Read
Get a single Ghost blog post by ID. Returns full post content, metadata, tags, and authors.
- Lua path
app.integrations.ghost.get_post- Full name
ghost.ghost_get_post
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | The post UUID. |
fields | string | no | Comma-separated list of fields to return (e.g. "id,title,html,status"). |
include | string | no | Comma-separated related data to include: "tags", "authors", "tags,authors". |
formats | string | no | Content formats to return: "html", "plaintext", "mobiledoc" (default: "html"). |
get_site Read
Get Ghost site metadata.
- Lua path
app.integrations.ghost.get_site- Full name
ghost.ghost_get_site
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
get_tag Read
Get a Ghost tag by ID.
- Lua path
app.integrations.ghost.get_tag- Full name
ghost.ghost_get_tag
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | Tag ID. |
params | object | no | Optional query parameters. |
get_tier Read
Get a Ghost tier by ID.
- Lua path
app.integrations.ghost.get_tier- Full name
ghost.ghost_get_tier
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | Tier ID. |
params | object | no | Optional query parameters. |
list_authors Read
List Ghost authors/users.
- Lua path
app.integrations.ghost.list_authors- Full name
ghost.ghost_list_authors
| Parameter | Type | Required | Description |
|---|---|---|---|
params | object | no | Optional query parameters. |
list_members Read
List newsletter members from Ghost CMS. Supports filtering by subscription status, email search, and pagination. Returns member names, emails, labels, and subscription info.
- Lua path
app.integrations.ghost.list_members- Full name
ghost.ghost_list_members
| Parameter | Type | Required | Description |
|---|---|---|---|
page | integer | no | Page number (default: 1). |
limit | integer | no | Number of members per page (default: 15, max: 100). |
filter | string | no | Ghost filter syntax, e.g. "subscribed:true" or "email:@example.com". Use `+` for AND, `,` for OR. |
order | string | no | Sort order (default: "created_at desc"). Examples: "name asc", "email desc". |
fields | string | no | Comma-separated list of fields to return (e.g. "id,name,email,status"). |
list_newsletters Read
List Ghost newsletters.
- Lua path
app.integrations.ghost.list_newsletters- Full name
ghost.ghost_list_newsletters
| Parameter | Type | Required | Description |
|---|---|---|---|
params | object | no | Optional query parameters. |
list_offers Read
List Ghost offers.
- Lua path
app.integrations.ghost.list_offers- Full name
ghost.ghost_list_offers
| Parameter | Type | Required | Description |
|---|---|---|---|
params | object | no | Optional query parameters. |
list_pages Read
List static pages from Ghost CMS. Supports filtering, pagination, and ordering. Pages are non-blog content like "About", "Contact", etc.
- Lua path
app.integrations.ghost.list_pages- Full name
ghost.ghost_list_pages
| Parameter | Type | Required | Description |
|---|---|---|---|
page | integer | no | Page number (default: 1). |
limit | integer | no | Number of pages per page (default: 15, max: 100). |
filter | string | no | Ghost filter syntax, e.g. "status:published" or "slug:about". Use `+` for AND, `,` for OR. |
status | string | no | Filter by page status. Shorthand for filter "status:{value}". |
order | string | no | Sort order (default: "published_at desc"). Examples: "title asc", "created_at desc". |
fields | string | no | Comma-separated list of fields to return (e.g. "id,title,slug,status"). |
include | string | no | Comma-separated related data to include: "tags", "authors", "tags,authors". |
list_posts Read
List blog posts from Ghost CMS. Supports filtering by tag, author, status, and free-text search. Returns paginated results with post titles, slugs, status, and metadata.
- Lua path
app.integrations.ghost.list_posts- Full name
ghost.ghost_list_posts
| Parameter | Type | Required | Description |
|---|---|---|---|
page | integer | no | Page number (default: 1). |
limit | integer | no | Number of posts per page (default: 15, max: 100). |
filter | string | no | Ghost filter syntax, e.g. "tag:news+status:published" or "author:john". Use `+` for AND, `,` for OR. |
tag | string | no | Filter by tag slug (e.g. "news", "engineering"). Shorthand for filter "tag:{value}". |
author | string | no | Filter by author slug (e.g. "john"). Shorthand for filter "author:{value}". |
status | string | no | Filter by post status. Shorthand for filter "status:{value}". |
order | string | no | Sort order (default: "published_at desc"). Examples: "created_at desc", "title asc", "updated_at desc". |
fields | string | no | Comma-separated list of fields to return (e.g. "id,title,slug,status"). |
include | string | no | Comma-separated related data to include: "tags", "authors", "tags,authors". |
list_tags Read
List Ghost tags.
- Lua path
app.integrations.ghost.list_tags- Full name
ghost.ghost_list_tags
| Parameter | Type | Required | Description |
|---|---|---|---|
params | object | no | Optional query parameters. |
list_tiers Read
List Ghost paid membership tiers.
- Lua path
app.integrations.ghost.list_tiers- Full name
ghost.ghost_list_tiers
| Parameter | Type | Required | Description |
|---|---|---|---|
params | object | no | Optional query parameters. |
list_webhooks Read
List Ghost webhooks.
- Lua path
app.integrations.ghost.list_webhooks- Full name
ghost.ghost_list_webhooks
| Parameter | Type | Required | Description |
|---|---|---|---|
params | object | no | Optional query parameters. |
update_member Write
Update a Ghost member.
- Lua path
app.integrations.ghost.update_member- Full name
ghost.ghost_update_member
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | Member ID. |
member | object | yes | Member update payload. |
update_offer Write
Update a Ghost offer.
- Lua path
app.integrations.ghost.update_offer- Full name
ghost.ghost_update_offer
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | Offer ID. |
offer | object | yes | Offer update payload. |
update_page Write
Update a Ghost page.
- Lua path
app.integrations.ghost.update_page- Full name
ghost.ghost_update_page
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | Page ID. |
page | object | yes | Page update payload including updated_at. |
update_post Write
Update an existing blog post in Ghost CMS. Provide the post ID and any fields to change (title, content, status, featured flag, tags).
- Lua path
app.integrations.ghost.update_post- Full name
ghost.ghost_update_post
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | The post UUID to update. |
title | string | no | New post title. |
html | string | no | New post content as HTML. |
status | string | no | Change post status (draft or published). |
featured | boolean | no | Set or unset the featured flag. |
tags | array | no | Replace post tags. Array of tag name strings, e.g. ["News", "Engineering"]. |
excerpt | string | no | New custom excerpt / meta description. |
feature_image | string | no | New featured/cover image URL. |
updated_at | string | no | Last known updated_at timestamp for optimistic concurrency control. Prevents overwriting if the post was modified since you last read it. |
update_tag Write
Update a Ghost tag.
- Lua path
app.integrations.ghost.update_tag- Full name
ghost.ghost_update_tag
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | Tag ID. |
tag | object | yes | Tag update payload including updated_at. |
update_tier Write
Update a Ghost membership tier.
- Lua path
app.integrations.ghost.update_tier- Full name
ghost.ghost_update_tier
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | Tier ID. |
tier | object | yes | Tier update payload. |
update_webhook Write
Update a Ghost webhook.
- Lua path
app.integrations.ghost.update_webhook- Full name
ghost.ghost_update_webhook
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | Webhook ID. |
webhook | object | yes | Webhook update payload. |