← 返回
未分类 Key 中文

WordPress REST API CLI

OpenClaw skill that provides a WordPress REST API CLI for posts, pages, categories, tags, users, and custom requests using plain HTTP.
OpenClaw 技能,提供 WordPress REST API 命令行接口,用于文章、页面、分类、标签、用户及自定义请求,使用纯 HTTP。
akkualle akkualle 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 需要
★ 0
Stars
📥 349
下载
💾 0
安装
1
版本
#latest

概述

WordPress REST API Skill (Advanced)

Purpose

Provide a production-ready CLI for WordPress REST API automation. This skill focuses on content workflows (posts/pages), taxonomy (categories/tags), user reads, and safe custom requests without external HTTP libraries.

Best fit

  • You want a stable CLI for automation and bot workflows.
  • You need JSON-in/JSON-out for pipelines.
  • You prefer simple HTTP with no extra dependencies.

Not a fit

  • You must handle OAuth flows or complex browser-based auth.
  • You need advanced media uploads (multipart streaming).

Requirements

  • Node.js 18+ (for native fetch).

One-time setup

  1. Enable the WordPress REST API (default in modern WordPress).
  2. Create an Application Password for a WordPress user.
  3. Confirm the user has the right role (e.g., Editor/Admin).

Install

cd wordpress
npm install

Run

node scripts/wp-cli.js help
node scripts/wp-cli.js posts:list --query per_page=5
node scripts/wp-cli.js posts:create '@post.json'

You can also use npm:

npm run wp -- posts:list --query per_page=5

Credentials

Supported options (first match wins):

  • Basic auth token: WP_BASIC_TOKEN (base64 of user:app_password)
  • User + app password: WP_USER + WP_APP_PASSWORD
  • JWT bearer token: WP_JWT_TOKEN

Required env

  • WP_BASE_URL (e.g., https://example.com)

Input conventions

  • JSON can be inline or loaded from file with @path.
  • Query params use --query key=value (repeatable) or --query key1=value1,key2=value2.

Command map (high level)

Posts:

  • posts:list, posts:get, posts:create, posts:update, posts:delete

Pages:

  • pages:list, pages:get, pages:create, pages:update, pages:delete

Taxonomy:

  • categories:list, categories:create
  • tags:list, tags:create

Users:

  • users:list, users:get

Advanced:

  • request (raw method + path)

Operational guidance

  • Prefer context=view for read-only list calls.
  • Use status=draft when staging content.
  • Implement retries for 429 and transient 5xx errors in orchestrators.

Expected output

  • JSON to stdout; non-zero exit code on errors.

Security notes

  • Never log or commit tokens or application passwords.
  • Use a dedicated low-privilege WordPress account where possible.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-07 05:05 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Keyword Research

akkualle
SEO关键词研究工具,用于高价值关键词的搜索意图分析、难度评估和内容机会映射。
★ 0 📥 408

Accounting Assistant

akkualle
会计自动化:EÜR编制、DATEV导出、PDF凭证分析、税务准备,适合自由职业者和中小企业
★ 0 📥 379

Amazon PA-API Integration

akkualle
使用 Amazon Product Advertising API (PA‑API) 搜索亚马逊商品并获取商品详情,适用于商品搜索、价格查询及推广链接。
★ 0 📥 422