sz-rust-cli 0.2.1

SZ-Rust 命令行工具:项目脚手架、数据库迁移、调度器管理
Documentation

SZ-Rust CLI — 命令行工具

替代 PHP think 命令,借鉴 Laravel Artisan 风格。

PHP 对齐

本包对齐 PHP ThinkPHP 6 think 命令体系:

  • php think make:modelsz-rust make:model
  • php think make:controllersz-rust make:controller
  • php think make:migrationsz-rust make:migration(Phinx 风格)
  • php think migratesz-rust migrate
  • php think migrate:statussz-rust migrate:status
  • php think route:listsz-rust route:list
  • php think cache:clearsz-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 骨架代码对齐 PHP think\console\command\make\Model
  • R5-49:make:controller 生成 Controller 骨架代码对齐 PHP think\console\command\make\Controller
  • R5-50:migrate:status 显示迁移进度对齐 PHP think migrate:status
  • R5-51:cache:clear 清空缓存对齐 PHP think cache:clear