Skip to main content

CLI overview

The nucleus binary is the deterministic operations interface for any Nucleus project. Every command:

  • reads nucleus.yml from the current working directory by default,
  • emits structured (JSON-friendly) output where structured output makes sense,
  • exits with a non-zero status on failure and a meaningful message on stderr.

The full inventory is canonical at docs/reference/CLI_CONTRACT_MATRIX.md. The summary below groups the commands by purpose.

Project lifecycle

CommandWhat it does
nucleus new <name>Scaffold a new project (`--template mvc
nucleus serveStart the HTTP server.
nucleus healthProbe /healthz of the running app.
nucleus doctorSelf-check the local environment.

Database & migrations

CommandWhat it does
nucleus migrateApply pending migrations.
nucleus migrate statusShow plan vs. applied.
nucleus migrate driftDetect applied migrations whose .up.sql file is missing on disk. Exits non-zero when drift is detected (CI-friendly).
nucleus migrate downRoll back the most recent batch.
nucleus generate migrationScaffold a new migration (with --from-model).
nucleus inspectdbInspect a live database schema.
nucleus seedLoad seed data (fixtures).
nucleus dumpdataExport model rows to JSON / CSV.
nucleus loaddataImport model rows from JSON / CSV.

Users & sessions

CommandWhat it does
nucleus createuserCreate an admin user interactively.
nucleus changepasswordChange a user's password.
nucleus clearsessionsPurge expired sessions from the configured store.

Inspection

CommandWhat it does
nucleus routesList registered routes.
nucleus diffsettingsPrint the resolved configuration.
nucleus shellDrop into a Go-evaluated REPL bound to your app.

Mail & plugins

CommandWhat it does
nucleus mailprovidersList registered mail drivers and plugin probes.
nucleus sendtestemailSend a one-off email through the configured driver.
nucleus plugin listDiscover nucleus-plugin-* binaries on PATH.

Static assets, i18n, and content types

CommandWhat it does
nucleus collectstaticStage static assets for production.
nucleus findstaticFind static assets across discovered source dirs.
nucleus makemessagesExtract translatable strings into .po catalogs.
nucleus compilemessagesCompile .po catalogues into JSON bundles.
nucleus remove_stale_contenttypesDelete stale rows from the content types table.

Output style

Every command accepts a top-level output style flag:

nucleus migrate status --output json
nucleus routes --output table

The JSON output keys are part of the contract and pinned by contracts/cli_json_freeze_test.go.

Help

nucleus help
nucleus help migrate
nucleus migrate --help

nucleus help <command> is the canonical inline reference. The website cannot stay perfectly synchronized with every flag — when in doubt, ask the binary.