Getting started

Welcome to sedim

Sedim is a CLI that stamps production-ready, fully-wired modules - frontend, backend, and schema - directly into your codebase. Every file it generates is yours to own, edit, and customize forever.

What sedim does, in one paragraph

Run sedim init once to let the Detector learn your stack. Then sedim add <module> triggers a four-part pipeline - Detector → Thinker → Showbaby → Writer - that plans the change, shows you the diff, and stamps only what you need. Core logic files use overwriteStrategy: skip, so your customizations are never overwritten.

Quickstart

Prerequisite: Node.js 18+, an existing project with a supported framework (Next.js, Express, or Hono) and ORM (Drizzle or Prisma).

1. Install the CLI

npm install -g @sedim/cli
sedim --version

2. Initialize your project

cd my-project
sedim init

Sedim auto-detects your framework, ORM, and language, then writes sedim.config.ts. Edit it directly if anything is detected incorrectly.

3. Add auth

sedim add auth

The CLI walks you through:

  • Feature selection - email/password, OAuth, TOTP, magic links, JWT, RBAC/ABAC
  • UI tier - headless, Tailwind styled, or themed with CSS tokens
  • Plan review - see exactly what will be written before anything stamps
  • Environment variables - add them on the spot or copy to your .env

4. Migrate and run

# Drizzle
npx drizzle-kit push

# or Prisma
npx prisma migrate dev --name add_auth

npm run dev

Configuration

After sedim init, a sedim.config.ts file is written to your project root. It stores detected facts about your stack:

  • framework - nextjs, express, or hono
  • orm - drizzle or prisma
  • language - typescript or javascript
  • db - postgresql, mysql, sqlite, etc.

Re-run sedim init --force to regenerate from scratch, or edit the file directly to override detection.

Commands

sedim init

Runs the Detector against your repository. Scans lockfiles, config files, folder structure, and dependencies to identify your framework, ORM, and language. Writes sedim.config.ts with the results.

sedim init
sedim init --force   # reinitialize even if already set up

sedim add

The main command. Loads the module manifest from the registry, runs the Thinker to build an install plan tailored to your stack and feature selections, shows the plan via Showbaby, then executes it with the Writer.

sedim add auth
sedim add auth --dry-run   # preview without writing
sedim add auth --force     # skip conflict checks

sedim plan

Compute and preview the install plan without writing any files.

sedim plan auth

sedim diff

Show per-file diffs of what a module install would change in your codebase.

sedim diff auth

sedim continue

Resume an interrupted module install. Sedim preserves session state when an install is cancelled mid-flow - run continue to pick up where you left off.

sedim continue auth

sedim doctor

Validate your setup and diagnose common issues before stamping. Checks for sedim initialization, pending sessions, config validity, and environment readiness.

sedim doctor

Pipeline overview

Every sedim add command flows through four components. Each has a single responsibility and communicates through typed interfaces - no shared global state.

Detector

Reads your repository to identify framework, ORM, language, database, and existing conventions. Stores facts in sedim.config.ts. Also detects conflicts - like an existing auth library - and warns before proceeding.

Thinker

Combines the module manifest (registry/<module>/latest.json) with your stack context and feature selections to produce an InstallPlan: a list of file operations, schema changes, and env vars required.

Showbaby

All CLI UX lives here - prompts, spinners, progress bars, plan summaries, and conflict resolution. Streams the plan in real time so you see diffs and choices before anything is written.

Writer

Executes the install plan atomically. Writes new files, patches existing ones, and injects imports. Core logic files use overwriteStrategy: skip - your edits are preserved. User-facing files (config, pages) use overwriteStrategy: ask.

What gets stamped

Running sedim add auth generates a complete auth system under src/sedim/auth/:

src/sedim/auth/
├── core/           # hash-password, session, pkce, totp, rbac, rate-limit...
├── adapters/       # framework + ORM adapters
├── ui/             # headless, tailwind, themed component tiers
├── emails/         # verification templates
└── schema.ts       # auto-generated for your ORM

Supported stacks

FrameworkDrizzlePrisma
Next.js (App Router)✓✓
Express✓✓
Hono✓✓