Skip to content

CLI Reference

Larastvel ships with an Artisan-like CLI.

Commands

CommandDescription
serveStart the development server
key:generateGenerate a 32-byte base64 encryption key
route:listList all registered routes
route:cacheCache routes for faster resolution
route:clearClear cached routes
config:cacheCache configuration
config:clearClear cached configuration
migrateRun pending database migrations
make:modelCreate a new model
make:controllerCreate a new controller
make:migrationCreate a new migration
make:seederCreate a new seeder
make:policyCreate a new policy
make:testCreate a new test
make:jobCreate a new job
make:eventCreate a new event
make:notificationCreate a new notification
make:ruleCreate a new validation rule
make:mailCreate a new mail class
make:commandCreate a new CLI command
db:seedSeed the database
notifications:tableCreate notifications migration
storage:linkCreate a symbolic link from public/storage to storage/app/public
schedule:listList scheduled tasks
schedule:runRun due scheduled tasks
queue:workStart processing queued jobs
versionDisplay framework version

Usage

bash
# Run via cargo
cargo run -p larastvel-cli -- serve
cargo run -p larastvel-cli -- key:generate
cargo run -p larastvel-cli -- make model User
cargo run -p larastvel-cli -- route:list
cargo run -p larastvel-cli -- migrate
cargo run -p larastvel-cli -- queue:work

# Or after installation
larastvel serve
larastvel make:controller PostController

Dev Server

The serve command starts the Axum server with auto-reload support:

bash
cargo run -p larastvel-cli -- serve
# Listening on http://localhost:8080

Global Installation

bash
cargo install larastvel-cli
larastvel serve
larastvel make:controller PostController

Released under the MIT License.