TypeScript Schema Migration CLI

Switch schema libraries
without rewriting everything

AST-based transforms between Zod, Yup, Joi, io-ts, Valibot, ArkType, Superstruct, and Effect Schema. Backup everything. Rollback anything.

npm install -g schemashift-cli
Before — Yup
import * as yup from 'yup';

const userSchema = yup.object({
  name: yup.string().required(),
  email: yup.string().email().required(),
  age: yup.number().min(0).max(150),
});
After — Zod
import { z } from 'zod';

const userSchema = z.object({
  name: z.string(),
  email: z.string().email(),
  age: z.number().min(0).max(150).optional(),
});

One command. Full AST transformation. Type helpers, imports, and method chains all converted.

Supports

Zod Yup Joi io-ts Valibot ArkType Superstruct Effect Schema

How It Works

1

Analyze

Scan your project. Detect schema libraries, patterns, and migration complexity.

schemashift analyze ./src
2

Migrate

Transform schemas with AST precision. Imports, types, and method chains are all rewritten.

schemashift migrate ./src -f yup -t zod
3

Verify

Contract-test migrated schemas. Every backup is timestamped for instant rollback.

schemashift verify ./src -f yup -t zod

Why SchemaShift

AST-Based Precision

Uses ts-morph for real TypeScript AST manipulation. Handles nested schemas, chained methods, and string-literal safety — not fragile regex.

Backup & Rollback

Every migration creates a timestamped backup. Restore originals instantly with schemashift rollback.

Zod v3 → v4

Handles 20+ breaking changes: .merge(), .superRefine(), z.nativeEnum(), error params, .pipe(), and more.

📄

Form Library Awareness

Auto-rewrites @hookform/resolvers imports. Detects react-hook-form, Formik, and Mantine and warns about adapter changes.

Behavioral Warnings

Detects coercion, validation order, and error format differences between libraries before you migrate.

📦

Monorepo Support

Auto-detects npm/Yarn/pnpm workspaces with topological ordering for correct migration order across packages.

CI/CD Integration

SARIF for GitHub Code Scanning, JUnit test reporting. Templates for GitHub Actions, GitLab CI, and Azure DevOps.

Contract Testing

Verify migrated schemas produce the same validation results as originals with sample generation and parity scoring.

See It In Action

Terminal
$ schemashift migrate ./src -f yup -t zod --dry-run

SchemaShift v0.10.0

  Analyzing 24 schema files...

  src/schemas/user.ts      +12 -14  0 warnings
  src/schemas/product.ts   +8  -9   0 warnings
  src/schemas/order.ts     +15 -18  1 warning
  src/schemas/auth.ts      +6  -7   0 warnings
  ... 20 more files

  Summary: 24 files, 41 added, 48 removed, 1 warning
  Dry run complete. No files were modified.
  Run without --dry-run to apply changes.

Supported Migrations

Migration Path Free Individual Pro Team
Yup → Zod
Joi → Zod
Zod v3 → v4
io-ts → Zod
Zod ↔ Valibot
Zod → Yup
Valibot → Zod
Zod ↔ ArkType
Zod ↔ Superstruct
io-ts → Effect Schema

Simple Pricing

Start free. Upgrade when you need more.

Free

$0
Forever
  • Yup + Joi to Zod
  • 1 device
  • JSON reports
  • Up to 5 custom rules
  • TODO resolution summary
  • Behavioral warnings
  • Standard Schema advisor
  • Enhanced .when() migration
  • Project doctor diagnostics
  • Unified diff export
  • Import deduplication
  • HTML reports
  • Git integration
  • Advanced analysis
  • CI/CD support
Get Started

Individual

$49
One-time payment
  • + Zod v3→v4 upgrade
  • 1 device
  • HTML reports
  • Git integration
  • Advanced analysis
  • Risk scoring + CSV export
  • Form resolver migration
  • Complexity + duration estimation
  • Bundle size estimation
  • Performance analysis
  • Type deduplication
  • Migration presets
  • Schema compare command
  • Dead schema detection
  • CI/CD support
  • Cross-file resolution
Buy Individual

Team

$29
/month
Recurring payment
  • Everything in Pro
  • Unlimited devices
  • Custom plugins
  • Schema governance with auto-fix
  • Policy-as-code management
  • --fail-on-warnings / --max-risk-score
  • Audit logging with export
  • Compliance reports (SOC2/HIPAA)
  • Webhook notifications (Slack/Teams)
  • Approval workflows
  • Schema drift detection
Buy Team

Advanced Features

Beyond basic migration. Deep analysis and enterprise-grade controls.

Analysis

  • Complexity Estimation — Pre-migration effort scoring with risk areas and duration estimates
  • Bundle Size Estimation — Compare minified+gzipped size impact before committing
  • Performance Analysis — Identify validation speed and parse overhead differences
  • Type Deduplication — Find structurally similar schemas across files
  • Dead Schema Detection — Find schema definitions never referenced elsewhere
  • Import Deduplication — Detect and merge duplicate imports after migration

Migration

  • Cross-File Resolution — Dependency graph analysis for correct multi-file ordering
  • Chain Migrations — Multi-step paths like yup→zod→valibot in one command
  • Migration Presets — Templates for React Hook Form, tRPC, Express, Next.js, monorepos
  • Canary Mode — Migrate a percentage of files first, verify, then complete
  • Enhanced .when() — Smart Yup .when() analysis generates the right Zod replacement
  • Backward Migrations — Full bidirectional support: Zod→Yup, Valibot→Zod, and more

Enterprise & CI/CD

  • Governance & Auto-Fix — Enforce naming conventions, complexity limits, and schema rules
  • Governance Templates — Built-in: no-any-schemas, require-descriptions, naming-convention
  • Policy-as-Code — Init policies from templates, check compliance, list active rules
  • Schema Drift Detection — Snapshot-based comparison tracks schema divergence over time
  • Webhook Notifications — Slack, Teams, or any HTTP endpoint with HMAC-SHA256 signing
  • Approval Workflows — Create migration requests, assign reviewers, approve or reject

Reporting & Compliance

  • SARIF + JUnit Output — GitHub Code Scanning and CI test reporting
  • Audit Logging — Per-file migration history with JSON/CSV export
  • Compliance Reports — SOC2 and HIPAA reports from audit logs
  • Dependency Graphs — Export in DOT (Graphviz) or Mermaid format
  • Test Scaffolding — Generate validation test stubs for every migrated schema
  • Risk Scoring — Per-file risk assessment with configurable thresholds

Migration Guides

Step-by-step guides with before/after code, conversion tables, and edge cases.

Framework Integration