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-cs

Options

OptionShortDefaultDescription
--dry-run-nfalsePreview changes without writing files
--benchmark-bfalseInclude before/after metrics comparison
--direction-dcs-to-calorMigration direction
--parallel-ptrueRun conversions in parallel
--report-rNoneSave migration report to file (.md or .json)
--verbose-vfalseEnable verbose output

Migration Plan

Before converting, the command analyzes your codebase and creates a plan:

Bash
calor migrate ./src --dry-run

Output:

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 --benchmark

Output 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.json

Exit Codes

CodeMeaning
0All files migrated successfully
1Some files failed or had warnings
2Error - invalid arguments, directory not found, etc.

See Also