dust

Commands

Introduction

There are two kinds of commands:

  • CLI commands belong to the dust executable and work outside an application, such as dust new and dust update.
  • Application commands belong to your application. Run them through dust <command> from the application's directory; the CLI compiles the application first, then runs the command.
shell
dust migratedust statusdust cron:list

To see every command the application registers, run dust list. To read one command's arguments, run dust help <command>, or pass --help to the command itself:

shell
dust help migratedust migrate --help

Application commands run the binary that dust compiles from the current directory. In production, where the CLI may not be installed, run the binary you built with the same arguments:

shell
./bin/example-app migrate --force

CLI commands

Command What it does
dust new <path> Create an application in bin/, src/, config/, database/, modules/, public/, resources/, and storage/.
dust dev Run the development server, which is the application's serve command under Cargo.
dust build [--release] Build the application and copy its binaries into bin/.
dust update [--release] Update the framework source, rebuild, copy the binaries, and refresh io/ui.
dust <command> Compile the application in the current directory and run its console command.

dust --version prints the CLI's version, and dust --help prints the short usage summary.

Creating and updating

dust new refuses a directory that already holds files. It writes .env with a generated APP_KEY, a SQLite database URL, and the project name, and copies the io/ui assets into public/vendor/io-ui.

dust update updates the framework source, rebuilds, and refreshes the frontend. Its flags are:

  • --release builds the release profile.
  • --pull pulls a git checkout; --download downloads the source from config/update.toml; without either, a git checkout is pulled and a plain folder is downloaded.
  • --source <url> overrides the source for one run.
  • --deps runs cargo update first.
  • --no-ui skips the io/ui refresh.

Building binaries

dust build runs cargo build and puts the runnable binaries in bin/:

text
bin/
├── your-app
└── dust-cron

dust update does the same after rebuilding. dust install and the daemon commands use bin/, so the folder is the stable place to start from. A running binary can be replaced: the build writes a temporary file and renames it into place.

dust build copies the binary named by default-run (or package.name), every [[bin]] target, and dust-cron when it exists. If none of them were built, it stops with a message naming the expected target directory. Build first, or let dust build run Cargo for you.

Application commands

The framework registers the commands below in every application. Your own commands and your packages' commands appear in dust list alongside them.

Installing and operating

Command What it does
install Runs the pending migrations, runs schedule:setup, and starts the cron daemon. --force skips the production migration prompt; --no-cron skips the scheduler and daemon.
status Shows the app, database and migration count, queue, cache, cron, relay, and io/ui version.
restart Restarts the cron daemon and the relay server.
serve Serves the application. dust dev runs this.
key:generate Generates a new APP_KEY. --show prints it instead of writing .env.

install is the one command to run on a fresh server. It does not start the web server itself; your process manager does that. It is safe to run again: schedule:setup leaves an existing schedule:run cron alone, and cron:start checks whether the daemon is already running.

status reads the live services, so a stopped daemon or an unreachable relay shows in its output rather than failing the command. It never changes anything.

Migration, queue, cache, and schedule

Area Commands
Database migrate, migrate:fresh, migrate:status, db:seed, schema:dump
Queue queue:work, queue:restart, queue:failed, queue:retry, queue:forget, queue:flush, queue:clear, queue:pause, queue:continue, queue:prune-batches, queue:retry-batch
Cache cache:clear, cache:prune
Schedule schedule:run, schedule:work, schedule:list, schedule:interrupt, schedule:setup, schedule:clear-cache
Features feature:purge
Search search:index, search:delete-index, search:import, search:flush

migrate asks for confirmation in production; pass --force in a deploy script. migrate:fresh drops every table and reruns the migrations, so it is a local-only command. The migrations guide covers both, and the queue guide covers the worker commands.

queue:work runs until stopped and restarts each worker on a deploy. queue:restart asks workers to exit after their current job, which is what a deploy uses when the workers run under a supervisor separate from the server.

schedule:run runs every task due in the current minute and exits; schedule:work calls it every minute locally. The scheduling guide covers the difference, and the cron guide covers the daemon that replaces a system cron entry.

Modules, media, and the frontend

Command What it does
module:make <name> Creates a module and adds it to the registry.
module:list Lists modules; --enabled and --disabled filter.
module:enable <name> Enables a module.
module:disable <name> Disables a module without removing its code.
module:delete <name> Deletes a module's folder and registry lines; --force skips the question.
media:add, media:list, media:move, media:delete Manage media library files.
ui:update Updates the io/ui assets from config/frontend.toml; --check reports versions, --force downloads anyway.
route:list Lists the registered routes.
relay:start Runs the local relay server for WebSockets.

The modules guide covers the module commands, and the frontend guide covers ui:update in detail.

Restarting services

dust restart restarts:

  1. the cron daemon, through cron:restart;
  2. the relay server, through systemctl restart dust-relay.
shell
dust restartdust restart --relay-service my-relaydust restart --no-relaydust restart --no-cron

If your relay unit has another name, set RELAY_SERVICE or pass --relay-service. If the application was built without the cron or relay feature, the matching step is skipped.

The application's HTTP process is not restarted by restart, because the command runs inside it. Restart that through your process manager, such as systemctl restart your-app or a new deploy.

Exit codes and help

A successful command exits with 0. A command that returns an error prints it to stderr, reports it through the error handler, and exits with 1. A command that returns a u8 chooses its own code, and the console's prompts return 130 when the user cancels with Ctrl+C.

The CLI passes the application's exit code through, so a shell script can branch on a failed migration or a failed queue drain:

shell
if ! dust migrate --force; then  echo "migration failed" >&2  exit 1fi

dust list shows command names and descriptions. dust help <command> compiles and boots the application like any other command, then prints that command's long help instead of running it; --help on the command itself does the same.