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 |
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 | All files migrated successfully |
1 | Some files failed or had warnings |
2 | Error - invalid arguments, directory not found, etc. |
See Also
- calor convert - Convert single files
- calor analyze - Find migration candidates
- Adding Calor to Existing Projects - Complete migration guide