kynetcode/wpzylos-cli-devtool
Composer 安装命令:
composer require kynetcode/wpzylos-cli-devtool
包简介
Development CLI tool for scaffolding WPZylos plugins with generators for controllers, requests, migrations, and more
关键字:
README 文档
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 KYNetCode/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 php vendor/bin:
php vendor/bin/wpzylos list php 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:
php 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 ./php 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 KYNetCode
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2026-06-16