Cadmus
v0.1.2

Reference

Commands

Every command - the cadmus tool, and the management commands each project has.

#The cadmus command

Installed with cargo install cadmus-cli.

CommandWhat it does
cadmus new NAME [--database sqlite|postgres|mysql] [--framework-path PATH]create a project in a new folder
cadmus generate model NAME field:type ...add a model to the project in the current folder (cadmus g model for short)
cadmus secretprint a new secret key
cadmus mcpserve the MCP protocol for AI agents (see Building with AI agents)

--framework-path uses a local copy of Cadmus instead of the version on crates.io.

#Project commands

Every project is also its own command line. Run them as cargo run -- <command>, or ./target/release/<project> <command> for a built program.

CommandWhat it does
serve [--bind addr]start the server
makemigrations [--name N] [--empty] [--check] [--no-input]write a migration for the model changes into src/migrations
migrate [target] [--fake]apply new migrations, or roll back to target (a name, a number such as 0002, or zero)
showmigrationslist migrations and whether this database has had each
sqlmigrate NAME [--backwards]print the SQL a migration runs on this database
createsuperuser --username U [--email E] [--password-stdin]create a superuser
changepassword --username U [--password-stdin]change a password
promote --username Umake an existing account an active superuser
totp --username U [--disable]turn two-factor login on (prints a QR code) or off
apikey --username U --name N [--days D] [--read-only]make an API key (90 days by default; --days 0 for never)
openapiprint the API description as JSON
routeslist the generated addresses
checkcheck the configuration without starting the server

Add --help to any command for its options.

#makemigrations

OptionEffect
--name Nname the migration (default: made up from the changes)
--emptywrite a migration with no changes, to fill in by hand
--checkwrite nothing; fail if the models have changes without a migration
--no-inputask nothing: nothing is taken as a rename, and new required fields need a default

#migrate

ExampleEffect
migrateapply every migration this database has not had
migrate 0002roll back the migrations after 0002 (or apply up to it)
migrate zeroroll back every migration of the project
migrate 0002 --fakerecord or forget migrations without running them