Skip to content

Create Warlock

create-warlock is the official project scaffolder. One command drops you into a short interactive wizard, and a couple of questions later you have a complete, configured Warlock project that boots.

Migrating an existing app? Start with the v5 migration guide.

Terminal window
pnpm create warlock my-app
cd my-app

The wizard asks a few questions — project name, package manager, database driver (or None, to skip it), the optional features you want (mail, caching, the scheduler, storage, and friends), and whether to initialize git and generate JWT secrets — then writes everything from your answers and runs the install for you.

What lands is a ready-to-run app: the src/app (one folder per feature) + src/config (one file per subsystem) layout, a warlock.config.ts, decorators already enabled in tsconfig.json, and a dev server you start with pnpm dev.

Scripting it in CI, or driving it from an agent? Pass --yes (or -y) and the whole app is scaffolded in a single non-interactive command — every prompt is answered from flags, with sensible defaults for anything you leave out:

Terminal window
pnpm create warlock my-app --yes \
--db=postgres --pm=pnpm \
--features=test,redis --ai=ai-openai \
--git --jwt

The first positional argument (or --name) is the project name. Value flags accept either --db=postgres or --db postgres. Unknown --db, --features, --ai, or --pm keys fail fast — before anything is written to disk — so a typo (or a hostile value) never leaves you with a half-scaffolded project.

| Flag | Default | Purpose | | --- | --- | --- | | --db | mongodb | Database driver — mongodb, postgres, or none | | --pm | auto-detected | Package manager — must be npm / yarn / pnpm / bun; any other value is rejected before scaffolding starts | | --features | none | Comma-separated optional feature keys | | --ai | none | Comma-separated AI provider keys (auto-pulls @warlock.js/ai) | | --git / --no-git | off | Initialize a Git repository | | --jwt / --no-jwt | off | Generate JWT secret keys |

-h/--help prints usage and exits; -v/--version prints the installed create-warlock version and exits. Both are checked before anything else runs, so they work even with no project name given.

Not every app needs a database. Pick None in the wizard’s database step — or pass --db=none (--no-db is a shorthand) — and the scaffold leaves the database out entirely: no driver is selected, no driver package is installed, and the template’s src/config/database.ts is removed. Warlock’s database connector is gated on that config file, so the app boots cleanly with no database wired.

Terminal window
# A database-free API in one command
pnpm create warlock my-api --yes --no-db --features=test
  • Full walkthroughCore · Installation — every question, the scaffolded file tree, and booting the dev server, step by step.
  • Your first endpointCore · Getting Started — from a fresh project to a working route.
  • Scaffold as you buildCore · Generatorswarlock generate.module, generate.controller, and the rest of the family.