@paths.design/caws-cli 8.2.0 ā 8.2.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/budget-derivation.js +10 -10
- package/dist/commands/archive.js +22 -22
- package/dist/commands/burnup.js +7 -7
- package/dist/commands/diagnose.js +25 -25
- package/dist/commands/evaluate.js +20 -20
- package/dist/commands/init.js +71 -72
- package/dist/commands/iterate.js +21 -21
- package/dist/commands/mode.js +11 -11
- package/dist/commands/plan.js +5 -5
- package/dist/commands/provenance.js +86 -86
- package/dist/commands/quality-gates.js +4 -4
- package/dist/commands/quality-monitor.js +17 -17
- package/dist/commands/session.js +312 -0
- package/dist/commands/specs.js +44 -44
- package/dist/commands/status.js +43 -43
- package/dist/commands/templates.js +14 -14
- package/dist/commands/tool.js +1 -1
- package/dist/commands/troubleshoot.js +11 -11
- package/dist/commands/tutorial.js +119 -119
- package/dist/commands/validate.js +6 -6
- package/dist/commands/waivers.js +93 -60
- package/dist/commands/workflow.js +17 -17
- package/dist/commands/worktree.js +13 -13
- package/dist/config/index.js +5 -5
- package/dist/config/modes.js +7 -7
- package/dist/constants/spec-types.js +5 -5
- package/dist/error-handler.js +4 -4
- package/dist/generators/jest-config-generator.js +3 -3
- package/dist/generators/working-spec.js +4 -4
- package/dist/index.js +79 -27
- package/dist/minimal-cli.js +9 -9
- package/dist/policy/PolicyManager.js +1 -1
- package/dist/scaffold/claude-hooks.js +7 -7
- package/dist/scaffold/cursor-hooks.js +8 -8
- package/dist/scaffold/git-hooks.js +152 -152
- package/dist/scaffold/index.js +48 -48
- package/dist/session/session-manager.js +548 -0
- package/dist/test-analysis.js +20 -20
- package/dist/utils/command-wrapper.js +8 -8
- package/dist/utils/detection.js +7 -7
- package/dist/utils/finalization.js +21 -21
- package/dist/utils/git-lock.js +3 -3
- package/dist/utils/gitignore-updater.js +1 -1
- package/dist/utils/project-analysis.js +7 -7
- package/dist/utils/quality-gates-utils.js +35 -35
- package/dist/utils/spec-resolver.js +8 -8
- package/dist/utils/typescript-detector.js +5 -5
- package/dist/utils/yaml-validation.js +1 -1
- package/dist/validation/spec-validation.js +4 -4
- package/dist/worktree/worktree-manager.js +11 -5
- package/package.json +1 -1
package/dist/commands/status.js
CHANGED
|
@@ -319,52 +319,52 @@ function getTimeSince(timestamp) {
|
|
|
319
319
|
function displayStatus(data) {
|
|
320
320
|
const { spec, hooks, provenance, waivers, gates } = data;
|
|
321
321
|
|
|
322
|
-
console.log(chalk.bold.cyan('\
|
|
323
|
-
console.log(chalk.cyan('
|
|
322
|
+
console.log(chalk.bold.cyan('\nCAWS Project Status'));
|
|
323
|
+
console.log(chalk.cyan('==============================================\n'));
|
|
324
324
|
|
|
325
325
|
// Working Spec Status
|
|
326
326
|
if (spec) {
|
|
327
|
-
console.log(chalk.green('
|
|
327
|
+
console.log(chalk.green('Working Spec'));
|
|
328
328
|
console.log(chalk.gray(` ID: ${spec.id} | Tier: ${spec.risk_tier} | Mode: ${spec.mode}`));
|
|
329
329
|
console.log(chalk.gray(` Title: ${spec.title}`));
|
|
330
330
|
} else {
|
|
331
|
-
console.log(chalk.red('
|
|
331
|
+
console.log(chalk.red('Working Spec'));
|
|
332
332
|
console.log(chalk.gray(' No working spec found'));
|
|
333
|
-
console.log(chalk.yellow('
|
|
333
|
+
console.log(chalk.yellow(' Run: caws init . to create one'));
|
|
334
334
|
}
|
|
335
335
|
|
|
336
336
|
console.log('');
|
|
337
337
|
|
|
338
338
|
// Git Hooks Status
|
|
339
339
|
if (hooks.installed) {
|
|
340
|
-
console.log(chalk.green(
|
|
340
|
+
console.log(chalk.green(`Git Hooks`));
|
|
341
341
|
console.log(chalk.gray(` ${hooks.count}/${hooks.total} active: ${hooks.active.join(', ')}`));
|
|
342
342
|
} else {
|
|
343
|
-
console.log(chalk.yellow('
|
|
343
|
+
console.log(chalk.yellow('Git Hooks'));
|
|
344
344
|
console.log(chalk.gray(' No CAWS git hooks installed'));
|
|
345
|
-
console.log(chalk.yellow('
|
|
345
|
+
console.log(chalk.yellow(' Run: caws hooks install'));
|
|
346
346
|
}
|
|
347
347
|
|
|
348
348
|
console.log('');
|
|
349
349
|
|
|
350
350
|
// Provenance Status
|
|
351
351
|
if (provenance.exists) {
|
|
352
|
-
console.log(chalk.green('
|
|
352
|
+
console.log(chalk.green('Provenance'));
|
|
353
353
|
console.log(chalk.gray(` Chain: ${provenance.count} entries`));
|
|
354
354
|
if (provenance.lastUpdate) {
|
|
355
355
|
console.log(chalk.gray(` Last update: ${getTimeSince(provenance.lastUpdate)}`));
|
|
356
356
|
}
|
|
357
357
|
} else {
|
|
358
|
-
console.log(chalk.yellow('
|
|
358
|
+
console.log(chalk.yellow('Provenance'));
|
|
359
359
|
console.log(chalk.gray(' Provenance tracking not initialized'));
|
|
360
|
-
console.log(chalk.yellow('
|
|
360
|
+
console.log(chalk.yellow(' Run: caws provenance init'));
|
|
361
361
|
}
|
|
362
362
|
|
|
363
363
|
console.log('');
|
|
364
364
|
|
|
365
365
|
// Waivers Status
|
|
366
366
|
if (waivers.exists && waivers.total > 0) {
|
|
367
|
-
console.log(chalk.green('
|
|
367
|
+
console.log(chalk.green('Quality Gate Waivers'));
|
|
368
368
|
console.log(
|
|
369
369
|
chalk.gray(
|
|
370
370
|
` ${waivers.active} active, ${waivers.expired} expired, ${waivers.revoked} revoked`
|
|
@@ -372,31 +372,31 @@ function displayStatus(data) {
|
|
|
372
372
|
);
|
|
373
373
|
console.log(chalk.gray(` Total: ${waivers.total} waiver${waivers.total > 1 ? 's' : ''}`));
|
|
374
374
|
} else if (waivers.exists) {
|
|
375
|
-
console.log(chalk.blue('
|
|
375
|
+
console.log(chalk.blue('Quality Gate Waivers'));
|
|
376
376
|
console.log(chalk.gray(' No waivers configured'));
|
|
377
377
|
} else {
|
|
378
|
-
console.log(chalk.yellow('
|
|
378
|
+
console.log(chalk.yellow('Quality Gate Waivers'));
|
|
379
379
|
console.log(chalk.gray(' Waiver system not initialized'));
|
|
380
|
-
console.log(chalk.yellow('
|
|
380
|
+
console.log(chalk.yellow(' Run: caws waivers create (when needed)'));
|
|
381
381
|
}
|
|
382
382
|
|
|
383
383
|
console.log('');
|
|
384
384
|
|
|
385
385
|
// Quality Gates Status
|
|
386
|
-
console.log(chalk.blue('
|
|
386
|
+
console.log(chalk.blue('Quality Gates'));
|
|
387
387
|
console.log(chalk.gray(` ${gates.message}`));
|
|
388
388
|
|
|
389
389
|
// Suggestions
|
|
390
390
|
const suggestions = generateSuggestions(data);
|
|
391
391
|
if (suggestions.length > 0) {
|
|
392
|
-
console.log(chalk.bold.yellow('\
|
|
392
|
+
console.log(chalk.bold.yellow('\nSuggestions:'));
|
|
393
393
|
suggestions.forEach((suggestion) => {
|
|
394
394
|
console.log(chalk.yellow(` ${suggestion}`));
|
|
395
395
|
});
|
|
396
396
|
}
|
|
397
397
|
|
|
398
398
|
// Quick Links
|
|
399
|
-
console.log(chalk.bold.blue('\
|
|
399
|
+
console.log(chalk.bold.blue('\nQuick Links:'));
|
|
400
400
|
if (spec) {
|
|
401
401
|
console.log(chalk.blue(' View spec: .caws/working-spec.yaml'));
|
|
402
402
|
}
|
|
@@ -496,18 +496,18 @@ async function displayVisualStatus(data, currentMode) {
|
|
|
496
496
|
|
|
497
497
|
console.log(
|
|
498
498
|
chalk.bold.cyan(
|
|
499
|
-
`\
|
|
499
|
+
`\nCAWS Project Status (${tierConfig.icon} ${tierConfig.color(currentMode)})`
|
|
500
500
|
)
|
|
501
501
|
);
|
|
502
502
|
console.log(
|
|
503
503
|
chalk.cyan(
|
|
504
|
-
'
|
|
504
|
+
'=================================================================================\n'
|
|
505
505
|
)
|
|
506
506
|
);
|
|
507
507
|
|
|
508
508
|
// Multi-spec system status
|
|
509
509
|
if (specs && specs.length > 0) {
|
|
510
|
-
console.log(chalk.green(
|
|
510
|
+
console.log(chalk.green(`Specs System (${specs.length} specs)`));
|
|
511
511
|
|
|
512
512
|
// Show active specs first
|
|
513
513
|
const activeSpecs = specs.filter((s) => s.status === 'active');
|
|
@@ -526,7 +526,7 @@ async function displayVisualStatus(data, currentMode) {
|
|
|
526
526
|
// Show details for draft specs if not too many
|
|
527
527
|
if (draftSpecs.length <= 3) {
|
|
528
528
|
draftSpecs.forEach((s) => {
|
|
529
|
-
console.log(chalk.gray(`
|
|
529
|
+
console.log(chalk.gray(` - ${s.id}: ${s.title}`));
|
|
530
530
|
});
|
|
531
531
|
}
|
|
532
532
|
}
|
|
@@ -539,7 +539,7 @@ async function displayVisualStatus(data, currentMode) {
|
|
|
539
539
|
// Show details for completed specs if not too many
|
|
540
540
|
if (completedSpecs.length <= 3) {
|
|
541
541
|
completedSpecs.forEach((s) => {
|
|
542
|
-
console.log(chalk.gray(`
|
|
542
|
+
console.log(chalk.gray(` - ${s.id}: ${s.title}`));
|
|
543
543
|
});
|
|
544
544
|
}
|
|
545
545
|
}
|
|
@@ -578,7 +578,7 @@ async function displayVisualStatus(data, currentMode) {
|
|
|
578
578
|
}
|
|
579
579
|
} else if (spec) {
|
|
580
580
|
// Legacy single spec system
|
|
581
|
-
console.log(chalk.green('
|
|
581
|
+
console.log(chalk.green('Working Spec'));
|
|
582
582
|
console.log(chalk.gray(` ID: ${spec.id} | Tier: ${spec.risk_tier} | Mode: ${spec.mode}`));
|
|
583
583
|
console.log(chalk.gray(` Title: ${spec.title}`));
|
|
584
584
|
|
|
@@ -637,10 +637,10 @@ async function displayVisualStatus(data, currentMode) {
|
|
|
637
637
|
)
|
|
638
638
|
);
|
|
639
639
|
} else {
|
|
640
|
-
console.log(chalk.red('
|
|
640
|
+
console.log(chalk.red('No Specs Found'));
|
|
641
641
|
console.log(chalk.gray(' No working spec or specs directory found'));
|
|
642
|
-
console.log(chalk.yellow('
|
|
643
|
-
console.log(chalk.yellow('
|
|
642
|
+
console.log(chalk.yellow(' Run: caws specs create <id> to create specs'));
|
|
643
|
+
console.log(chalk.yellow(' Or run: caws init . for legacy single spec'));
|
|
644
644
|
}
|
|
645
645
|
|
|
646
646
|
console.log('');
|
|
@@ -649,14 +649,14 @@ async function displayVisualStatus(data, currentMode) {
|
|
|
649
649
|
if (modes.isFeatureEnabled('gitHooks', currentMode)) {
|
|
650
650
|
if (hooks.installed) {
|
|
651
651
|
const hookBar = createProgressBar(hooks.count, hooks.total);
|
|
652
|
-
console.log(chalk.green(
|
|
652
|
+
console.log(chalk.green(`Git Hooks`));
|
|
653
653
|
console.log(
|
|
654
654
|
chalk.gray(` ${hookBar} ${hooks.count}/${hooks.total} active: ${hooks.active.join(', ')}`)
|
|
655
655
|
);
|
|
656
656
|
} else {
|
|
657
|
-
console.log(chalk.yellow('
|
|
657
|
+
console.log(chalk.yellow('Git Hooks'));
|
|
658
658
|
console.log(chalk.gray(' No CAWS git hooks installed'));
|
|
659
|
-
console.log(chalk.yellow('
|
|
659
|
+
console.log(chalk.yellow(' Run: caws hooks install'));
|
|
660
660
|
}
|
|
661
661
|
}
|
|
662
662
|
|
|
@@ -666,15 +666,15 @@ async function displayVisualStatus(data, currentMode) {
|
|
|
666
666
|
if (modes.isFeatureEnabled('provenance', currentMode)) {
|
|
667
667
|
if (provenance.exists) {
|
|
668
668
|
const provenanceBar = createProgressBar(provenance.count, Math.max(provenance.count, 10));
|
|
669
|
-
console.log(chalk.green('
|
|
669
|
+
console.log(chalk.green('Provenance'));
|
|
670
670
|
console.log(chalk.gray(` ${provenanceBar} ${provenance.count} entries`));
|
|
671
671
|
if (provenance.lastUpdate) {
|
|
672
672
|
console.log(chalk.gray(` Last update: ${getTimeSince(provenance.lastUpdate)}`));
|
|
673
673
|
}
|
|
674
674
|
} else {
|
|
675
|
-
console.log(chalk.yellow('
|
|
675
|
+
console.log(chalk.yellow('Provenance'));
|
|
676
676
|
console.log(chalk.gray(' Provenance tracking not initialized'));
|
|
677
|
-
console.log(chalk.yellow('
|
|
677
|
+
console.log(chalk.yellow(' Run: caws provenance init'));
|
|
678
678
|
}
|
|
679
679
|
}
|
|
680
680
|
|
|
@@ -684,7 +684,7 @@ async function displayVisualStatus(data, currentMode) {
|
|
|
684
684
|
if (modes.isFeatureEnabled('waivers', currentMode)) {
|
|
685
685
|
if (waivers.exists && waivers.total > 0) {
|
|
686
686
|
const waiverBar = createProgressBar(waivers.active, waivers.total);
|
|
687
|
-
console.log(chalk.green('
|
|
687
|
+
console.log(chalk.green('Quality Gate Waivers'));
|
|
688
688
|
console.log(
|
|
689
689
|
chalk.gray(
|
|
690
690
|
` ${waiverBar} ${waivers.active} active, ${waivers.expired} expired, ${waivers.revoked} revoked`
|
|
@@ -692,12 +692,12 @@ async function displayVisualStatus(data, currentMode) {
|
|
|
692
692
|
);
|
|
693
693
|
console.log(chalk.gray(` Total: ${waivers.total} waiver${waivers.total > 1 ? 's' : ''}`));
|
|
694
694
|
} else if (waivers.exists) {
|
|
695
|
-
console.log(chalk.blue('
|
|
695
|
+
console.log(chalk.blue('Quality Gate Waivers'));
|
|
696
696
|
console.log(chalk.gray(' No waivers configured'));
|
|
697
697
|
} else {
|
|
698
|
-
console.log(chalk.yellow('
|
|
698
|
+
console.log(chalk.yellow('Quality Gate Waivers'));
|
|
699
699
|
console.log(chalk.gray(' Waiver system not initialized'));
|
|
700
|
-
console.log(chalk.yellow('
|
|
700
|
+
console.log(chalk.yellow(' Run: caws waivers create (when needed)'));
|
|
701
701
|
}
|
|
702
702
|
}
|
|
703
703
|
|
|
@@ -705,12 +705,12 @@ async function displayVisualStatus(data, currentMode) {
|
|
|
705
705
|
|
|
706
706
|
// Quality Gates Status (only show in modes that support it)
|
|
707
707
|
if (modes.isFeatureEnabled('qualityGates', currentMode)) {
|
|
708
|
-
console.log(chalk.blue('
|
|
708
|
+
console.log(chalk.blue('Quality Gates'));
|
|
709
709
|
if (gates.checked) {
|
|
710
710
|
if (gates.passed) {
|
|
711
711
|
console.log(chalk.green(` ${createProgressBar(1, 1)} All gates passed`));
|
|
712
712
|
gates.results?.forEach((gate) => {
|
|
713
|
-
const gateStatus = gate.status === 'passed' ? chalk.green('
|
|
713
|
+
const gateStatus = gate.status === 'passed' ? chalk.green('[pass]') : chalk.red('[fail]');
|
|
714
714
|
console.log(chalk.gray(` ${gateStatus} ${gate.name}: ${gate.message || 'OK'}`));
|
|
715
715
|
});
|
|
716
716
|
} else {
|
|
@@ -720,7 +720,7 @@ async function displayVisualStatus(data, currentMode) {
|
|
|
720
720
|
)
|
|
721
721
|
);
|
|
722
722
|
gates.results?.forEach((gate) => {
|
|
723
|
-
const gateStatus = gate.status === 'passed' ? chalk.green('
|
|
723
|
+
const gateStatus = gate.status === 'passed' ? chalk.green('[pass]') : chalk.red('[fail]');
|
|
724
724
|
console.log(chalk.gray(` ${gateStatus} ${gate.name}: ${gate.message || 'Failed'}`));
|
|
725
725
|
});
|
|
726
726
|
}
|
|
@@ -735,20 +735,20 @@ async function displayVisualStatus(data, currentMode) {
|
|
|
735
735
|
const progressBar = createProgressBar(overallProgress, 100);
|
|
736
736
|
|
|
737
737
|
console.log('');
|
|
738
|
-
console.log(chalk.bold.blue('
|
|
738
|
+
console.log(chalk.bold.blue('Overall Progress'));
|
|
739
739
|
console.log(chalk.gray(` ${progressBar} ${progressColor(`${overallProgress}%`)} complete`));
|
|
740
740
|
|
|
741
741
|
// Suggestions (mode-aware)
|
|
742
742
|
const suggestions = generateSuggestions(data, currentMode);
|
|
743
743
|
if (suggestions.length > 0) {
|
|
744
|
-
console.log(chalk.bold.yellow('\
|
|
744
|
+
console.log(chalk.bold.yellow('\nNext Steps:'));
|
|
745
745
|
suggestions.forEach((suggestion, index) => {
|
|
746
746
|
console.log(chalk.yellow(` ${index + 1}. ${suggestion}`));
|
|
747
747
|
});
|
|
748
748
|
}
|
|
749
749
|
|
|
750
750
|
// Quick Links (mode-aware)
|
|
751
|
-
console.log(chalk.bold.blue('\
|
|
751
|
+
console.log(chalk.bold.blue('\nQuick Actions:'));
|
|
752
752
|
if (spec || (specs && specs.length > 0)) {
|
|
753
753
|
if (modes.isFeatureEnabled('validate', currentMode)) {
|
|
754
754
|
console.log(chalk.blue(' View specs: caws specs list'));
|
|
@@ -130,14 +130,14 @@ function listTemplates() {
|
|
|
130
130
|
categories[template.category].push({ id, ...template });
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
console.log(chalk.bold.cyan('\
|
|
133
|
+
console.log(chalk.bold.cyan('\nAvailable CAWS Templates\n'));
|
|
134
134
|
|
|
135
135
|
// Display by category
|
|
136
136
|
for (const [category, categoryTemplates] of Object.entries(categories)) {
|
|
137
137
|
console.log(chalk.bold.white(`${category}:`));
|
|
138
138
|
|
|
139
139
|
for (const template of categoryTemplates) {
|
|
140
|
-
const status = template.available ? chalk.green('
|
|
140
|
+
const status = template.available ? chalk.green('') : chalk.gray('');
|
|
141
141
|
console.log(`${status} ${chalk.bold(template.id.padEnd(25))} - ${template.description}`);
|
|
142
142
|
console.log(chalk.gray(` Usage: caws init --template=${template.id} my-project`));
|
|
143
143
|
console.log(chalk.gray(` Features: ${template.features.join(', ')}`));
|
|
@@ -149,10 +149,10 @@ function listTemplates() {
|
|
|
149
149
|
const totalTemplates = Object.keys(templates).length;
|
|
150
150
|
|
|
151
151
|
if (totalAvailable < totalTemplates) {
|
|
152
|
-
console.log(chalk.yellow(`\n
|
|
152
|
+
console.log(chalk.yellow(`\n${totalTemplates - totalAvailable} additional templates in development`));
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
console.log(chalk.blue('\
|
|
155
|
+
console.log(chalk.blue('\nLearn more:'));
|
|
156
156
|
console.log(chalk.blue(' caws templates --help'));
|
|
157
157
|
console.log(chalk.blue(' docs/guides/template-usage.md'));
|
|
158
158
|
|
|
@@ -168,14 +168,14 @@ function showTemplateInfo(templateId) {
|
|
|
168
168
|
const template = templates[templateId];
|
|
169
169
|
|
|
170
170
|
if (!template) {
|
|
171
|
-
console.error(chalk.red(`\
|
|
172
|
-
console.error(chalk.yellow('\
|
|
171
|
+
console.error(chalk.red(`\nTemplate not found: ${templateId}`));
|
|
172
|
+
console.error(chalk.yellow('\nAvailable templates:'));
|
|
173
173
|
console.error(chalk.yellow(` ${Object.keys(templates).join(', ')}`));
|
|
174
|
-
console.error(chalk.yellow('\
|
|
174
|
+
console.error(chalk.yellow('\nTry: caws templates list'));
|
|
175
175
|
process.exit(1);
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
-
console.log(chalk.bold.cyan(`\
|
|
178
|
+
console.log(chalk.bold.cyan(`\nTemplate: ${template.name}\n`));
|
|
179
179
|
console.log(chalk.white(`Description: ${template.description}`));
|
|
180
180
|
console.log(chalk.white(`Category: ${template.category}`));
|
|
181
181
|
console.log(chalk.white(`Risk Tier: ${template.tier}`));
|
|
@@ -187,7 +187,7 @@ function showTemplateInfo(templateId) {
|
|
|
187
187
|
|
|
188
188
|
console.log(chalk.bold.white('\nFeatures:'));
|
|
189
189
|
template.features.forEach((feature) => {
|
|
190
|
-
console.log(chalk.gray(`
|
|
190
|
+
console.log(chalk.gray(` - ${feature}`));
|
|
191
191
|
});
|
|
192
192
|
|
|
193
193
|
console.log(chalk.bold.white('\nUsage:'));
|
|
@@ -218,9 +218,9 @@ async function templatesCommand(subcommand = 'list', options = {}) {
|
|
|
218
218
|
|
|
219
219
|
case 'info':
|
|
220
220
|
if (!options.name) {
|
|
221
|
-
console.error(chalk.red('\
|
|
222
|
-
console.error(chalk.yellow('
|
|
223
|
-
console.error(chalk.yellow('
|
|
221
|
+
console.error(chalk.red('\nTemplate name required'));
|
|
222
|
+
console.error(chalk.yellow('Usage: caws templates info <template-name>'));
|
|
223
|
+
console.error(chalk.yellow('Try: caws templates list to see available templates'));
|
|
224
224
|
process.exit(1);
|
|
225
225
|
}
|
|
226
226
|
showTemplateInfo(options.name);
|
|
@@ -230,8 +230,8 @@ async function templatesCommand(subcommand = 'list', options = {}) {
|
|
|
230
230
|
listTemplates();
|
|
231
231
|
}
|
|
232
232
|
} catch (error) {
|
|
233
|
-
console.error(chalk.red('\
|
|
234
|
-
console.error(chalk.yellow('\
|
|
233
|
+
console.error(chalk.red('\nError:'), error.message);
|
|
234
|
+
console.error(chalk.yellow('\nTry: caws templates list'));
|
|
235
235
|
process.exit(1);
|
|
236
236
|
}
|
|
237
237
|
}
|
package/dist/commands/tool.js
CHANGED
|
@@ -37,7 +37,7 @@ async function initializeToolSystem() {
|
|
|
37
37
|
toolLoader.on('tool:loaded', ({ id, metadata }) => {
|
|
38
38
|
// Only log in verbose mode or when not using JSON output
|
|
39
39
|
if (!process.env.CAWS_OUTPUT_FORMAT || process.env.CAWS_OUTPUT_FORMAT !== 'json') {
|
|
40
|
-
console.log(`
|
|
40
|
+
console.log(` [ok] Loaded tool: ${metadata.name} (${id})`);
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
|
|
@@ -15,7 +15,7 @@ function displayGuide(guideKey) {
|
|
|
15
15
|
const guide = getTroubleshootingGuide(guideKey);
|
|
16
16
|
|
|
17
17
|
if (!guide) {
|
|
18
|
-
console.error(chalk.red(
|
|
18
|
+
console.error(chalk.red(`Troubleshooting guide '${guideKey}' not found.`));
|
|
19
19
|
console.log(chalk.yellow('\nAvailable guides:'));
|
|
20
20
|
const allGuides = getAllTroubleshootingGuides();
|
|
21
21
|
Object.keys(allGuides).forEach((key) => {
|
|
@@ -25,46 +25,46 @@ function displayGuide(guideKey) {
|
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
console.log(chalk.bold.blue(
|
|
28
|
+
console.log(chalk.bold.blue(`${guide.title}`));
|
|
29
29
|
console.log(chalk.gray('ā'.repeat(50)));
|
|
30
30
|
|
|
31
31
|
if (guide.symptoms && guide.symptoms.length > 0) {
|
|
32
|
-
console.log(chalk.yellow('\
|
|
32
|
+
console.log(chalk.yellow('\nSymptoms:'));
|
|
33
33
|
guide.symptoms.forEach((symptom) => {
|
|
34
|
-
console.log(chalk.gray(`
|
|
34
|
+
console.log(chalk.gray(` - ${symptom}`));
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
if (guide.rootCauses && guide.rootCauses.length > 0) {
|
|
39
|
-
console.log(chalk.red('\
|
|
39
|
+
console.log(chalk.red('\nPossible Root Causes:'));
|
|
40
40
|
guide.rootCauses.forEach((cause) => {
|
|
41
|
-
console.log(chalk.gray(`
|
|
41
|
+
console.log(chalk.gray(` - ${cause}`));
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
if (guide.solutions && guide.solutions.length > 0) {
|
|
46
|
-
console.log(chalk.green('\
|
|
46
|
+
console.log(chalk.green('\nSolutions:'));
|
|
47
47
|
guide.solutions.forEach((solution, index) => {
|
|
48
48
|
console.log(chalk.gray(` ${index + 1}. ${solution}`));
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
if (guide.commands && guide.commands.length > 0) {
|
|
53
|
-
console.log(chalk.cyan('\
|
|
53
|
+
console.log(chalk.cyan('\nTry These Commands:'));
|
|
54
54
|
guide.commands.forEach((command) => {
|
|
55
55
|
console.log(chalk.gray(` $ ${command}`));
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
console.log(chalk.gray('\nā'.repeat(50)));
|
|
60
|
-
console.log(chalk.blue('
|
|
60
|
+
console.log(chalk.blue('For more help: caws --help or visit the documentation'));
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
/**
|
|
64
64
|
* List all available troubleshooting guides
|
|
65
65
|
*/
|
|
66
66
|
function listGuides() {
|
|
67
|
-
console.log(chalk.bold.blue('
|
|
67
|
+
console.log(chalk.bold.blue('Available Troubleshooting Guides'));
|
|
68
68
|
console.log(chalk.gray('ā'.repeat(50)));
|
|
69
69
|
|
|
70
70
|
const allGuides = getAllTroubleshootingGuides();
|
|
@@ -96,7 +96,7 @@ function troubleshootCommand(guide, options) {
|
|
|
96
96
|
displayGuide(guide);
|
|
97
97
|
}
|
|
98
98
|
} catch (error) {
|
|
99
|
-
console.error(chalk.red(
|
|
99
|
+
console.error(chalk.red(`Error: ${error.message}`));
|
|
100
100
|
process.exit(1);
|
|
101
101
|
}
|
|
102
102
|
}
|