wp-cli-extending

Official

Add safe, well-documented WP-CLI commands

Authorvikingokft
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill solves the problem of creating a robust, WordPress-plugin-friendly WP-CLI command surface that behaves correctly across environments and offers consistent help, validation, output formatting, and lifecycle timing.

Core Features & Use Cases

  • Class-based custom commands: Register commands using WP_CLI::add_command() with a class, leveraging PHPDoc for automatic help/synopsis generation and method-to-subcommand mapping.
  • Correct arg parsing and UX: Define positional args, --flag options, associative args, format presets, and prompt-friendly confirmation (confirm with --yes support).
  • Production-safe CLI behavior: Apply the mandatory registration guard (defined('WP_CLI') && WP_CLI), use WP_CLI I/O helpers (log/success/warning/error/debug), support calling other commands via WP_CLI::runcommand(), and use lifecycle hooks (before/after invoke and before/after WP load).
  • Automation for real tasks: Use for bulk import, data migration, queue/runner orchestration, scheduled job force-runs, cache clearing, and CLI debugging/introspection that is scriptable and pipeline-friendly.

Quick Start

Ask the AI to generate a WP plugin CLI command class that registers under wp myplugin and includes a guarded WP_CLI::add_command plus PHPDoc-defined options, a progress bar for batch work, and --format output using WP_CLI\Utils\format_items().

Dependency Matrix

Required Modules

None required

Components

references

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: wp-cli-extending
Download link: https://github.com/vikingokft/wp-agent-skills/archive/main.zip#wp-cli-extending

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.