JSPM

wp-rest-cli

1.2.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q39294F
  • License MIT

WordPress REST API CLI tool - manage posts, pages, media, categories, and tags from the command line

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (wp-rest-cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    wp-rest-cli

    WordPress REST API CLI tool — manage posts, pages, media, categories, and tags from the command line.

    Install

    npm install -g wp-rest-cli

    Setup

    Configure your WordPress site URL and authentication:

    wp-rest config set-url https://your-site.com
    wp-rest config set-auth username password

    Usage

    # Posts
    wp-rest post list
    wp-rest post get <id>
    wp-rest post create --title "Hello" --content "World"
    wp-rest post update <id> --title "Updated"
    wp-rest post delete <id>
    
    # Pages
    wp-rest page list
    wp-rest page get <id>
    wp-rest page create --title "About" --content "About us"
    
    # Media
    wp-rest media list
    wp-rest media upload <file>
    
    # Categories
    wp-rest category list
    wp-rest category create --name "Tech"
    
    # Tags
    wp-rest tag list
    wp-rest tag create --name "javascript"

    Requirements

    • Node.js >= 18.0.0
    • WordPress site with REST API enabled
    • Application Passwords or Basic Auth plugin

    License

    MIT