CLI reference
rustcms creates applications and generates code. Other commands run inside the application in the current directory (cargo run -- <command>), or with its binary (./blog <command>); cargo run -- --help lists them all, the application's own included.
Global commands
new
Create a new application
| Argument | Description |
|---|---|
<name> | Package name (lowercase letters, digits, - and _) |
--path | Parent directory (default: .) |
--in-workspace | Do not declare a standalone [workspace] (for apps inside another workspace) |
--no-fetch | Do not resolve the dependencies (Cargo.lock is written on the first build) |
make:model
Create a SeaORM entity in src/models
| Argument | Description |
|---|---|
<name> | Model name in PascalCase, e.g. BlogPost |
-m, --migration | Also create a create_<table>_table migration |
make:resource
Create an admin resource in src/admin/resources for a model
| Argument | Description |
|---|---|
<model> | Model name in PascalCase (the model must exist in src/models) |
--generate | Generate fields, form, table and filters from the model's columns |
--belongs-to | Relationship select for a column: category_id=categories (repeatable) |
make:policy
Create a policy in src/policies
| Argument | Description |
|---|---|
<name> | Policy name in PascalCase, e.g. PostPolicy |
make:migration
Create a migration in src/database/migrations
| Argument | Description |
|---|---|
<name> | snake_case name; create_<table>_table generates a table skeleton |
make:test
Create a feature test in tests/feature
| Argument | Description |
|---|---|
<name> | Test name in PascalCase, e.g. PostAdminTest |
make:api
Create a JSON API for a model: controller, JSON resource and routes (list and show)
| Argument | Description |
|---|---|
<model> | Model name in PascalCase (the model must exist in src/models) |
make:service
Create a service (business rules) in src/services
| Argument | Description |
|---|---|
<name> | Name ending in Service, e.g. EnrollmentService |
make:job
Create a background job in src/jobs and register it
| Argument | Description |
|---|---|
<name> | Job name in PascalCase, e.g. SendWelcome |
make:seeder
Create a seeder in src/database/seeders and register it
| Argument | Description |
|---|---|
<name> | Name ending in Seeder, e.g. CourseSeeder |
make:factory
Create a model factory in src/database/factories
| Argument | Description |
|---|---|
<model> | Model name in PascalCase (the model must exist in src/models) |
make:settings
Create a settings group (src/settings) and its admin page (src/admin/pages)
| Argument | Description |
|---|---|
<name> | Name ending in Settings, e.g. SchoolSettings |
make:command
Create a console command in src/console and register it
| Argument | Description |
|---|---|
<name> | Command name, e.g. lms:report |
make:page
Create a custom admin page: src/admin/pages + a template in resources/views/admin (or a script)
| Argument | Description |
|---|---|
<name> | Name ending in Page, e.g. CourseOverviewPage |
--script | Draw it with an extension script (resources/admin/js) instead of a template |
--react | Draw it with a React component (resources/admin/src, host API v2, built with npm) |
make:sdk
Install or update the admin SDK in resources/admin/sdk (edited files are kept)
make:widget
Create an admin widget script in resources/admin/js
| Argument | Description |
|---|---|
<name> | Widget name, vendor/name, e.g. acme/color |
agents
Write or refresh the kit for AI agents: AGENTS.md, CLAUDE.md, .claude/skills (edited files are kept)
| Argument | Description |
|---|---|
--dry-run | Show what would change without writing it |
--force | Replace kit files you edited (the changes are printed first) |
doctor
Check that this machine can build an application
upgrade
Move the application to this command's RustCMS version (Cargo.toml and Cargo.lock)
| Argument | Description |
|---|---|
--dry-run | Show the changes without writing them |
--force | Allow going back to an older version |
self-update
Replace this command with the latest release (installed by install.sh)
| Argument | Description |
|---|---|
--version | A given release instead of the latest, e.g. v0.4.0 (may be older) |
docs
Open the guide of this version in a browser
| Argument | Description |
|---|---|
--print-path | Print its URL instead of opening it |
docs:cli
Print the command reference as Markdown
Application commands
serve
Start the HTTP server
| Argument | Description |
|---|---|
--listen | Address to listen on (default: app.listen) |
--api-only | Serve the application API only, without the admin panel (app.mode = "api") |
--watch | With rustcms only (macOS, Linux): rebuild and replace the server when the application's files change; a failed build keeps the running server |
migrate
Run pending migrations
| Argument | Description |
|---|---|
--allow-newer | Accept migrations applied by a newer version (after a rollback): they are logged and left as they are; this version's pending ones run |
migrate:rollback
Roll back the last migrations
| Argument | Description |
|---|---|
--step | Number of migrations to roll back (default: 1) |
migrate:fresh
Drop all tables and re-run every migration
| Argument | Description |
|---|---|
--force | Required in production |
--seed | Run the database seeder afterwards |
migrate:refresh
Roll back every migration and run them again
| Argument | Description |
|---|---|
--force | Required in production |
migrate:status
Show applied and pending migrations
db:seed
Seed the database (the database seeder, or --class <name>)
| Argument | Description |
|---|---|
--class | Seeder to run (default: database) |
--force | Required in production |
route:list
List the HTTP routes described by the framework, providers and the application
key:generate
Generate APP_KEY and write it to .env
| Argument | Description |
|---|---|
--show | Print the key instead of writing .env |
--force | Replace an existing APP_KEY |
queue:work
Run queued jobs until stopped (Ctrl-C / SIGTERM lets running jobs finish)
| Argument | Description |
|---|---|
--queue | Queue to take jobs from (repeatable; default: queue.queues) |
--once | Run the jobs ready now (at most 1,000), then exit |
--workers | Workers (default: queue.workers) |
queue:failed
List failed jobs
queue:retry
Run failed jobs again (attempts start over)
| Argument | Description |
|---|---|
<id> | Job id |
--all | Every failed job |
queue:forget
Delete failed jobs
| Argument | Description |
|---|---|
<id> | Job id |
--all | Every failed job |
key:reencrypt
Seal every encrypted column and settings secret with APP_KEY (after a rotation)
| Argument | Description |
|---|---|
--dry-run | Check and count; write nothing |
--list | List the encrypted columns and exit |
--batch | Rows read at a time (default: 500) |
schedule:list
List the schedules, their next slot and their last claimed slot
schedule:run
Run a schedule now (a manual run: no slot claim, no grace, no without_overlapping; a job is enqueued for the workers, a run runs here)
| Argument | Description |
|---|---|
<name> | The schedule's name |
Auth commands
Added by AuthProvider (registered in new applications).
make:user
Create a user (prints a generated password if none is given)
| Argument | Description |
|---|---|
--email | Sign-in email |
--name | Display name |
--password | Password (default: generated) |
--super-admin | Grant the super_admin role |
--guard | Guard of the super_admin role (default: admin) |
role:assign
Give an existing user a role (super_admin or any role) of a guard
| Argument | Description |
|---|---|
--email | User email |
--role | Role name, e.g. super_admin |
--guard | Guard of the role (admin, api) (default: admin) |
token:create
Issue an API token for a user (printed once)
| Argument | Description |
|---|---|
--email | Owner email |
--name | Token label |
--abilities | Comma-separated abilities (default: *) |
--expires-days | Lifetime in days (1 to 3650) |
permission:sync
Create declared permissions and mark undeclared ones orphaned
session:prune
Delete expired admin sessions and ended JWT sign-ins
audit:prune
Delete audit log entries older than audit.retention_days (also done hourly by serve)
Admin panel commands
Added by AdminProvider (media:prune with media()).
idempotency:prune
Delete expired idempotency keys of admin writes
media:prune
Delete queued media files and abandoned uploads
lang:missing
List the admin labels without a translation, as TOML to add to the catalog (lang/vi.toml, …)
| Argument | Description |
|---|---|
<locale> | Language, e.g. vi |
admin:branding
Show where the panel's branding comes from, and load it once to check it (changes nothing)