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
Requires
- php: ^8.0
- wpdiggerstudio/wpzylos-core: ^1.0
- wpdiggerstudio/wpzylos-database: ^1.0
- wpdiggerstudio/wpzylos-migrations: ^1.0
Requires (Dev)
- php-stubs/wp-cli-stubs: ^2.10
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^9.6 || ^10.0
- squizlabs/php_codesniffer: ^3.7
- szepeviktor/phpstan-wordpress: ^1.3
README
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.
📄 License
MIT License. See LICENSE for details.
🤝 Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
Made with ❤️ by WPDiggerStudio