QUESTPIE
Reference

CLI Reference

All QUESTPIE CLI commands.

Commands

Codegen

CommandDescription
questpie generateScan file conventions, generate types and factories
questpie devWatch mode -- auto-regenerate on file changes

Database

CommandDescription
questpie pushPush schema to database (no migrations)
questpie migrate:generateGenerate migration from schema diff
questpie migrate:upRun pending migrations
questpie migrate:downRollback last migration
questpie migrate:freshDrop all tables and re-run migrations
questpie migrate:resetReset migration tracking
questpie migrate:statusShow migration status

Seeds

CommandDescription
questpie seedRun pending seed files
questpie seed:generateGenerate a new seed file
questpie seed:undoUndo last seed
questpie seed:statusShow seed status
questpie seed:resetReset seed tracking

Scaffolding

CommandDescription
questpie add [type] [name]Scaffold a new entity or module

Usage

# With bunx (recommended)
bunx questpie <command>

# Or via package.json scripts
bun run questpie <command>

Command Details

questpie generate

Scans your project for file conventions (collections, globals, routes, jobs, services, emails, fields, views, pages, widgets, etc.) and generates:

  • #questpie imports -- typed factory functions with all registered field types
  • #questpie/factories -- admin-specific factories (sidebar, dashboard, branding, locale)
  • Type registry -- merged types for collections, globals, routes, and services

Run this after adding or removing any convention file.

bunx questpie generate

questpie dev

Watch mode that re-runs codegen whenever a convention file changes. Use during development.

bunx questpie dev

questpie push

Push the current Drizzle schema directly to the database without creating migration files. Useful during early development.

bunx questpie push
This may cause data loss. Use only in development.

questpie migrate:generate

Compare the current schema against the database and generate a SQL migration file.

bunx questpie migrate:generate

questpie migrate:up

Run all pending migrations.

bunx questpie migrate:up

questpie migrate:down

Rollback the last applied migration.

bunx questpie migrate:down

questpie migrate:fresh

Drop all tables and re-run all migrations from scratch.

bunx questpie migrate:fresh
Destroys all data. Development only.

questpie migrate:status

Show which migrations have been applied and which are pending.

bunx questpie migrate:status

questpie migrate:reset

Reset the migration tracking table without touching data tables.

bunx questpie migrate:reset

questpie seed

Run all pending seed files in order.

bunx questpie seed

questpie seed:generate

Generate a new timestamped seed file.

bunx questpie seed:generate

questpie add

Scaffold a new entity. Interactively prompts for type and name if not provided.

# Interactive
bunx questpie add

# With arguments
bunx questpie add collection posts
bunx questpie add global siteSettings

Configuration

The CLI reads questpie.config.ts from the project root:

questpie.config.ts
export { default } from "./src/questpie/server/questpie.config";

CLI-Specific Options

runtimeConfig({
  cli: {
    migrations: {
      directory: "./src/migrations",
    },
    seeds: {
      directory: "./src/seeds",
    },
  },
});

On this page