Skip to content

A command-line interface tool for scaffolding Drizzle ORM files, compiled with Deno.

Notifications You must be signed in to change notification settings

dubscode/drizzle-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Drizzle Deno CLI

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.

Features

  • 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 (@/)

Installation

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.

  1. Go to the Releases page of this repository.
  2. Download the appropriate executable for your operating system (Windows, macOS, or Linux).
  3. Rename the downloaded file to drizzle-cli (or drizzle-cli.exe on Windows) for convenience.
  4. Move the executable to a directory in your system's PATH.

Setting up on your Mac

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

Usage

Once installed, you can use the Drizzle Deno CLI from your terminal:

  1. Initialize the project configuration:
drizzle-cli init
  1. Generate files for a new table/model:
drizzle-cli generate
  1. View or update the CLI configuration:
drizzle-cli config

Configuration

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.

Limitations

  • Supports only PostgreSQL with Drizzle ORM
  • Assumes relative imports using @/ (e.g., import { something } from '@/path/to/module')

For Developers

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.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

About

A command-line interface tool for scaffolding Drizzle ORM files, compiled with Deno.

Resources

Stars

Watchers

Forks

Packages

No packages published