Installation
Requirements
| Requirement | Version |
|---|---|
| PHP | ^8.0 |
| Composer | Any |
| Symfony Console | ^6.0 or ^7.0 |
Install as Dev Dependency
Install in your WPZylos plugin project:
composer require --dev KYNetCode/wpzylos-cli-devtool
Usage Options
After installation, you have two ways to run CLI commands:
Option 1: Vendor Binary (Default)
Use the CLI directly from the vendor bin directory:
vendor/bin/wpzylos <command>
Examples:
vendor/bin/wpzylos list
vendor/bin/wpzylos make:controller ProductController
vendor/bin/wpzylos make:request StoreProductRequest
vendor/bin/wpzylos make:migration create_products_table
This works immediately after installation with no additional setup.
Option 2: Root Executable (Recommended)
For a cleaner experience similar to Laravel's php artisan, you can create a root-level executable.
Step 1: Run the installer (one-time setup):
vendor/bin/wpzylos-install
This creates a wpzylos file in your project root directory.
Step 2: Use the shorter command:
php wpzylos <command>
Examples:
php wpzylos list
php wpzylos make:controller ProductController
php wpzylos make:request StoreProductRequest
php wpzylos make:migration create_products_table
Verify Installation
Check that the CLI is installed correctly:
# Using vendor binary
vendor/bin/wpzylos --version
vendor/bin/wpzylos list
# Or using root executable (after wpzylos-install)
php wpzylos --version
php wpzylos list
Expected output:
WPZylos CLI 1.0.0
Comparison: Which Option to Use?
| Feature | vendor/bin/wpzylos | php wpzylos |
|---|---|---|
| Setup Required | None | Run wpzylos-install once |
| Command Length | Longer | Shorter (like Laravel) |
| Works Immediately | Yes | After installer runs |
| Recommended For | Quick testing | Daily development |
Troubleshooting
Command Not Found
If vendor/bin/wpzylos is not found:
- Ensure the package is installed:
composer show KYNetCode/wpzylos-cli-devtool - Verify the bin file exists:
ls vendor/bin/wpzylos - Try reinstalling:
composer remove KYNetCode/wpzylos-cli-devtool composer require --dev KYNetCode/wpzylos-cli-devtool
Root Executable Not Created
If vendor/bin/wpzylos-install does not create the file:
- Check for error messages in the output
- Ensure you have write permissions in the project root
- If a wpzylos file already exists, delete it first and run again
Next Steps
- Overview - Learn about available commands
- Usage Guide - Detailed command usage
- Examples - Real-world examples
- Configuration - Configure the CLI