claude-code-templates 1.8.3 → 1.10.0

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/src/index.js CHANGED
@@ -12,6 +12,59 @@ const { runCommandStats } = require('./command-stats');
12
12
  const { runHookStats } = require('./hook-stats');
13
13
  const { runMCPStats } = require('./mcp-stats');
14
14
  const { runAnalytics } = require('./analytics');
15
+ const { runHealthCheck } = require('./health-check');
16
+
17
+ async function showMainMenu() {
18
+ console.log(chalk.blue('🚀 Welcome to Claude Code Templates!'));
19
+ console.log('');
20
+
21
+ const initialChoice = await inquirer.prompt([{
22
+ type: 'list',
23
+ name: 'action',
24
+ message: 'What would you like to do?',
25
+ choices: [
26
+ {
27
+ name: '📊 Analytics Dashboard - Monitor your Claude Code usage and sessions',
28
+ value: 'analytics',
29
+ short: 'Analytics Dashboard'
30
+ },
31
+ {
32
+ name: '🔍 Health Check - Verify your Claude Code setup and configuration',
33
+ value: 'health',
34
+ short: 'Health Check'
35
+ },
36
+ {
37
+ name: '⚙️ Project Setup - Configure Claude Code for your project',
38
+ value: 'setup',
39
+ short: 'Project Setup'
40
+ }
41
+ ],
42
+ default: 'analytics'
43
+ }]);
44
+
45
+ if (initialChoice.action === 'analytics') {
46
+ console.log(chalk.blue('📊 Launching Claude Code Analytics Dashboard...'));
47
+ await runAnalytics({});
48
+ return;
49
+ }
50
+
51
+ if (initialChoice.action === 'health') {
52
+ console.log(chalk.blue('🔍 Running Health Check...'));
53
+ const healthResult = await runHealthCheck();
54
+ if (healthResult.runSetup) {
55
+ console.log(chalk.blue('⚙️ Starting Project Setup...'));
56
+ // Continue with setup flow
57
+ return await createClaudeConfig({});
58
+ } else {
59
+ console.log(chalk.green('👍 Health check completed. Returning to main menu...'));
60
+ return await showMainMenu();
61
+ }
62
+ }
63
+
64
+ // Continue with setup if user chose 'setup'
65
+ console.log(chalk.blue('⚙️ Setting up Claude Code configuration...'));
66
+ return await createClaudeConfig({ setupFromMenu: true });
67
+ }
15
68
 
16
69
  async function createClaudeConfig(options = {}) {
17
70
  const targetDir = options.directory || process.cwd();
@@ -40,38 +93,22 @@ async function createClaudeConfig(options = {}) {
40
93
  return;
41
94
  }
42
95
 
43
- // Add initial choice prompt (only if no specific options are provided)
44
- if (!options.yes && !options.language && !options.framework && !options.dryRun) {
45
- console.log(chalk.blue('🚀 Welcome to Claude Code Templates!'));
46
- console.log('');
47
-
48
- const initialChoice = await inquirer.prompt([{
49
- type: 'list',
50
- name: 'action',
51
- message: 'What would you like to do?',
52
- choices: [
53
- {
54
- name: '📊 Analytics Dashboard - Monitor your Claude Code usage and sessions',
55
- value: 'analytics',
56
- short: 'Analytics Dashboard'
57
- },
58
- {
59
- name: '⚙️ Project Setup - Configure Claude Code for your project',
60
- value: 'setup',
61
- short: 'Project Setup'
62
- }
63
- ],
64
- default: 'analytics'
65
- }]);
66
-
67
- if (initialChoice.action === 'analytics') {
68
- console.log(chalk.blue('📊 Launching Claude Code Analytics Dashboard...'));
69
- await runAnalytics(options);
70
- return;
96
+ // Handle health check
97
+ let shouldRunSetup = false;
98
+ if (options.healthCheck || options.health || options.check || options.verify) {
99
+ const healthResult = await runHealthCheck();
100
+ if (healthResult.runSetup) {
101
+ console.log(chalk.blue('⚙️ Starting Project Setup...'));
102
+ shouldRunSetup = true;
103
+ } else {
104
+ console.log(chalk.green('👍 Health check completed. Returning to main menu...'));
105
+ return await showMainMenu();
71
106
  }
72
-
73
- // Continue with setup if user chose 'setup'
74
- console.log(chalk.blue('⚙️ Setting up Claude Code configuration...'));
107
+ }
108
+
109
+ // Add initial choice prompt (only if no specific options are provided and not continuing from health check or menu)
110
+ if (!shouldRunSetup && !options.setupFromMenu && !options.yes && !options.language && !options.framework && !options.dryRun) {
111
+ return await showMainMenu();
75
112
  } else {
76
113
  console.log(chalk.blue('🚀 Setting up Claude Code configuration...'));
77
114
  }
@@ -186,4 +223,4 @@ async function createClaudeConfig(options = {}) {
186
223
  }
187
224
  }
188
225
 
189
- module.exports = createClaudeConfig;
226
+ module.exports = { createClaudeConfig, showMainMenu };