@modernizespec/cli
@modernizespec/cli is the command-line interface for ModernizeSpec. It wraps @modernizespec/sdk for terminal use, providing commands for initialization, analysis, validation, progress tracking, parity diffing, and export.
Installation
Section titled “Installation”# Use directly with npx (no install needed)npx modernizespec <command>
# Or install globallynpm install -g @modernizespec/cli
# Or install as a dev dependencynpm install -D @modernizespec/cliCommands
Section titled “Commands”| Command | Description |
|---|---|
init | Interactive wizard to create .agents/modernization/ |
analyze | Scan codebase and suggest DDD mapping |
validate | Check file compliance against JSON Schemas |
progress | Show extraction status |
diff | Compare legacy vs modern behavior |
export | Export dashboard as HTML or JSON |
npx modernizespec init # Interactive wizard → generates filesnpx modernizespec analyze # Scans codebase → suggests DDD mappingnpx modernizespec validate # Checks file compliance against schemasnpx modernizespec progress # Shows extraction statusnpx modernizespec diff # Compares legacy vs modern behaviornpx modernizespec export --format html # Dashboard exportRelationship to SDK
Section titled “Relationship to SDK”The CLI is a thin wrapper around the SDK. Every CLI command maps to an SDK method:
| CLI Command | SDK Method |
|---|---|
modernizespec init | ModernizeSpec.init(options) |
modernizespec analyze | ModernizeSpec.analyze(dir, options) |
modernizespec validate | spec.validate() |
modernizespec progress | spec.migrationState (read) |
modernizespec diff | spec.parity.compare() |
modernizespec export | spec.export(format) |
If you need programmatic access, use the SDK directly. The CLI is for interactive terminal use.
Package Architecture
Section titled “Package Architecture”Detailed Command Reference
Section titled “Detailed Command Reference”Each command has its own reference page:
- init — Create
.agents/modernization/with interactive wizard - analyze — Scan codebase and suggest bounded contexts
- validate — Check compliance against JSON Schemas
- progress — Show current extraction status
- diff — Compare legacy and modern behavior
- export — Export as HTML dashboard or JSON
Next Steps
Section titled “Next Steps”- CLI Overview — Full command reference
- @modernizespec/sdk — Programmatic API