wpdiggerstudio / wpzylos-cli-devtool
Development CLI tool for scaffolding WPZylos plugins with generators for controllers, requests, migrations, and more
Package info
github.com/WPDiggerStudio/wpzylos-cli-devtool
pkg:composer/wpdiggerstudio/wpzylos-cli-devtool
Fund package maintenance!
Requires
- php: ^8.0
- symfony/console: ^6.0 || ^7.0
- wpdiggerstudio/wpzylos-cli-core: ^1.0
Requires (Dev)
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^9.6 || ^10.0
- squizlabs/php_codesniffer: ^3.7
README
Development CLI tool for scaffolding WPZylos plugins and generating boilerplate code.
๐ Full Documentation | ๐ Report Issues
โจ Features
- 42 Generator Commands โ Controllers, models, migrations, events, and 38 more
- Smart Package Detection โ Warns if required packages are missing
- Auto Context Resolution โ Reads namespace/slug from
.plugin-config.json - Dry Run Mode โ Preview generated code before writing
๐ Requirements
| Requirement | Version |
|---|---|
| PHP | ^8.0 |
| Symfony Console | ^6.0 || ^7.0 |
๐ Installation
Install as a dev dependency in your plugin:
composer require --dev wpdiggerstudio/wpzylos-cli-devtool
๐ Quick Start
After installing the package, you have two options to run CLI commands:
Option 1: Use Vendor Binary Directly
Run commands directly from vendor/bin:
vendor/bin/wpzylos list vendor/bin/wpzylos make:controller ProductController
Option 2: Create Root Executable (Recommended)
For a cleaner experience like Laravel's php artisan, run the installer once:
vendor/bin/wpzylos-install
This creates a wpzylos file in your project root. Then use:
php wpzylos list php wpzylos make:controller ProductController php wpzylos make:request StoreProductRequest php wpzylos make:migration create_products_table
๐ ๏ธ Available Commands (45+)
Core Generators
| Command | Description | Output Path |
|---|---|---|
make:plugin |
Scaffold a complete new plugin | Project root |
make:controller |
REST/HTTP controller | app/Http/Controllers/ |
make:request |
FormRequest validation class | app/Http/Requests/ |
make:migration |
Database migration | database/migrations/ |
make:model |
Eloquent-style model | app/Models/ |
make:provider |
Service provider | app/Providers/ |
make:middleware |
HTTP middleware | app/Http/Middleware/ |
make:service |
Service class | app/Services/ |
make:config |
Configuration file | config/ |
make:rest |
REST API controller | app/Http/Controllers/ |
make:resource |
API resource transformer | app/Http/Resources/ |
WordPress-Specific
| Command | Description | Output Path |
|---|---|---|
make:posttype |
Custom post type | app/PostTypes/ |
make:taxonomy |
Custom taxonomy | app/Taxonomies/ |
make:shortcode |
Shortcode handler | app/Shortcodes/ |
make:menu |
Admin menu page | app/Admin/ |
make:settings |
Settings page | app/Admin/ |
make:metabox |
Meta box | app/Admin/ |
make:columns |
Admin list table columns | app/Admin/ |
make:widget |
WordPress widget | app/Widgets/ |
make:block |
Gutenberg block | app/Blocks/ |
Events & Lifecycle
| Command | Description | Output Path |
|---|---|---|
make:event |
Event class | app/Events/ |
make:listener |
Event listener | app/Listeners/ |
make:subscriber |
Event subscriber | app/Listeners/ |
make:observer |
Model observer | app/Observers/ |
make:action |
Action class | app/Actions/ |
make:filter |
Filter class | app/Filters/ |
Jobs & Scheduling
| Command | Description | Output Path |
|---|---|---|
make:job |
Queue job | app/Jobs/ |
make:cron |
Cron/scheduled task | app/Schedule/ |
make:schedule |
Schedule definition | app/Schedule/ |
Code Structure
| Command | Description | Output Path |
|---|---|---|
make:ajax |
AJAX handler | app/Http/Ajax/ |
make:asset |
Asset registration | app/Assets/ |
make:cast |
Attribute cast | app/Casts/ |
make:command |
CLI command | app/Commands/ |
make:enum |
Enum class | app/Enums/ |
make:exception |
Exception class | app/Exceptions/ |
make:factory |
Model factory | database/factories/ |
make:interface |
Interface/Contract | app/Contracts/ |
make:mail |
Mailable class | app/Mail/ |
make:notification |
Notification class | app/Notifications/ |
make:policy |
Authorization policy | app/Policies/ |
make:rule |
Validation rule | app/Rules/ |
make:scope |
Query scope | app/Scopes/ |
make:seeder |
Database seeder | database/seeders/ |
make:test |
PHPUnit test | tests/Unit/ |
make:trait |
Trait | app/Traits/ |
๐ง Configuration
The CLI tool automatically detects your plugin's configuration from .plugin-config.json:
{
"plugin": {
"namespace": "MyPlugin",
"slug": "my-plugin",
"prefix": "mp_",
"textDomain": "my-plugin",
"version": "1.0.0"
}
}
๐งช Testing
# Run all tests composer test # Run with coverage ./vendor/bin/phpunit --coverage-html coverage/
๐ฆ Related Packages
| Package | Description |
|---|---|
| wpzylos-cli-core | Stub compilation utilities |
| wpzylos-wp-cli | WP-CLI integration |
| wpzylos-scaffold | Plugin template |
| wpzylos-core | Application foundation |
๐ Documentation
For comprehensive documentation, tutorials, and API reference, visit wpzylos.com.
โ Support the Project
๐ License
MIT License. See LICENSE for details.
๐ค Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
Made with โค๏ธ by WPDiggerStudio