s-m-r-t
Open the s-m-r-t source on GitHub Switch to dark color scheme
← All packages
Web & UI v0.57.40

@happyvertical/smrt-cli

The framework developer CLI for manifests, database migrations, application operations, cookbooks, introspection, and generated resources.

Source ↗

What it gives you

The framework developer CLI for manifests, database migrations, application operations, cookbooks, introspection, and generated resources.

This package is one focused part of the s-m-r-t stack. Its decorated models participate in the same manifest, tenancy, persistence, and generated-interface conventions as the rest of the framework.

Operate production schema changes deliberately

db:migrate --postgres-safe orders dependencies, uses concurrent-index mode, applies lock and statement timeouts, and probes orphan foreign keys. doctor --db and db:status --parity compare the live schema. db:rollback executes only a reconstructible down migration or refuses; --mark-only changes migration bookkeeping without changing schema. db:prune supports dry-run and skip controls for retention work. SQLite type changes rebuild the table. db:migrate-qualified-names rewrites stored deprecated qualified names on request, and --empty-text-as-null converts empty text to NULL during a column change.

Which database a db command uses

Every db command resolves its database once, at startup. An explicit packages.cli.database.url from any config layer wins, so a stray shell DATABASE_URL never retargets it. DATABASE_URL comes next, with the engine from the config, DATABASE_TYPE, or the URL scheme. With neither, the command runs against an in-memory database.

Operate the application with smrt app

smrt app install, setup, start, stop, recover, doctor, open, backup, export, import, migrate, worker, dev, and build are the operations. They replace the copied operator scripts a template used to ship. Each generated package.json script is one of these one-liners. Local operations run under one operation lock, and start proves readiness against the loopback health route before it reports success.

Cookbooks and the kitchen

smrt cookbook validate checks a cookbook file or URL against the v1 schema and the recipe manifests. smrt cookbook apply creates a project from it and the start template. smrt kitchen serves the planner on localhost, where a person chats a cookbook into shape and sends it to a directory. smrt kitchen apply does the same from a plan URL.