Getting Started
Get up and running in seconds, with no global installs required.
Prereqs
- Node.js ≥ 22
- A Drizzle schema (TypeScript)
- Install the CLI
Add DRZL CLI to your project (no globals needed):
bash
pnpm add -D @drzl/clibash
npm i -D @drzl/clibash
yarn add -D @drzl/clibash
bun add -d @drzl/cli- One complete example (oRPC + Zod + Service)
Add a single config to generate Zod validators and oRPC routers that reuse them, plus typed services:
ts
// drzl.config.ts
import { defineConfig } from '@drzl/cli/config';
export default defineConfig({
schema: 'src/db/schemas/index.ts',
outDir: 'src/api',
generators: [
// 1) Zod validators
{ kind: 'zod', path: 'src/validators/zod', schemaSuffix: 'Schema' },
// 2) Routers (oRPC adapter), reusing Zod schemas
{
kind: 'orpc',
template: '@drzl/template-orpc-service',
includeRelations: true,
outputHeader: { enabled: true },
validation: {
useShared: true,
library: 'zod',
importPath: 'src/validators/zod',
schemaSuffix: 'Schema',
},
},
// 3) Typed services (Drizzle-aware or stub)
{
kind: 'service',
path: 'src/services',
dataAccess: 'drizzle', // or 'stub'
dbImportPath: 'src/db/connection',
schemaImportPath: 'src/db/schemas',
},
],
});- Install Templates
The CLI comes with all the generators you need. You only need to install any templates you want to use. For this example, we'll install the oRPC service template:
bash
pnpm add -D @drzl/template-orpc-servicebash
npm i -D @drzl/template-orpc-servicebash
yarn add -D @drzl/template-orpc-servicebash
bun add -d @drzl/template-orpc-service- Generate:
bash
pnpm dlx @drzl/cli generate -c drzl.config.tsbash
npx @drzl/cli generate -c drzl.config.tsbash
yarn dlx @drzl/cli generate -c drzl.config.tsbash
bunx @drzl/cli generate -c drzl.config.tsThis writes validators to src/validators/zod, routers to src/api, and services to src/services.
Notes
- Eighteen generators emit routers or an API surface, and each is its own generator rather than a template: oRPC, tRPC, Hono, Express, Fastify, NestJS, GraphQL, Pothos, MCP, Next.js, the AI SDK, TanStack Start, h3, Effect HttpApi, ts-rest, openapi-fetch, forms and Elysia. Only oRPC takes templates, which is why the step above installs one. See Adapters for which to reach for.
- You do not install generators. All twenty-seven are dependencies of
@drzl/cli, so the install in step 1 already brought every one of them. What you may need is the validation library itself, in your own app:zod,valibot,arktype,@sinclair/typeboxoreffect, since the generated files import from it.effectis an optional peer and is never installed for you; see Effect for why. - Config file formats supported:
drzl.config.ts,.mjs,.js,.json.
Next steps
- CLI commands → /cli
- Config reference → /guide/configuration
- Recipes → /examples/recipes
- Something failed → /guide/troubleshooting
- Adapters → /adapters/overview
- Hosting on Supabase/Neon, PlanetScale or Cloudflare D1? → provider quickstarts for Postgres, MySQL and SQLite

