A command-line interface tool for scaffolding Drizzle ORM files, compiled with Deno.
Note: This is an opinionated CLI tool that currently supports only PostgreSQL databases using Drizzle ORM. It assumes the use of relative imports with @/
, similar to a Next.js application.
- Generate schema files for Drizzle ORM
- Create TypeScript types based on your schema
- Generate Zod validation schemas
- Scaffold CRUD API endpoints
- Customizable project structure through configuration
- Optimized for projects using PostgreSQL and Next.js-style imports (
@/
)
The Drizzle Deno CLI is distributed as a pre-compiled executable, so you don't need to have Deno installed on your system to use it.
- Go to the Releases page of this repository.
- Download the appropriate executable for your operating system (Windows, macOS, or Linux).
- Rename the downloaded file to
drizzle-cli
(ordrizzle-cli.exe
on Windows) for convenience. - Move the executable to a directory in your system's PATH.
Move it to /usr/local/bin
sudo mv drizzle-cli /usr/local/bin/
Check if it's in your PATH
which drizzle-cli
Verify the version
drizzle-cli --version
Once installed, you can use the Drizzle Deno CLI from your terminal:
- Initialize the project configuration:
drizzle-cli init
- Generate files for a new table/model:
drizzle-cli generate
- View or update the CLI configuration:
drizzle-cli config
The CLI uses a configuration file named drizzle-cli-config.ts
in your project root. This file is automatically generated when you run drizzle-cli init
. You can manually edit this file or use the drizzle-cli config
command to update your configuration.
- Supports only PostgreSQL with Drizzle ORM
- Assumes relative imports using
@/
(e.g.,import { something } from '@/path/to/module'
)
If you want to contribute to the Drizzle Deno CLI or compile it yourself, you'll need to have Deno installed on your system. You can get it from deno.land.
To compile the CLI:
deno compile --allow-read --allow-write --output drizzle-cli cli.ts
This will generate an executable named drizzle-cli
(or drizzle-cli.exe
on Windows) in your current directory.
Contributions are welcome! Please feel free to submit a Pull Request.