CLI
CLI
@loewen-digital/fullstack ships with a CLI for common development tasks: running migrations, seeding the database, generating code, and managing your stack.
Usage
npx fullstack <command>Or install globally:
npm install -g @loewen-digital/fullstackfullstack <command>Database commands
migrate:generate
Generate a new migration file from your Drizzle schema changes:
npx fullstack migrate:generatemigrate:run
Apply all pending migrations:
npx fullstack migrate:runmigrate:rollback
Roll back the most recently applied migration:
npx fullstack migrate:rollbackmigrate:status
Show the status of all migrations (applied / pending):
npx fullstack migrate:statusdb:seed
Run your seeder file to populate the database with development data:
npx fullstack db:seeddb:fresh
Drop all tables, re-run migrations, and run seeders:
npx fullstack db:freshCode generation
generate:factory
Generate a model factory for a database table:
npx fullstack generate:factory users# Creates: src/database/factories/userFactory.tsgenerate:seeder
Generate a seeder file:
npx fullstack generate:seeder UsersSeeder# Creates: src/database/seeders/UsersSeeder.tsConfiguration
The CLI reads your stack configuration from fullstack.config.ts (or .js) in your project root:
import { defineConfig } from '@loewen-digital/fullstack'
export default defineConfig({ db: { driver: 'sqlite', url: './app.db', migrations: { dir: './migrations' }, },})