CLI

Lucent ships with a small CLI for development, type generation, migrations, scaffolding, and Vite integration.

Commands Overview

CommandDescription
lucent initScaffold or inject a Lucent project
lucent devStart the development server
lucent buildValidate config and generate types
lucent typegenGenerate lucent-types.ts only
lucent migrateApply or preview database migrations
lucent collection <name>Scaffold a collection file
lucent vite buildBundle the API or full-stack app for production

lucent dev

lucent dev

Behavior:

  • locates lucent.config.ts
  • starts the project entry file when present
  • falls back to a standalone Lucent dev server if no app entry exists

See Dev for the development workflow.

lucent build

lucent build

This command:

  • validates lucent.config.ts
  • generates types when typegen.output is configured

lucent typegen

lucent typegen

Use this when you want to regenerate types without starting the server or running migrations.

lucent migrate

Apply migrations:

lucent migrate

Preview migrations without applying them:

lucent migrate --dry-run

Notes:

  • --dry-run previews the planned migration steps and warnings
  • rollback is not implemented yet; treat migrations as forward-only unless you build your own DB rollback workflow

See Migrations for the operator workflow.

lucent collection <name>

lucent collection Posts

This scaffolds a new collection file in src/collections or collections.

lucent vite build

API-only bundle:

lucent vite build

Full-stack build:

lucent vite build --fullstack

Environment

Use Environment as the canonical env reference.

Typical local setup:

DATABASE_URL=postgresql://postgres:password@localhost:5432/lucent_example
JWT_SECRET=dev-secret-change-before-production-123
SESSION_SECRET=dev-session-secret-change-before-prod-123
REDIS_URL=redis://localhost:6379