migrate
Migrate an entire project between C# and Calor.
Bash
calor migrate <path> [options]Overview
The migrate command converts all applicable files in a project or directory. It:
- Scans for convertible files
- Creates a migration plan
- Converts files in parallel (optional)
- Generates detailed reports
- Handles errors gracefully without stopping
Quick Start
Bash
# Preview migration (dry run)
calor migrate ./src --dry-run
# Migrate C# to Calor
calor migrate ./src
# Migrate with report
calor migrate ./src --report migration-report.md
# Migrate Calor back to C#
calor migrate ./src --direction calor-to-csOptions
| Option | Short | Default | Description |
|---|---|---|---|
--dry-run | -n | false | Preview changes without writing files |
--benchmark | -b | false | Include before/after metrics comparison |
--direction | -d | cs-to-calor | Migration direction |
--parallel | -p | true | Run conversions in parallel |
--report | -r | None | Save migration report to file (.md or .json) |
--verbose | -v | false | Enable verbose output |
--skip-analyze | — | false | Skip the migration analysis phase |
--skip-verify | — | false | Skip the Z3 contract verification phase |
--verification-timeout | — | 5000 | Z3 verification timeout per contract, in milliseconds |
--explicit-call-closers | — | false | Emit explicit §/C for every §C call (v0.6.0-compatible output). |
Migration Plan
Before converting, the command analyzes your codebase and creates a plan:
Bash
calor migrate ./src --dry-runOutput:
Plain Text
=== Migration Plan ===
Direction: C# → Calor
Source: ./src
Files to Convert:
✓ 24 files fully convertible
⚠ 8 files partially convertible (will have warnings)
✗ 3 files skipped (unsupported constructs)Benchmark Summary
Use --benchmark to see aggregate metrics:
Bash
calor migrate ./src --benchmarkOutput includes:
Plain Text
=== Benchmark Summary ===
Token Savings: 17,090 tokens (37.8% reduction)Migration Reports
Generate detailed reports for documentation:
Bash
# Markdown report
calor migrate ./src --report migration-report.md
# JSON report
calor migrate ./src --report migration-report.jsonExit Codes
| Code | Meaning |
|---|---|
0 | No files failed; warnings alone do not fail the command |
1 | The path was missing, one or more files failed, or migration raised a handled error |
See Also
- calor convert - Convert single files
- calor assess - Find migration candidates
- Adding Calor to Existing Projects - Complete migration guide