Skip to content

CLI Reference

The mizzling package provides a command-line interface (CLI) for managing your DynamoDB schema, handling migrations, and interacting with your environment.

Terminal window
bun add -d mizzling

You can then run it using bun x mizzle.

Initializes the Mizzle configuration in your project. It creates a mizzle.config.ts file.

Terminal window
bun x mizzle init

Analyzes your entity definitions and generates a new migration snapshot and script.

Terminal window
bun x mizzle generate --name <migration_name>
  • Options:
    • -n, --name <name>: Provide a descriptive name for the migration.

Directly applies schema changes to the target DynamoDB environment. This command compares your local schema definitions with the actual state of the DynamoDB tables and applies the necessary CreateTable or UpdateTable operations.

Terminal window
bun x mizzle push
  • Options:
    • -y, --yes: Skip the confirmation prompt before applying changes.

Lists all existing DynamoDB tables in your configured environment.

Terminal window
bun x mizzle list

An interactive command that allows you to select and delete DynamoDB tables from your environment. Use with extreme caution.

Terminal window
bun x mizzle drop

The CLI relies on mizzle.config.ts to find your schema definitions and connect to DynamoDB.

mizzle.config.ts
import { defineConfig } from "@aurios/mizzling";
export default defineConfig({
schema: "./src/db/schema.ts",
out: "./drizzle",
driver: "aws-sdk",
dbCredentials: {
region: "us-east-1",
},
});