CLI Overview
The ModernizeSpec CLI wraps the SDK for terminal use. It provides six commands covering the full modernization lifecycle.
Installation
Section titled “Installation”# Use directly with npx (no install)npx modernizespec <command>
# Install globallynpm install -g @modernizespec/cli
# Install as dev dependencynpm install -D @modernizespec/cliCommands
Section titled “Commands”| Command | Description | Phase |
|---|---|---|
init | Interactive wizard to create .agents/modernization/ | Setup |
analyze | Scan codebase and suggest DDD mapping | Analysis |
validate | Check compliance against JSON Schemas | Verification |
progress | Show current extraction status | Tracking |
diff | Compare legacy vs modern behavior | Verification |
export | Export dashboard as HTML or JSON | Reporting |
Lifecycle Flow
Section titled “Lifecycle Flow”- init — Create the spec files (once)
- analyze — Scan the codebase for bounded contexts and complexity (periodic)
- validate — Verify spec files are correct (every commit)
- progress — Check extraction status (during work)
- diff — Compare legacy and modern behavior (after extraction)
- export — Generate reports for stakeholders (as needed)
Global Flags
Section titled “Global Flags”| Flag | Description |
|---|---|
--dir <path> | Target directory (default: current directory) |
--verbose | Show detailed output |
--json | Output results as JSON (for piping) |
--help | Show help for any command |
--version | Show CLI version |
Exit Codes
Section titled “Exit Codes”| Code | Meaning |
|---|---|
0 | Command completed successfully |
1 | Validation errors or command failure |
2 | Spec files not found |
Next Steps
Section titled “Next Steps”- init — Start with the interactive wizard
- @modernizespec/sdk — Programmatic API behind the CLI