@ayurak/aribot-cli 1.1.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/cli.js +30 -9
  2. package/package.json +1 -1
  3. package/src/cli.ts +33 -9
package/dist/cli.js CHANGED
@@ -553,7 +553,7 @@ program
553
553
  .command('economics')
554
554
  .description('Economic intelligence and cost analysis')
555
555
  .option('--roi <investment>', 'Calculate ROI for security investment (in USD)')
556
- .option('--tco <provider>', 'Calculate TCO for cloud provider (aws, azure, gcp)')
556
+ .option('--tco <diagram-id>', 'Calculate TCO for a diagram using economic intelligence')
557
557
  .option('--analyze <diagram-id>', 'Analyze costs for a diagram')
558
558
  .option('--cost <diagram-id>', 'AI-powered cost intelligence for diagram')
559
559
  .option('--dashboard', 'Show economic intelligence dashboard')
@@ -579,19 +579,40 @@ program
579
579
  console.log(` Risk Reduction: ${chalk_1.default.green('50%')}`);
580
580
  }
581
581
  else if (options.tco) {
582
+ // TCO per diagram using economic intelligence
583
+ const fullId = await resolveDiagramId(options.tco);
582
584
  const data = await apiRequest('/v2/economic/tco/', {
583
585
  method: 'POST',
584
586
  body: JSON.stringify({
585
- provider: options.tco,
586
- workload_type: 'general',
587
- duration_months: 36
587
+ diagram_id: fullId,
588
+ years: 3,
589
+ include_hidden_costs: true,
590
+ include_risk_costs: true
588
591
  })
589
592
  });
590
593
  spinner.succeed('TCO Analysis Complete!');
591
- console.log(chalk_1.default.bold(`\nTotal Cost of Ownership (${options.tco.toUpperCase()}):\n`));
592
- console.log(` Monthly Cost: ${chalk_1.default.cyan('$' + (data.monthly_cost || 0).toLocaleString())}`);
593
- console.log(` Annual Cost: ${chalk_1.default.cyan('$' + (data.annual_cost || 0).toLocaleString())}`);
594
- console.log(` 3-Year TCO: ${chalk_1.default.yellow('$' + (data.total_cost || data.tco || 0).toLocaleString())}`);
594
+ const tco = data.tco || data;
595
+ const diagramName = tco.diagram_name || 'Diagram';
596
+ console.log(chalk_1.default.bold(`\nTotal Cost of Ownership - ${diagramName}:\n`));
597
+ // Cost summary
598
+ console.log(` Monthly Cost: ${chalk_1.default.cyan('$' + (tco.monthly_cost || tco.total_monthly || 0).toLocaleString())}`);
599
+ console.log(` Annual Cost: ${chalk_1.default.cyan('$' + (tco.annual_cost || tco.year_1 || 0).toLocaleString())}`);
600
+ console.log(` 3-Year TCO: ${chalk_1.default.yellow('$' + (tco.total_3_year || tco.total_cost || 0).toLocaleString())}`);
601
+ // Cost breakdown by component
602
+ if (tco.cost_breakdown) {
603
+ console.log(chalk_1.default.bold('\nCost Breakdown:\n'));
604
+ const breakdown = tco.cost_breakdown;
605
+ Object.entries(breakdown).forEach(([key, value]) => {
606
+ if (typeof value === 'number') {
607
+ const label = key.replace(/_/g, ' ').replace(/\b\w/g, c => c.toUpperCase());
608
+ console.log(` ${label}: ${chalk_1.default.cyan('$' + value.toLocaleString())}`);
609
+ }
610
+ });
611
+ }
612
+ // Customizable costs info
613
+ if (tco.customizable) {
614
+ console.log(chalk_1.default.dim('\nCosts can be customized in the Economic Intelligence panel'));
615
+ }
595
616
  }
596
617
  else if (options.analyze) {
597
618
  const data = await apiRequest('/v2/economic/analyze/', {
@@ -653,7 +674,7 @@ program
653
674
  }
654
675
  else {
655
676
  spinner.stop();
656
- console.log(chalk_1.default.yellow('Usage: aribot economics [--roi <amount>] [--tco <provider>] [--analyze <diagram-id>] [--dashboard]'));
677
+ console.log(chalk_1.default.yellow('Usage: aribot economics [--roi <amount>] [--tco <diagram-id>] [--analyze <diagram-id>] [--dashboard]'));
657
678
  }
658
679
  }
659
680
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ayurak/aribot-cli",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "Aribot - Economic, Regulatory & Security APIs for Modern Applications. Advanced multi-framework threat modeling (STRIDE, PASTA, NIST, Aristiun), 100+ compliance standards, Cloud Security, FinOps, and Red Team automation.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/cli.ts CHANGED
@@ -614,7 +614,7 @@ program
614
614
  .command('economics')
615
615
  .description('Economic intelligence and cost analysis')
616
616
  .option('--roi <investment>', 'Calculate ROI for security investment (in USD)')
617
- .option('--tco <provider>', 'Calculate TCO for cloud provider (aws, azure, gcp)')
617
+ .option('--tco <diagram-id>', 'Calculate TCO for a diagram using economic intelligence')
618
618
  .option('--analyze <diagram-id>', 'Analyze costs for a diagram')
619
619
  .option('--cost <diagram-id>', 'AI-powered cost intelligence for diagram')
620
620
  .option('--dashboard', 'Show economic intelligence dashboard')
@@ -642,20 +642,44 @@ program
642
642
  console.log(` Risk Reduction: ${chalk.green('50%')}`);
643
643
 
644
644
  } else if (options.tco) {
645
+ // TCO per diagram using economic intelligence
646
+ const fullId = await resolveDiagramId(options.tco);
645
647
  const data = await apiRequest('/v2/economic/tco/', {
646
648
  method: 'POST',
647
649
  body: JSON.stringify({
648
- provider: options.tco,
649
- workload_type: 'general',
650
- duration_months: 36
650
+ diagram_id: fullId,
651
+ years: 3,
652
+ include_hidden_costs: true,
653
+ include_risk_costs: true
651
654
  })
652
655
  });
653
656
 
654
657
  spinner.succeed('TCO Analysis Complete!');
655
- console.log(chalk.bold(`\nTotal Cost of Ownership (${options.tco.toUpperCase()}):\n`));
656
- console.log(` Monthly Cost: ${chalk.cyan('$' + (data.monthly_cost || 0).toLocaleString())}`);
657
- console.log(` Annual Cost: ${chalk.cyan('$' + (data.annual_cost || 0).toLocaleString())}`);
658
- console.log(` 3-Year TCO: ${chalk.yellow('$' + (data.total_cost || data.tco || 0).toLocaleString())}`);
658
+ const tco = data.tco || data;
659
+ const diagramName = tco.diagram_name || 'Diagram';
660
+ console.log(chalk.bold(`\nTotal Cost of Ownership - ${diagramName}:\n`));
661
+
662
+ // Cost summary
663
+ console.log(` Monthly Cost: ${chalk.cyan('$' + (tco.monthly_cost || tco.total_monthly || 0).toLocaleString())}`);
664
+ console.log(` Annual Cost: ${chalk.cyan('$' + (tco.annual_cost || tco.year_1 || 0).toLocaleString())}`);
665
+ console.log(` 3-Year TCO: ${chalk.yellow('$' + (tco.total_3_year || tco.total_cost || 0).toLocaleString())}`);
666
+
667
+ // Cost breakdown by component
668
+ if (tco.cost_breakdown) {
669
+ console.log(chalk.bold('\nCost Breakdown:\n'));
670
+ const breakdown = tco.cost_breakdown;
671
+ Object.entries(breakdown).forEach(([key, value]) => {
672
+ if (typeof value === 'number') {
673
+ const label = key.replace(/_/g, ' ').replace(/\b\w/g, c => c.toUpperCase());
674
+ console.log(` ${label}: ${chalk.cyan('$' + value.toLocaleString())}`);
675
+ }
676
+ });
677
+ }
678
+
679
+ // Customizable costs info
680
+ if (tco.customizable) {
681
+ console.log(chalk.dim('\nCosts can be customized in the Economic Intelligence panel'));
682
+ }
659
683
 
660
684
  } else if (options.analyze) {
661
685
  const data = await apiRequest('/v2/economic/analyze/', {
@@ -726,7 +750,7 @@ program
726
750
 
727
751
  } else {
728
752
  spinner.stop();
729
- console.log(chalk.yellow('Usage: aribot economics [--roi <amount>] [--tco <provider>] [--analyze <diagram-id>] [--dashboard]'));
753
+ console.log(chalk.yellow('Usage: aribot economics [--roi <amount>] [--tco <diagram-id>] [--analyze <diagram-id>] [--dashboard]'));
730
754
  }
731
755
  } catch (error) {
732
756
  spinner.fail('Economic analysis failed');