@ayurak/aribot-cli 1.1.1 → 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.
package/dist/cli.js CHANGED
@@ -112,7 +112,7 @@ program
112
112
  // Open developer portal if requested
113
113
  if (options.openPortal) {
114
114
  const open = (await import('open')).default;
115
- const portalUrl = 'https://portal.aribot.ayurak.com/developer';
115
+ const portalUrl = 'https://developer.ayurak.com';
116
116
  console.log(chalk_1.default.cyan('Opening developer portal...'));
117
117
  console.log(chalk_1.default.dim(portalUrl));
118
118
  await open(portalUrl);
@@ -125,7 +125,7 @@ program
125
125
  console.log(chalk_1.default.bold('To authenticate, you need an API key.'));
126
126
  console.log();
127
127
  console.log(chalk_1.default.dim('Get your API key from the developer portal:'));
128
- console.log(' ' + chalk_1.default.cyan('https://portal.aribot.ayurak.com/developer'));
128
+ console.log(' ' + chalk_1.default.cyan('https://developer.ayurak.com'));
129
129
  console.log();
130
130
  console.log(chalk_1.default.dim('Or run: ' + chalk_1.default.green('aribot login --open-portal') + ' to open it'));
131
131
  console.log();
@@ -151,7 +151,7 @@ program
151
151
  console.log();
152
152
  console.log(chalk_1.default.red('Invalid API key format'));
153
153
  console.log(chalk_1.default.dim('API keys should be at least 20 characters long.'));
154
- console.log(chalk_1.default.dim('Get a valid key from: https://portal.aribot.ayurak.com/developer'));
154
+ console.log(chalk_1.default.dim('Get a valid key from: https://developer.ayurak.com'));
155
155
  return;
156
156
  }
157
157
  console.log();
@@ -208,7 +208,7 @@ program
208
208
  }
209
209
  console.log();
210
210
  console.log(chalk_1.default.dim('Need a new API key? Visit:'));
211
- console.log(' ' + chalk_1.default.cyan('https://portal.aribot.ayurak.com/developer'));
211
+ console.log(' ' + chalk_1.default.cyan('https://developer.ayurak.com'));
212
212
  }
213
213
  }
214
214
  catch (error) {
@@ -243,7 +243,7 @@ program
243
243
  spinner.stop();
244
244
  console.log(chalk_1.default.bold('\nYour Diagrams:\n'));
245
245
  if (!data.results?.length) {
246
- console.log(chalk_1.default.dim('No diagrams found. Create one at https://portal.aribot.ayurak.com'));
246
+ console.log(chalk_1.default.dim('No diagrams found. Create one at https://developer.ayurak.com'));
247
247
  return;
248
248
  }
249
249
  data.results.forEach((d) => {
@@ -305,7 +305,7 @@ program
305
305
  attempts++;
306
306
  }
307
307
  }
308
- console.log(chalk_1.default.dim(`\nView at: https://portal.aribot.ayurak.com/diagrams/${data.id}`));
308
+ console.log(chalk_1.default.dim(`\nView at: https://developer.ayurak.com/diagrams/${data.id}`));
309
309
  }
310
310
  catch (error) {
311
311
  spinner.fail('Analysis failed');
@@ -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/dist/theme.js CHANGED
@@ -138,7 +138,7 @@ function printWelcome() {
138
138
  console.log();
139
139
  console.log(exports.colors.gold('━'.repeat(58)));
140
140
  console.log();
141
- console.log(` ${exports.colors.gray('Get your API key at:')} ${exports.bold.white('https://portal.aribot.ayurak.com')}`);
141
+ console.log(` ${exports.colors.gray('Get your API key at:')} ${exports.bold.white('https://developer.ayurak.com')}`);
142
142
  console.log();
143
143
  }
144
144
  function printAuthSuccess(email, company, plan) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ayurak/aribot-cli",
3
- "version": "1.1.1",
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
@@ -121,7 +121,7 @@ program
121
121
  // Open developer portal if requested
122
122
  if (options.openPortal) {
123
123
  const open = (await import('open')).default;
124
- const portalUrl = 'https://portal.aribot.ayurak.com/developer';
124
+ const portalUrl = 'https://developer.ayurak.com';
125
125
  console.log(chalk.cyan('Opening developer portal...'));
126
126
  console.log(chalk.dim(portalUrl));
127
127
  await open(portalUrl);
@@ -135,7 +135,7 @@ program
135
135
  console.log(chalk.bold('To authenticate, you need an API key.'));
136
136
  console.log();
137
137
  console.log(chalk.dim('Get your API key from the developer portal:'));
138
- console.log(' ' + chalk.cyan('https://portal.aribot.ayurak.com/developer'));
138
+ console.log(' ' + chalk.cyan('https://developer.ayurak.com'));
139
139
  console.log();
140
140
  console.log(chalk.dim('Or run: ' + chalk.green('aribot login --open-portal') + ' to open it'));
141
141
  console.log();
@@ -162,7 +162,7 @@ program
162
162
  console.log();
163
163
  console.log(chalk.red('Invalid API key format'));
164
164
  console.log(chalk.dim('API keys should be at least 20 characters long.'));
165
- console.log(chalk.dim('Get a valid key from: https://portal.aribot.ayurak.com/developer'));
165
+ console.log(chalk.dim('Get a valid key from: https://developer.ayurak.com'));
166
166
  return;
167
167
  }
168
168
 
@@ -221,7 +221,7 @@ program
221
221
  }
222
222
  console.log();
223
223
  console.log(chalk.dim('Need a new API key? Visit:'));
224
- console.log(' ' + chalk.cyan('https://portal.aribot.ayurak.com/developer'));
224
+ console.log(' ' + chalk.cyan('https://developer.ayurak.com'));
225
225
  }
226
226
  } catch (error: any) {
227
227
  spinner.fail(chalk.red('Authentication failed'));
@@ -259,7 +259,7 @@ program
259
259
  console.log(chalk.bold('\nYour Diagrams:\n'));
260
260
 
261
261
  if (!data.results?.length) {
262
- console.log(chalk.dim('No diagrams found. Create one at https://portal.aribot.ayurak.com'));
262
+ console.log(chalk.dim('No diagrams found. Create one at https://developer.ayurak.com'));
263
263
  return;
264
264
  }
265
265
 
@@ -333,7 +333,7 @@ program
333
333
  }
334
334
  }
335
335
 
336
- console.log(chalk.dim(`\nView at: https://portal.aribot.ayurak.com/diagrams/${data.id}`));
336
+ console.log(chalk.dim(`\nView at: https://developer.ayurak.com/diagrams/${data.id}`));
337
337
  } catch (error) {
338
338
  spinner.fail('Analysis failed');
339
339
  console.error(error);
@@ -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');
package/src/theme.ts CHANGED
@@ -131,7 +131,7 @@ export function printWelcome(): void {
131
131
  console.log();
132
132
  console.log(colors.gold('━'.repeat(58)));
133
133
  console.log();
134
- console.log(` ${colors.gray('Get your API key at:')} ${bold.white('https://portal.aribot.ayurak.com')}`);
134
+ console.log(` ${colors.gray('Get your API key at:')} ${bold.white('https://developer.ayurak.com')}`);
135
135
  console.log();
136
136
  }
137
137