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
route:conflictsDetect overlapping route definitions (reads the routes cache)
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 listenerCreate a new listener
make notificationCreate a new notification
make ruleCreate a new validation rule
make commandCreate a new CLI command
make factoryCreate a new factory
make mailCreate a new mail class
make scopeCreate a new query scope
make observerCreate a new model observer
make resourceCreate a new API resource
make providerCreate a new service provider
make broadcast-eventCreate a new broadcast event
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
queue:failedList all failed jobs
queue:retryRetry a failed job by id, or all
queue:forgetForget a failed job by id
queue:flushForget all failed jobs
aboutDisplay framework and environment information
optimizeCache config and routes for faster boot
optimize:clearClear the config and route caches
config:showDisplay the values of a config section (e.g. config:show app)
downPut the application into maintenance mode (writes storage/framework/down)
upBring the application out of maintenance mode
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

Maintenance Mode

down writes storage/framework/down to enable maintenance mode; up removes it. A secret enables the timing-safe bypass (Laravel 13.23 parity — comparison is constant-time, no ==):

bash
larastvel down --with-secret
# Application is now in maintenance mode.
# You may bypass maintenance mode via [/RANDOM-SECRET].

larastvel down --secret my-secret
larastvel up

Bypass requests are compared in constant time against the stored secret via MaintenanceMode::bypass_secret_matches(path) (hash_equals-style, Laravel 13.23 PR #60896).

Global Installation

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

Released under the MIT License.