TypeScript schema migration CLI - migrate between Zod, Yup, Joi, and more
npm install schemashift-cliTypeScript schema migration CLI. Convert between Zod, Yup, Joi, io-ts, Valibot, ArkType, Superstruct, and Effect Schema with AST-based transformations.




``bash`
npm install -g schemashift-cli
Create a .schemashiftrc.json configuration file.
`bash`
schemashift init [--force]
Analyze schemas in your project without modifying files.
`bash`
schemashift analyze
| Option | Description | Tier |
|--------|-------------|------|
| --json | Output as JSON | Free |-v, --verbose
| | Show detailed file paths | Free |--detailed
| | Full stats with complexity scoring | Individual+ |--readiness
| | Migration readiness report, e.g. yup->zod | Individual+ |--complexity
| | Per-schema complexity scores | Individual+ |--behavioral
| | Behavioral difference warnings, e.g. yup->zod | Free |--bundle
| | Bundle size estimation, e.g. zod->valibot | Individual+ |--performance
| | Performance impact analysis, e.g. zod-v3->v4 | Individual+ |--dedup
| | Detect duplicate type definitions | Individual+ |--dead-schemas
| | Detect unused schema definitions | Individual+ |--import-dedup
| | Detect duplicate imports from the same module | Individual+ |--advisor
| | Migration vs Standard Schema adapter guidance | Free |
Transform schemas from one library to another.
`bash`
schemashift migrate
Required (single-step):
| Option | Description |
|--------|-------------|
| -f, --from | Source library (yup, joi, io-ts, zod-v3, zod) |-t, --to
| | Target library (zod, v4, valibot) |
Or (chain migration):
| Option | Description | Tier |
|--------|-------------|------|
| --chain | Multi-step, e.g. yup->zod->valibot | Pro+ |
Options:
| Option | Description | Tier |
|--------|-------------|------|
| -d, --dry-run | Preview changes with diff output | Free |-v, --verbose
| | Show warnings and detailed info | Free |-c, --config
| | Path to config file | Free |--report
| | Generate report (json, html, csv) | Individual+ |--report-output
| | Custom report output path | Individual+ |--git-branch
| | Create a git branch for changes | Individual+ |--git-commit
| | Auto-commit changes | Individual+ |--no-backup
| | Skip backup creation | Free |--yes
| | Skip confirmation prompt | Free |--ci
| | CI mode (non-interactive, exit 1 on failure) | Pro+ |--cross-file
| | Resolve cross-file schema dependencies | Pro+ |--compat-check
| | Run compatibility check before migration | Pro+ |--fail-on-warnings
| | Exit 1 if any warnings | Team |--max-risk-score
| | Exit 1 if any file exceeds risk score | Team |--scaffold-tests
| | Generate validation tests after migration | Pro+ |--audit
| | Enable migration audit logging | Team |
Watch files and transform on save.
`bash`
schemashift watch
Tier: Pro+
Restore files from a backup.
`bash`
schemashift rollback [backupId]
| Option | Description |
|--------|-------------|
| -l, --list | List available backups |--clean
| | Remove old backups (keeps last 5) |
Manage your license.
`bash`
schemashift license [options]
| Option | Description |
|--------|-------------|
| -a, --activate | Activate a license key |-d, --deactivate
| | Deactivate current license |-s, --status
| | Show license status |
Check schema library compatibility before migration.
`bash`
schemashift compat
Detects installed library versions, reports version-specific issues, and identifies ecosystem dependencies (drizzle-zod, tRPC, etc.) affected by your migration.
Tier: Pro+
Run schema governance checks.
`bash`
schemashift governance
Enforces naming conventions, complexity limits, required validations, and more. Configure rules in .schemashiftrc.json.
Tier: Team
Display pricing information.
`bash`
schemashift pricing
Create .schemashiftrc.json with schemashift init:
`json`
{
"include": ["src//.ts", "src//.tsx"],
"exclude": ["/node_modules/", "/dist/", "*/.d.ts"],
"git": {
"enabled": false,
"createBranch": true,
"branchPrefix": "schemashift/",
"autoCommit": false
},
"backup": { "enabled": true, "dir": ".schemashift-backup" },
"customRules": [],
"suppressWarnings": [],
"governance": {
"rules": {
"naming-convention": { "pattern": ".*Schema$" },
"max-complexity": { "threshold": 80 },
"no-any": {},
"required-validations": {}
}
},
"plugins": ["./my-plugin.js"]
}
`bashQuick analysis
schemashift analyze ./src
Environment Variables
| Variable | Description |
|----------|-------------|
|
SCHEMASHIFT_LICENSE_KEY` | License key for CI/CD (avoids interactive activation) || Package | Description |
|---------|-------------|
| @schemashift/core | Core analysis and transformation engine |
| @schemashift/yup-zod | Yup ↔ Zod transformer |
| @schemashift/joi-zod | Joi → Zod transformer |
| @schemashift/zod-v3-v4 | Zod v3 → v4 upgrade |
| @schemashift/io-ts-zod | io-ts → Zod transformer |
| @schemashift/zod-valibot | Zod ↔ Valibot transformer |
| @schemashift/zod-arktype | Zod ↔ ArkType transformer |
| @schemashift/zod-superstruct | Zod ↔ Superstruct transformer |
| @schemashift/io-ts-effect | io-ts → Effect Schema transformer |
- Documentation
- Pricing
- Migration Guides
MIT