Skip to content

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

ArgumentDescription
<name>Package name (lowercase letters, digits, - and _)
--pathParent directory (default: .)
--in-workspaceDo not declare a standalone [workspace] (for apps inside another workspace)
--no-fetchDo not resolve the dependencies (Cargo.lock is written on the first build)

make:model ​

Create a SeaORM entity in src/models

ArgumentDescription
<name>Model name in PascalCase, e.g. BlogPost
-m, --migrationAlso create a create_<table>_table migration

make:resource ​

Create an admin resource in src/admin/resources for a model

ArgumentDescription
<model>Model name in PascalCase (the model must exist in src/models)
--generateGenerate fields, form, table and filters from the model's columns
--belongs-toRelationship select for a column: category_id=categories (repeatable)

make:policy ​

Create a policy in src/policies

ArgumentDescription
<name>Policy name in PascalCase, e.g. PostPolicy

make:migration ​

Create a migration in src/database/migrations

ArgumentDescription
<name>snake_case name; create_<table>_table generates a table skeleton

make:test ​

Create a feature test in tests/feature

ArgumentDescription
<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)

ArgumentDescription
<model>Model name in PascalCase (the model must exist in src/models)

make:service ​

Create a service (business rules) in src/services

ArgumentDescription
<name>Name ending in Service, e.g. EnrollmentService

make:job ​

Create a background job in src/jobs and register it

ArgumentDescription
<name>Job name in PascalCase, e.g. SendWelcome

make:seeder ​

Create a seeder in src/database/seeders and register it

ArgumentDescription
<name>Name ending in Seeder, e.g. CourseSeeder

make:factory ​

Create a model factory in src/database/factories

ArgumentDescription
<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)

ArgumentDescription
<name>Name ending in Settings, e.g. SchoolSettings

make:command ​

Create a console command in src/console and register it

ArgumentDescription
<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)

ArgumentDescription
<name>Name ending in Page, e.g. CourseOverviewPage
--scriptDraw it with an extension script (resources/admin/js) instead of a template
--reactDraw 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

ArgumentDescription
<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)

ArgumentDescription
--dry-runShow what would change without writing it
--forceReplace 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)

ArgumentDescription
--dry-runShow the changes without writing them
--forceAllow going back to an older version

self-update ​

Replace this command with the latest release (installed by install.sh)

ArgumentDescription
--versionA given release instead of the latest, e.g. v0.4.0 (may be older)

docs ​

Open the guide of this version in a browser

ArgumentDescription
--print-pathPrint its URL instead of opening it

docs:cli ​

Print the command reference as Markdown

Application commands ​

serve ​

Start the HTTP server

ArgumentDescription
--listenAddress to listen on (default: app.listen)
--api-onlyServe the application API only, without the admin panel (app.mode = "api")
--watchWith 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

ArgumentDescription
--allow-newerAccept 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

ArgumentDescription
--stepNumber of migrations to roll back (default: 1)

migrate:fresh ​

Drop all tables and re-run every migration

ArgumentDescription
--forceRequired in production
--seedRun the database seeder afterwards

migrate:refresh ​

Roll back every migration and run them again

ArgumentDescription
--forceRequired in production

migrate:status ​

Show applied and pending migrations

db:seed ​

Seed the database (the database seeder, or --class <name>)

ArgumentDescription
--classSeeder to run (default: database)
--forceRequired 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

ArgumentDescription
--showPrint the key instead of writing .env
--forceReplace an existing APP_KEY

queue:work ​

Run queued jobs until stopped (Ctrl-C / SIGTERM lets running jobs finish)

ArgumentDescription
--queueQueue to take jobs from (repeatable; default: queue.queues)
--onceRun the jobs ready now (at most 1,000), then exit
--workersWorkers (default: queue.workers)

queue:failed ​

List failed jobs

queue:retry ​

Run failed jobs again (attempts start over)

ArgumentDescription
<id>Job id
--allEvery failed job

queue:forget ​

Delete failed jobs

ArgumentDescription
<id>Job id
--allEvery failed job

key:reencrypt ​

Seal every encrypted column and settings secret with APP_KEY (after a rotation)

ArgumentDescription
--dry-runCheck and count; write nothing
--listList the encrypted columns and exit
--batchRows 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)

ArgumentDescription
<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)

ArgumentDescription
--emailSign-in email
--nameDisplay name
--passwordPassword (default: generated)
--super-adminGrant the super_admin role
--guardGuard of the super_admin role (default: admin)

role:assign ​

Give an existing user a role (super_admin or any role) of a guard

ArgumentDescription
--emailUser email
--roleRole name, e.g. super_admin
--guardGuard of the role (admin, api) (default: admin)

token:create ​

Issue an API token for a user (printed once)

ArgumentDescription
--emailOwner email
--nameToken label
--abilitiesComma-separated abilities (default: *)
--expires-daysLifetime 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, …)

ArgumentDescription
<locale>Language, e.g. vi

admin:branding ​

Show where the panel's branding comes from, and load it once to check it (changes nothing)

RustCMS 0.17.0 · source cfb82fa33fab · MIT OR Apache-2.0