wpdiggerstudio/wpzylos-wp-cli

WP-CLI bridge for WPZylos framework (only loaded when WP_CLI)

Fund package maintenance!
Paypal

Installs: 239

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/wpdiggerstudio/wpzylos-wp-cli

v1.1.0 2026-02-04 18:36 UTC

This package is auto-updated.

Last update: 2026-02-04 18:44:01 UTC


README

PHP Version License GitHub

WP-CLI bridge for WPZylos framework (only loaded when WP_CLI).

📖 Full Documentation | 🐛 Report Issues

✨ Features

  • Vendor Publish — Laravel-style config publishing
  • Migration Commands — Run/rollback database migrations
  • Cache Commands — Clear plugin caches
  • Custom Commands — Register plugin-specific WP-CLI commands
  • WP_CLI Only — Loaded only in CLI context
  • Scheduler Commands — Manage scheduled tasks

📋 Requirements

Requirement Version
PHP ^8.0
WordPress 6.0+
WP-CLI 2.0+

🚀 Installation

composer require wpdiggerstudio/wpzylos-wp-cli

📖 Quick Start

# Publish package configs (like Laravel)
wp myplugin vendor:publish --provider=RequirementsServiceProvider

# Run migrations
wp myplugin migrate

# Rollback last migration
wp myplugin migrate:rollback

# Clear cache
wp myplugin cache:clear

🛠️ Available Commands

Vendor Publish Commands (Laravel-style)

# Publish config from a specific provider
wp myplugin vendor:publish --provider=RequirementsServiceProvider

# Publish all package configs
wp myplugin vendor:publish --all

# Force overwrite existing files
wp myplugin vendor:publish --provider=RequirementsServiceProvider --force

# Publish by tag (e.g., config, views)
wp myplugin vendor:publish --tag=config

# List all publishable assets
wp myplugin vendor:publish:list

Migration Commands

# Run all pending migrations
wp myplugin migrate

# Rollback last batch
wp myplugin migrate:rollback

# Rollback and re-run all migrations
wp myplugin migrate:refresh

# Show migration status
wp myplugin migrate:status

Cache Commands

# Clear all plugin caches
wp myplugin cache:clear

# Clear specific cache
wp myplugin cache:clear --key=settings

Scheduler Commands

# List scheduled tasks
wp myplugin schedule:list

# Run a specific scheduled task
wp myplugin schedule:run task_name

🏗️ Creating Custom Commands

use WPZylos\Framework\WpCli\Command;

class ImportCommand extends Command
{
    protected string $signature = 'data:import';
    protected string $description = 'Import data from a file';

    public function handle(array $args, array $assoc_args): void
    {
        $file = $assoc_args['file'] ?? null;

        if (!$file) {
            $this->error('File path is required');
            return;
        }

        $this->info("Importing from {$file}...");

        // Import logic here

        $this->success('Import complete!');
    }
}

Registering Commands

// In your plugin's boot method
$app->registerCommand(ImportCommand::class);

📦 Related Packages

Package Description
wpzylos-core Application foundation
wpzylos-cli-core Stub compilation utilities
wpzylos-cli-devtool Development CLI commands
wpzylos-migrations Database migrations

📖 Documentation

For comprehensive documentation, tutorials, and API reference, visit wpzylos.com.

☕ Support the Project

If you find this package helpful, consider buying me a coffee! Your support helps maintain and improve the WPZylos ecosystem.

Donate with PayPal

📄 License

MIT License. See LICENSE for details.

🤝 Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

Made with ❤️ by WPDiggerStudio