OA0 = Omni AI 0
OA0 是一个探索 AI 的论坛
现在注册
已注册用户请  登录
OA0  ›  技能包  ›  ecto:通过 Admin API 管理 Ghost.io 博客系统的技能

ecto:通过 Admin API 管理 Ghost.io 博客系统的技能

 
  automation ·  2026-02-20 02:48:50 · 3 次点击  · 0 条评论  

名称: ecto
描述: 用于管理博客文章、页面、标签和内容的 Ghost.io 管理 API 命令行工具。


ecto - Ghost.io 管理 API 命令行工具

通过 Ghost.io 的管理 API 管理博客。支持多站点配置、Markdown 到 HTML 的转换以及用于脚本处理的 JSON 输出。

快速参考

身份验证

ecto auth add <名称> --url <ghost-url> --key <admin-api-key>
ecto auth list
ecto auth default <名称>
ecto auth remove <名称>

环境变量覆盖:GHOST_URL, GHOST_ADMIN_KEY, GHOST_SITE

文章管理

ecto posts [--status draft|published|scheduled|all] [--limit N] [--json]
ecto post <id|slug> [--json] [--body]
ecto post create --title "标题" [--markdown-file file.md] [--stdin-format markdown] [--tag tag1,tag2] [--status draft|published]
ecto post edit <id|slug> [--title "新标题"] [--markdown-file file.md] [--status draft|published]
ecto post delete <id|slug> [--force]
ecto post publish <id|slug>
ecto post unpublish <id|slug>
ecto post schedule <id|slug> --at "2025-01-25T10:00:00Z"

页面管理

ecto pages [--status draft|published|all] [--limit N] [--json]
ecto page <id|slug> [--json] [--body]
ecto page create --title "标题" [--markdown-file file.md] [--status draft|published]
ecto page edit <id|slug> [--title "新标题"] [--markdown-file file.md]
ecto page delete <id|slug> [--force]
ecto page publish <id|slug>

标签管理

ecto tags [--json]
ecto tag <id|slug> [--json]
ecto tag create --name "标签名" [--description "描述"]
ecto tag edit <id|slug> [--name "新名称"] [--description "描述"]
ecto tag delete <id|slug> [--force]

图片管理

ecto image upload <路径> [--json]

站点信息

ecto site [--json]
ecto settings [--json]
ecto users [--json]
ecto user <id|slug> [--json]
ecto newsletters [--json]
ecto newsletter <id> [--json]

Webhooks

ecto webhook create --event <事件> --target-url <url> [--name "钩子名称"]
ecto webhook delete <id> [--force]

支持的事件:post.published, post.unpublished, post.added, post.deleted, page.published 等。

多站点支持

使用 --site <名称> 来指定一个已配置的站点:

ecto posts --site blog2

常用工作流

从 Markdown 文件创建并发布文章:

ecto post create --title "我的文章" --markdown-file post.md --tag blog --status published

从标准输入管道传入内容:

echo "# 你好,世界" | ecto post create --title "快速文章" --stdin-format markdown

定时发布文章:

ecto post schedule future-post --at "2025-02-01T09:00:00Z"

批量发布草稿:

for id in $(ecto posts --status draft --json | jq -r '.posts[].id'); do
  ecto post publish "$id"
done

限制

  • Ghost API 不支持列出图片或 Webhooks
  • 成员/订阅管理无法通过管理 API 实现
  • 对用户信息仅有只读权限

完整文档

运行 ecto --ai-help 获取完整的文档。

3 次点击  ∙  0 人收藏  
登录后收藏  
目前尚无回复
0 条回复
About   ·   Help   ·    
OA0 - Omni AI 0 一个探索 AI 的社区
沪ICP备2024103595号-2
Developed with Cursor