SZ-Rust CLI — 命令行工具
替代 PHP think 命令,借鉴 Laravel Artisan 风格。
PHP 对齐
本包对齐 PHP ThinkPHP 6 think 命令体系:
php think make:model→sz-rust make:modelphp think make:controller→sz-rust make:controllerphp think make:migration→sz-rust make:migration(Phinx 风格)php think migrate→sz-rust migratephp think migrate:status→sz-rust migrate:statusphp think route:list→sz-rust route:listphp think cache:clear→sz-rust cache:clear
模块结构
| 模块 | 功能 |
|---|---|
cli |
clap 命令定义(Cli / Commands / Options) |
console |
自定义命令注册与分发(对齐 PHP think\console\Console) |
cmd::make |
make:* 代码生成命令 |
cmd::migrate |
migrate / migrate:status 迁移命令 |
cmd::route |
route:list 路由列表命令 |
cmd::cache |
cache:clear 缓存清理命令 |
cmd::scheduler |
scheduler:* 调度器命令 |
error |
CLI 错误类型 |
stubs |
代码生成模板(对齐 PHP make/stubs) |
R5 硬约束
- R5-48:
make:model生成 Model 骨架代码对齐 PHPthink\console\command\make\Model - R5-49:
make:controller生成 Controller 骨架代码对齐 PHPthink\console\command\make\Controller - R5-50:
migrate:status显示迁移进度对齐 PHPthink migrate:status - R5-51:
cache:clear清空缓存对齐 PHPthink cache:clear