CLI Reference
All QUESTPIE CLI commands.
Commands
Codegen
| Command | Description |
|---|---|
questpie generate | Scan file conventions, generate types and factories |
questpie dev | Watch mode -- auto-regenerate on file changes |
Database
| Command | Description |
|---|---|
questpie push | Push schema to database (no migrations) |
questpie migrate:generate | Generate migration from schema diff |
questpie migrate:up | Run pending migrations |
questpie migrate:down | Rollback last migration |
questpie migrate:fresh | Drop all tables and re-run migrations |
questpie migrate:reset | Reset migration tracking |
questpie migrate:status | Show migration status |
Seeds
| Command | Description |
|---|---|
questpie seed | Run pending seed files |
questpie seed:generate | Generate a new seed file |
questpie seed:undo | Undo last seed |
questpie seed:status | Show seed status |
questpie seed:reset | Reset seed tracking |
Scaffolding
| Command | Description |
|---|---|
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:
#questpieimports -- 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 generatequestpie dev
Watch mode that re-runs codegen whenever a convention file changes. Use during development.
bunx questpie devquestpie push
Push the current Drizzle schema directly to the database without creating migration files. Useful during early development.
bunx questpie pushquestpie migrate:generate
Compare the current schema against the database and generate a SQL migration file.
bunx questpie migrate:generatequestpie migrate:up
Run all pending migrations.
bunx questpie migrate:upquestpie migrate:down
Rollback the last applied migration.
bunx questpie migrate:downquestpie migrate:fresh
Drop all tables and re-run all migrations from scratch.
bunx questpie migrate:freshquestpie migrate:status
Show which migrations have been applied and which are pending.
bunx questpie migrate:statusquestpie migrate:reset
Reset the migration tracking table without touching data tables.
bunx questpie migrate:resetquestpie seed
Run all pending seed files in order.
bunx questpie seedquestpie seed:generate
Generate a new timestamped seed file.
bunx questpie seed:generatequestpie 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 siteSettingsConfiguration
The CLI reads questpie.config.ts from the project root:
export { default } from "./src/questpie/server/questpie.config";CLI-Specific Options
runtimeConfig({
cli: {
migrations: {
directory: "./src/migrations",
},
seeds: {
directory: "./src/seeds",
},
},
});