Skip to content

Add a package

dox add adds a Dox package to your app and sets it up.

Adding a package

Give the short name of the package. The full name, like dox_orm, also works:

dox add orm

It runs dart pub add dox_orm, then dart pub get, then the setup command of the package (here dox orm:install). The setup command writes the config files, adds the keys to .env and .env.example, and runs build_runner if necessary. At the end it shows what it did and the next steps.

A package with no setup command is only added.

Options

Words after the name go to the setup command, for example to pick a driver:

dox add orm --driver=postgres

Add --dev to add the package as a dev dependency.

Running it again

The setup command never overwrites a file or a .env key. So you can run dox add again, and it adds only what is missing.

Packages with a setup command

Command What it sets up
dox add orm [--driver=sqlite\|postgres\|mysql] The ORM and migrations. See Database.
dox add queue [--driver=database\|redis\|sync] Queued jobs and bin/queue.dart. database is the default and needs dox add orm first. See Queue.
dox add scheduler Scheduled tasks and bin/schedule.dart. See Scheduler.
dox add mailer [--transport=log\|smtp\|resend\|mailgun\|postmark\|ses] Mail. log is the default. See Mail.
dox add cache [--store=file\|redis\|memory\|database] Cache stores. database needs dox add orm first. See Cache.
dox add auth Access token auth. Needs dox add orm and a User model first. See Authentication.
dox add storage [--disk=local\|s3\|azure] File storage. See File storage.
dox add socketio [--broadcasting] Socket.IO, and broadcasting with the flag. See Socket.IO.
dox add view Views and resources/views/. See Views.
dox add inertia The server side of Inertia. It prints the Vite steps. See Inertia.
dox add mcp An MCP server with a sample tool. See MCP.
dox add grpc gRPC: a sample .proto file, a router with the health service and APP_HTTP2 in .env. See gRPC.

The first dox add orm can download or build the Postgres and MySQL drivers one time. After that, pubspec.yaml skips the drivers that you do not use.

Next steps