Complete Command-Line Interface Documentation
NAAb Pivot provides a comprehensive CLI for analyzing, synthesizing, validating, and benchmarking code evolution.
These options apply to all commands:
./naab/build/naab-lang pivot.naab [GLOBAL OPTIONS] <command> [COMMAND OPTIONS]Display help information
./naab/build/naab-lang pivot.naab --help
./naab/build/naab-lang pivot.naab analyze --helpDisplay version information
./naab/build/naab-lang pivot.naab --version
# Output: NAAb Pivot v1.0.0Enable verbose logging
./naab/build/naab-lang pivot.naab --verbose analyze slow.pySuppress all output except errors
./naab/build/naab-lang pivot.naab --quiet evolve slow.pySelect optimization profile
Options: ultra-safe, conservative, balanced (default), aggressive, experimental, minimal, embedded, wasm
./naab/build/naab-lang pivot.naab --profile aggressive evolve slow.pySet output directory for vessels
./naab/build/naab-lang pivot.naab --output ./build/vessels evolve slow.pySet report output format
Options: json (default), html, csv, sarif, markdown
./naab/build/naab-lang pivot.naab --format html benchmark ./vesselsOverride governance checks (use with caution)
./naab/build/naab-lang pivot.naab --governance-override evolve slow.pyGenerate governance compliance report
./naab/build/naab-lang pivot.naab --governance-report report.json evolve slow.pyAnalyze source code for optimization opportunities
./naab/build/naab-lang pivot.naab analyze <file> [OPTIONS]Force language detection (auto-detected by default)
Options: python, ruby, javascript, naab, php, java, go, csharp
./naab/build/naab-lang pivot.naab analyze script.txt --language pythonOnly report functions with complexity >= n (default: 5)
./naab/build/naab-lang pivot.naab analyze slow.py --min-complexity 10Force target language recommendation
Options: go, cpp, rust, ruby, js, php, zig, julia
./naab/build/naab-lang pivot.naab analyze slow.py --target rustOnly analyze functions detected as hotspots (requires profiling data)
./naab/build/naab-lang pivot.naab analyze slow.py --hotspot-only --profile-data profile.jsonUse profiling data for hotspot detection
./naab/build/naab-lang pivot.naab analyze slow.py --profile-data cProfile.profWrite analysis blueprint to JSON file
./naab/build/naab-lang pivot.naab analyze slow.py --json-output analysis.jsonBasic analysis:
./naab/build/naab-lang pivot.naab analyze slow_compute.pyOutput:
{
"status": "ANALYZED",
"source": "PYTHON",
"functions": [
{
"name": "heavy_computation",
"complexity": 8,
"target": "GO"
}
]
}Force Rust target:
./naab/build/naab-lang pivot.naab analyze slow.py --target rust > blueprint.jsonProfile-guided analysis:
# Generate profile data
python -m cProfile -o slow.prof slow.py
# Analyze with profiling
./naab/build/naab-lang pivot.naab analyze slow.py \
--profile-data slow.prof \
--hotspot-onlyGenerate optimized vessel code from analysis blueprint
./naab/build/naab-lang pivot.naab synthesize <blueprint.json> [OPTIONS]Optimization profile (overrides global)
./naab/build/naab-lang pivot.naab synthesize blueprint.json --profile aggressiveCompile N vessels in parallel (default: CPU count)
./naab/build/naab-lang pivot.naab synthesize blueprint.json --parallel 8Disable vessel cache (force recompilation)
./naab/build/naab-lang pivot.naab synthesize blueprint.json --no-cacheEnable SIMD optimizations (AVX2, AVX-512)
./naab/build/naab-lang pivot.naab synthesize blueprint.json --enable-simdEnable Link-Time Optimization
./naab/build/naab-lang pivot.naab synthesize blueprint.json --enable-ltoStrip debug symbols from binaries
./naab/build/naab-lang pivot.naab synthesize blueprint.json --strip-debugUse custom template directory
./naab/build/naab-lang pivot.naab synthesize blueprint.json --template-dir ./custom-templatesBasic synthesis:
./naab/build/naab-lang pivot.naab synthesize analysis.jsonOutput:
[SYNTHESIZER] Loading blueprint: analysis.json
[SYNTHESIZER] Generating heavy_computation (GO)...
✓ Code generated: vessels/heavy_computation_GO.go
✓ Compiling...
✓ Compilation successful: vessels/heavy_computation_vessel
Aggressive optimization:
./naab/build/naab-lang pivot.naab synthesize blueprint.json \
--profile aggressive \
--enable-simd \
--enable-lto \
--strip-debugParallel compilation:
./naab/build/naab-lang pivot.naab synthesize blueprint.json --parallel 16Validate parity between legacy and vessel implementations
./naab/build/naab-lang pivot.naab validate <legacy> <vessel> [OPTIONS]Number of test cases to run (default: 100)
./naab/build/naab-lang pivot.naab validate slow.py vessel --test-count 1000Maximum allowed relative error (default: 0.001 = 0.1%)
./naab/build/naab-lang pivot.naab validate slow.py vessel --tolerance 0.01Required confidence level (default: 0.9999 = 99.99%)
./naab/build/naab-lang pivot.naab validate slow.py vessel --confidence 0.999Use custom test cases from JSON file
./naab/build/naab-lang pivot.naab validate slow.py vessel --test-cases cases.jsonFormat (cases.json):
{
"test_cases": [
{"input": [1, 2, 3], "expected": 6},
{"input": [10, 20], "expected": 30}
]
}Enable fuzz testing (random inputs)
./naab/build/naab-lang pivot.naab validate slow.py vessel --fuzz-test --test-count 10000Enable property-based testing (QuickCheck-style)
./naab/build/naab-lang pivot.naab validate slow.py vessel --property-basedSave validation report to file
./naab/build/naab-lang pivot.naab validate slow.py vessel --report validation.jsonBasic validation:
./naab/build/naab-lang pivot.naab validate slow_compute.py vessels/heavy_computation_vesselOutput:
[VALIDATOR] Comparing implementations...
Legacy: slow_compute.py
Vessel: vessels/heavy_computation_vessel
Running 100 test cases...
✓ Test 0: ✓ (error: 0.00001%)
...
✓ Test 99: ✓ (error: 0.00001%)
═══════════════════════════════════════════════
✅ PARITY CERTIFIED
═══════════════════════════════════════════════
Performance:
Legacy: 2843ms
Vessel: 812ms
Speedup: 3.5x ⚡
Strict validation:
./naab/build/naab-lang pivot.naab validate slow.py vessel \
--test-count 10000 \
--tolerance 0.0001 \
--confidence 0.99999Fuzz testing:
./naab/build/naab-lang pivot.naab validate slow.py vessel \
--fuzz-test \
--test-count 100000 \
--report fuzz-results.jsonRun performance benchmarks on vessels
./naab/build/naab-lang pivot.naab benchmark <vessel-dir> [OPTIONS]Number of benchmark iterations (default: 100)
./naab/build/naab-lang pivot.naab benchmark vessels/ --iterations 1000Number of warmup iterations (default: 10)
./naab/build/naab-lang pivot.naab benchmark vessels/ --warmup 50Compare against baseline results
./naab/build/naab-lang pivot.naab benchmark vessels/ --baseline baseline.jsonFail if performance degrades by more than N% (default: 10)
./naab/build/naab-lang pivot.naab benchmark vessels/ \
--baseline baseline.json \
--regression-threshold 5Save current results as new baseline
./naab/build/naab-lang pivot.naab benchmark vessels/ --save-baseline baseline.jsonOutput format (json, html, csv, sarif)
./naab/build/naab-lang pivot.naab benchmark vessels/ --format html > report.htmlCompare multiple vessels
./naab/build/naab-lang pivot.naab benchmark vessels/ --compareBasic benchmark:
./naab/build/naab-lang pivot.naab benchmark vessels/Output:
[BENCHMARK] Running benchmark suite: vessels/
Benchmark: heavy_computation_vessel
Iterations: 100
Mean: 812.34ms
Median: 812.00ms
P95: 814.50ms
P99: 815.00ms
✓ Benchmark complete: vessels/benchmark-report.json
Regression detection:
./naab/build/naab-lang pivot.naab benchmark vessels/ \
--baseline previous-run.json \
--regression-threshold 5HTML report:
./naab/build/naab-lang pivot.naab benchmark vessels/ \
--format html \
--output benchmark-report.htmlRun full evolution pipeline (analyze → synthesize → validate → benchmark)
./naab/build/naab-lang pivot.naab evolve <file> [OPTIONS]Accepts all options from analyze, synthesize, validate, and benchmark commands.
--profile <name> # Optimization profile
--target <lang> # Force target language
--min-complexity <n> # Minimum complexity threshold
--test-count <n> # Validation test count
--tolerance <float> # Validation tolerance
--format <format> # Report format
--output <path> # Output directoryBasic evolution:
./naab/build/naab-lang pivot.naab evolve slow_compute.pyOutput:
╔══════════════════════════════════════════════╗
║ NAAb Pivot - Code Evolution ║
╚══════════════════════════════════════════════╝
[1/4] Analyzing...
✓ Detected: Python
✓ Found 1 function: heavy_computation
✓ Recommended target: GO
[2/4] Synthesizing...
✓ Generated: vessels/heavy_computation_GO.go
✓ Compiled: vessels/heavy_computation_vessel
[3/4] Validating...
✓ Running 100 test cases...
✓ PARITY CERTIFIED (99.99% confidence)
[4/4] Benchmarking...
✓ Legacy: 2843ms
✓ Vessel: 812ms
✓ Speedup: 3.5x ⚡
═══════════════════════════════════════════════
✅ EVOLUTION COMPLETE
═══════════════════════════════════════════════
Vessels: ./vessels/
Reports: ./vessels/evolution-report.json
Aggressive optimization:
./naab/build/naab-lang pivot.naab evolve slow.py \
--profile aggressive \
--target rust \
--enable-simd \
--enable-lto \
--test-count 1000Generate HTML report:
./naab/build/naab-lang pivot.naab evolve slow.py --format html > report.htmlCreate incremental migration plan for large codebases
./naab/build/naab-lang migrate.naab create_migration_plan <project-dir> [OPTIONS]Minimum optimization score to include (default: 50)
./naab/build/naab-lang migrate.naab create_migration_plan ./project --min-score 80Number of migration phases (default: 4)
./naab/build/naab-lang migrate.naab create_migration_plan ./project --phases 6Save migration plan to file
./naab/build/naab-lang migrate.naab create_migration_plan ./project --output plan.jsonInclude time/resource estimates
./naab/build/naab-lang migrate.naab create_migration_plan ./project --estimate-effortCreate migration plan:
./naab/build/naab-lang migrate.naab create_migration_plan /path/to/large/projectOutput:
{
"status": "PLAN_CREATED",
"total_files": 156,
"candidates": [
{
"file": "core/sales_aggregator.py",
"score": 92.3,
"estimated_speedup": 12.5,
"functions": [...]
}
],
"phases": [
{
"phase": 1,
"name": "Low-hanging fruit",
"files": 12,
"estimated_effort_weeks": 6
}
]
}Launch web dashboard for visualization
./naab/build/naab-lang dashboard.naab [OPTIONS]Dashboard port (default: 8080)
./naab/build/naab-lang dashboard.naab --port 3000Bind address (default: 0.0.0.0)
./naab/build/naab-lang dashboard.naab --host localhostWorkspace directory to monitor (default: ./workspace)
./naab/build/naab-lang dashboard.naab --workspace /path/to/projects./naab/build/naab-lang dashboard.naab
# Output:
# 📊 Dashboard URL: http://localhost:8080
# 🚀 Press Ctrl+C to stopDefault output directory for vessels
export PIVOT_OUTPUT=/opt/vessels
./naab/build/naab-lang pivot.naab evolve slow.pyDefault optimization profile
export PIVOT_PROFILE=aggressive
./naab/build/naab-lang pivot.naab evolve slow.pyDefault validation tolerance
export PIVOT_TOLERANCE=0.01 # 1%
./naab/build/naab-lang pivot.naab validate slow.py vesselWorkspace directory for dashboard
export PIVOT_WORKSPACE=/path/to/projects
./naab/build/naab-lang dashboard.naabDashboard port
export PIVOT_DASHBOARD_PORT=3000
./naab/build/naab-lang dashboard.naab{
"profile": "balanced",
"output": "~/vessels",
"format": "json",
"test_count": 100,
"tolerance": 0.001,
"parallel": 8,
"enable_simd": false,
"enable_lto": false
}Overrides global config for current project:
{
"project_name": "MyProject",
"profile": "aggressive",
"output": "./build/vessels",
"enable_simd": true,
"enable_lto": true,
"governance": {
"enforce": true,
"config": "./govern.json"
}
}| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Invalid arguments |
| 3 | Analysis failed |
| 4 | Synthesis failed (compilation error) |
| 5 | Validation failed (parity NOT certified) |
| 6 | Benchmark failed (regression detected) |
| 7 | Governance violation |
| 8 | File not found |
| 9 | Permission denied |
| 10 | Timeout |
./naab/build/naab-lang pivot.naab evolve slow.py./naab/build/naab-lang pivot.naab evolve slow.py \
--profile aggressive \
--target rust./naab/build/naab-lang pivot.naab evolve slow.py \
--test-count 10000 \
--tolerance 0.0001 \
--confidence 0.99999./naab/build/naab-lang pivot.naab evolve slow.py \
--format html \
--output ./reports/evolution.html# Analyze project
./naab/build/naab-lang migrate.naab create_migration_plan ./my-project > plan.json
# Evolve Phase 1 files
for file in $(jq -r '.phases[0].files[]' plan.json); do
./naab/build/naab-lang pivot.naab evolve "$file"
done# Run in CI pipeline
./naab/build/naab-lang pivot.naab benchmark vessels/ \
--baseline baseline.json \
--regression-threshold 5 \
--format sarif > benchmark.sarif
# Upload to GitHub Code Scanning
gh api repos/:owner/:repo/code-scanning/sarifs \
--method POST \
--field sarif=@benchmark.sarifNext: API Reference | Profiles Guide