Two CLI tools for TypeScript codebases

Migrate your ORM and SDK in seconds, not days.

TypeSwitch is a suite of local CLI utilities that automatically convert Prisma schemas to Drizzle ORM and OpenAI SDK calls to Anthropic Claude. You provide your API key, the tools handle everything else.

Runs 100% locally on your machine
Auto-backup before every change
You own the full TypeScript source
SOURCE_FILE MIGRATED_TS AST_ENGINE
See what happens when you run it.

Select a migrator CLI utility below to view a recreation of its terminal execution.

model-migrate --dir ./project
$
Try it in the sandbox.

Select a source file from the editor sidebar, click "Transpile", and witness the AST translation in real-time.

AST PLAYGROUND
Source File (Original)
Transpiled Output (Drizzle/Claude)
Idle
Two focused CLI utilities.

Each tool is a standalone TypeScript project you run with npx. You purchase the source code — not a subscription, not a binary.

Tool 01

orm-migrate

Converts Prisma schema files to Drizzle ORM TypeScript schemas, and rewrites PrismaClient query calls into Drizzle relational queries throughout your codebase.

  • Prisma schema → Drizzle pgTable definitions
  • PrismaClient queries → Drizzle relational API
  • Swaps @prisma/clientdrizzle-orm packages
  • Generates vector re-indexing script if pgvector detected
Tool 02

model-migrate

Scans your codebase for OpenAI SDK import references and rewrites them to use the Anthropic Claude SDK, including chat completions and embeddings.

  • OpenAI chat.completions → Anthropic messages
  • Embedding API migration + alternative mapping
  • Swaps openai@anthropic-ai/sdk packages
  • Interactive API key setup & local .env storage
Roadmap

Future utilities

We are actively developing additional migration modules. All license holders will receive these tools as free updates once compiled.

  • Mongoose schema → Drizzle / Postgres (Q3)
  • Langchain JS → Vercel AI SDK (Q3)
  • OpenAI Assistants → Claude API (Q4)
Real output, not mockups.

These are actual input/output examples from the CLI tools.

Prisma client query
import { PrismaClient } from "@prisma/client";
const prisma = new PrismaClient();

export async function getActiveUsers() {
  return await prisma.user.findMany({
    where: { role: "USER" },
    include: { posts: true },
  });
}

export async function createUser(email: string, name: string) {
  return await prisma.user.create({
    data: { email, name, role: "USER" },
  });
}
Drizzle relational query — generated
import { eq } from "drizzle-orm";
import { db } from "@/db";
import { users } from "@/db/schema";

export async function getActiveUsers() {
  return await db.query.users.findMany({
    where: eq(users.role, "USER"),
    with: { posts: true },
  });
}

export async function createUser(email: string, name: string) {
  return await db.insert(users).values({
    email, name, role: "USER",
  }).returning();
}
OpenAI chat completion
import OpenAI from "openai";
const openai = new OpenAI();

export async function askAssistant(prompt: string) {
  const response = await openai.chat.completions.create({
    model: "gpt-4o",
    messages: [
      { role: "system", content: "You are a helpful assistant." },
      { role: "user", content: prompt }
    ],
    temperature: 0.7,
  });
  return response.choices[0]?.message?.content;
}
Anthropic messages SDK — generated
import Anthropic from "@anthropic-ai/sdk";
const anthropic = new Anthropic();

export async function askAssistant(prompt: string) {
  const response = await anthropic.messages.create({
    model: "claude-sonnet-4-20250514",
    max_tokens: 8192,
    system: "You are a helpful assistant.",
    messages: [
      { role: "user", content: prompt }
    ],
  });
  return response.content[0].text;
}
Four steps. One command.

Run the CLI, point it at your project directory, and let it handle the rest.

01

Scan

Walks your project tree and identifies files with SDK imports or ORM references.

02

Backup

Copies every target file to .migration-backup/ before making changes.

03

Transpile

Parses AST, builds contextual prompts, and rewrites each file using your LLM API key.

04

Finalize

Swaps packages in package.json, generates auxiliary scripts, done.

One-time purchase. Full source code.

You buy the TypeScript source code. No subscriptions, no tokens, no lock-in. LLM API costs are yours — typically under $2 per migration.

Solo developer
$39
One-time payment
  • orm-migrate CLI source code
  • 1 developer seat
  • Unlimited personal projects
  • Lifetime updates
  • Community support
Buy solo license
Startup team
$119
One-time payment
  • orm-migrate CLI source code
  • Up to 5 developer seats
  • Commercial use in startup
  • Lifetime updates
  • Priority email support
Buy startup license
Agency / unlimited
$249
One-time payment
  • orm-migrate CLI source code
  • Unlimited developer seats
  • Commercial use on client projects
  • Lifetime updates
  • 1-on-1 direct support
Buy agency license
Solo developer
$29
One-time payment
  • model-migrate CLI source code
  • 1 developer seat
  • Unlimited personal projects
  • Lifetime updates
  • Community support
Buy solo license
Startup team
$79
One-time payment
  • model-migrate CLI source code
  • Up to 5 developer seats
  • Commercial use in startup
  • Lifetime updates
  • Priority email support
Buy startup license
Agency / unlimited
$149
One-time payment
  • model-migrate CLI source code
  • Unlimited developer seats
  • Commercial use on client projects
  • Lifetime updates
  • 1-on-1 direct support
Buy agency license
Solo developer
$49
One-time payment
  • Both tools — full source code
  • 1 developer seat
  • Unlimited personal projects
  • Lifetime updates
  • Community support
Buy solo bundle
Startup team
$149
One-time payment
  • Both tools — full source code
  • Up to 5 developer seats
  • Commercial use in startup
  • Lifetime updates
  • Priority email support
Buy startup bundle
Agency / unlimited
$299
One-time payment
  • Both tools — full source code
  • Unlimited developer seats
  • Commercial use on client projects
  • Lifetime updates
  • 1-on-1 direct support
Buy agency bundle
Common questions.

No. Both tools run entirely on your machine. Your files are read locally and sent directly to OpenAI or Anthropic's API using your own keys. We never see, store, or relay your code.

Every file is backed up before changes. Run the tool with --rollback to restore everything instantly. The output handles 90–95% of typical codebases cleanly; edge cases (raw SQL, complex middleware) may need manual review.

You do — directly to OpenAI or Anthropic. You provide your own API key. For a typical project, token cost is under $2 total.

Yes. You buy the full TypeScript source code. Open sdk-transpiler.ts or prisma-to-drizzle.ts and edit the prompt templates to match your coding standards.

Schema conversion is fully automated. Query conversion handles standard patterns (findMany, create, update, delete with relations). Complex patterns like raw SQL queries, Prisma middleware, or deeply nested transactions may need manual adjustment — the tool does the heavy lifting so you focus only on edge cases.