闲社服务运行正常AI智能体自动化平台
g

Ghost CMS管理

技能标识:ghost

Manage Ghost CMS blog posts via Admin API. Supports creating, updating, deleting, and listing posts. NEW: Upload images and set feature images for posts. Use when the user needs to programmatically manage Ghost blog content. Requires a JSON configuration file with API credentials.

作者:admin | 来源记录:ClawHub
登记来源
ClawHub
版本
V 1.0.5
检测标记
后台标记通过
免费
免费获取
2
收藏
来源与检测标记为平台登记信息,并不代表已展示可复核的检测报告。使用前请核对版本、依赖和所需权限,建议先在隔离环境中运行。
概述
安装方式
版本历史

Ghost CMS管理

Ghost CMS 管理 API

通过管理 API 以编程方式管理您的 Ghost 博客文章。

功能特性

  • - 📝 创建/更新/删除文章 - 完整的增删改查操作
  • 🖼️ 上传图片 - 上传图片到 Ghost 并获取 URL
  • 🎨 特色图片 - 为文章设置封面图片
  • 📊 文章列表 - 查看最近文章及其状态
  • 🏷️ 标签支持 - 为文章添加标签

前置条件

1. 获取管理 API 密钥

  1. 1. 登录您的 Ghost 管理面板(https://your-blog.com/ghost/)
  2. 进入 设置 → 集成
  3. 点击 添加自定义集成
  4. 复制 管理 API 密钥(格式:id:secret)

2. 创建配置文件

唯一调用方式:自定义配置文件路径(项目隔离)

为您的站点创建一个 JSON 配置文件:

示例:/Users/ethan/.openclaw/workspace/projects/fuye/ghost-admin.config.json
json
{
api_url: https://fu-ye.com/ghost/api/admin,
adminapikey: your-id:your-secret
}

CLI 使用方式

方法:自定义配置路径(唯一方式)

bash
python3 scripts/ghost.py list --config ../../projects/fuye/ghost-admin.config.json
python3 scripts/ghost.py create 标题 内容 --config ../../projects/fuye/ghost-admin.config.json
python3 scripts/ghost.py upload image.png --config ../../projects/fuye/ghost-admin.config.json

Python API 使用方式

方法:自定义配置路径(唯一方式)

python
import sys
import os
sys.path.insert(0, os.path.expanduser(~/.openclaw/workspace/skills/ghost/scripts))
import ghost

唯一方式:通过配置文件路径获取配置

config = ghost.getconfig(configpath=../../projects/fuye/ghost-admin.config.json)

创建文章

result = ghost.create_post( config=config, title=我的文章标题, content=

标题

内容...

, status=published, tags=[技术, 新闻] )

3. 安装依赖

bash
pip3 install requests pyjwt --user

Python API 使用方式

创建文章

python
import sys
import os
sys.path.insert(0, os.path.expanduser(~/.openclaw/workspace/skills/ghost/scripts))
import ghost

通过配置文件路径获取配置(唯一方式)

config = ghost.getconfig(configpath=../../projects/fuye/ghost-admin.config.json)

使用 HTML 内容创建文章

result = ghost.create_post( config=config, title=我的文章标题, content=

标题

内容...

, # HTML 格式 status=published, # 或 draft tags=[技术, 新闻] )

上传图片

python

上传图片并获取 URL


imageurl = ghost.uploadimage(config, /path/to/image.jpg)
print(f图片 URL: {image_url})

创建带特色图片的文章

python

先上传封面图片


coverimageurl = ghost.upload_image(config, cover.jpg)

创建带特色图片的文章

result = ghost.create_post( config=config, title=带封面的文章, content=

文章内容...

, status=published, featureimage=coverimage_url, # 设置封面图片 tags=[精选] )

文章列表

python
posts = ghost.list_posts(config, limit=20)
for post in posts:
print(f{post[title]} - {post[status]})

更新文章

python
ghost.update_post(
config=config,
post_id=文章ID,
title=新标题,
status=published
)

CLI 使用方式

设置

bash

安装依赖


pip3 install requests pyjwt --user

创建文章

保存为草稿(默认):
bash
python3 scripts/ghost.py create 我的文章标题

HTML格式的文章内容

--config ../../projects/fuye/ghost-admin.config.json

立即发布:
bash
python3 scripts/ghost.py create 突发新闻

内容在这里

--status published --config ../../projects/fuye/ghost-admin.config.json

带标签:
bash
python3 scripts/ghost.py create 科技新闻

内容

--status published --tags 科技,新闻,AI --config ../../projects/fuye/ghost-admin.config.json

上传图片

bash
python3 scripts/ghost.py upload cover.png --config ../../projects/fuye/ghost-admin.config.json

更新文章

bash

更新标题


python3 scripts/ghost.py update 5f8c3c2e8c3d2e1f3a4b5c6d --title 新标题 --config ../../projects/fuye/ghost-admin.config.json

更新内容

python3 scripts/ghost.py update 5f8c3c2e8c3d2e1f3a4b5c6d --content

新内容

--config ../../projects/fuye/ghost-admin.config.json

发布草稿

python3 scripts/ghost.py update 5f8c3c2e8c3d2e1f3a4b5c6d --status published --config ../../projects/fuye/ghost-admin.config.json

删除文章

bash
python3 scripts/ghost.py delete 5f8c3c2e8c3d2e1f3a4b5c6d --config ../../projects/fuye/ghost-admin.config.json

文章列表

bash

列出最近10篇文章(默认)


python3 scripts/ghost.py list --config ../../projects/fuye/ghost-admin.config.json

列出20篇文章

python3 scripts/ghost.py list 20 --config ../../projects/fuye/ghost-admin.config.json

常见工作流程

发布带封面图片的文章

python
import sys
import os
sys.path.insert(0, os.path.expanduser(~/.openclaw/workspace/skills/ghost/scripts))
import ghost

唯一方式:通过配置文件路径获取配置

config = ghost.getconfig(configpath=../../projects/fuye/ghost-admin.config.json)

上传封面图片

imageurl = ghost.uploadimage(config, /path/to/cover.jpg)

创建带封面的文章

result = ghost.create_post( config=config, title=精选文章, content=

文章内容...

, status=published, featureimage=imageurl, tags=[精选, 技术] )

print(f已发布: {result[url]})

批量操作

bash

列出所有草稿


python3 scripts/ghost.py list 100 --config ../../projects/fuye/ghost-admin.config.json | grep 🟡

更新特定文章

python3 scripts/ghost.py update --tags 精选 --config ../../projects/fuye/ghost-admin.config.json

API 参考

ghost.getconfig(configpath)

唯一方式获取配置。

参数:

  • - config_path - JSON 配置文件路径(例如:../../projects/fuye/ghost-admin.config.json)

返回: 包含 apiurl 和 adminapi_key 的配置字典

ghost.createpost(config, title, content, status=draft, tags=None, featureimage=None)

创建新文章。

参数:

  • - config - 从 getconfig(configpath) 获取的配置字典
  • title - 文章标题
  • content - HTML 内容
  • status - draft 或 published
  • tags - 标签名称列表
  • feature_image - 封面图片 URL(可选)

返回: 包含 id、url、status 的文章字典

ghost.uploadimage(config, imagepath)

上传图片到 Ghost。

参数:

  • - config - 配置字典
  • image_path - 图片文件的本地路径

返回: 图片 URL 字符串

ghost.list_posts(config, limit=10)

列出最近文章。

返回: 文章字典列表

ghost.updatepost(config, postid, kwargs)

更新现有文章。

参数:

  • - post_id - 要更新的文章 ID
  • title -

标签

skill ai

通过对话安装

以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 ghost-1776064142 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 ghost-1776064142 技能

通过命令行安装

skillhub install ghost-1776064142

下载

⬇ 下载 ghost v1.0.5(免费)

文件大小: 8.55 KB | 发布时间: 2026-4-14 12:21

v1.0.5 最新 2026-4-14 12:21
Initial release with full Ghost CMS blog management via Admin API, including image uploads:

- Create, update, delete, and list blog posts through Ghost Admin API
- NEW: Upload images and set feature images (cover images) for posts
- Full CLI and Python API support for all actions
- Tag management on posts
- Unique configuration via explicit JSON config path for secure, project-based isolation
返回顶部