claude-code-templates 1.4.2 → 1.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-templates",
3
- "version": "1.4.2",
3
+ "version": "1.4.3",
4
4
  "description": "CLI tool to setup Claude Code configurations with framework-specific commands, automation hooks and MCP Servers for your projects",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -106,7 +106,12 @@ async function analyzeCommands(targetDir = process.cwd()) {
106
106
  */
107
107
  function displayCommandStats(analysis) {
108
108
  console.log(chalk.cyan('\nšŸ“Š Claude Code Command Analysis'));
109
- console.log(chalk.gray('═'.repeat(97)));
109
+
110
+ // Calculate header width dynamically
111
+ const headerWidth = analysis.commands.length > 0 ?
112
+ Math.min(Math.max(...analysis.commands.map(cmd => cmd.name.length)), 25) + 60 : 80;
113
+
114
+ console.log(chalk.gray('═'.repeat(headerWidth)));
110
115
 
111
116
  if (!analysis.exists) {
112
117
  console.log(chalk.yellow('āš ļø ' + analysis.message));
@@ -131,37 +136,53 @@ function displayCommandStats(analysis) {
131
136
  console.log(chalk.green(`āœ… Found ${analysis.total} command file(s) (${totalSizeKB} KB, ~${totalTokens} tokens total)`));
132
137
  console.log('');
133
138
 
139
+ // Calculate dynamic column widths based on content
140
+ const maxNameLength = Math.max(
141
+ 7, // Minimum width for "Command"
142
+ Math.max(...analysis.commands.map(cmd => cmd.name.length))
143
+ );
144
+ const nameWidth = Math.min(maxNameLength, 25); // Cap at 25 characters
145
+
134
146
  // Table header
135
147
  const header = chalk.bold.blue(
136
- 'Command'.padEnd(18) +
137
- 'Size'.padEnd(7) +
138
- 'Lines'.padEnd(6) +
139
- 'Words'.padEnd(6) +
140
- 'Tokens (aprox)'.padEnd(14) +
148
+ 'Command'.padEnd(nameWidth) + ' │ ' +
149
+ 'Size'.padEnd(6) + ' │ ' +
150
+ 'Lines'.padEnd(5) + ' │ ' +
151
+ 'Words'.padEnd(5) + ' │ ' +
152
+ 'Tokens (aprox)'.padEnd(13) + ' │ ' +
141
153
  'Last Modified'
142
154
  );
143
155
  console.log(header);
144
- console.log(chalk.gray('─'.repeat(97)));
156
+
157
+ // Create separator line with proper spacing
158
+ const separatorLength = nameWidth + 6 + 5 + 5 + 13 + 13 + 15; // Calculate total width
159
+ console.log(chalk.gray('─'.repeat(separatorLength)));
145
160
 
146
161
  // Table rows
147
162
  analysis.commands.forEach(cmd => {
148
- const sizeFormatted = `${(cmd.size / 1024).toFixed(1)}KB`.padEnd(7);
149
- const linesFormatted = cmd.lines.toString().padEnd(6);
150
- const wordsFormatted = cmd.wordCount.toString().padEnd(6);
151
- const tokensFormatted = cmd.tokens.toString().padEnd(14);
163
+ // Truncate command name if too long and add ellipsis
164
+ let displayName = cmd.name;
165
+ if (displayName.length > nameWidth) {
166
+ displayName = displayName.substring(0, nameWidth - 3) + '...';
167
+ }
168
+
169
+ const sizeFormatted = `${(cmd.size / 1024).toFixed(1)}KB`.padEnd(6);
170
+ const linesFormatted = cmd.lines.toString().padEnd(5);
171
+ const wordsFormatted = cmd.wordCount.toString().padEnd(5);
172
+ const tokensFormatted = cmd.tokens.toString().padEnd(13);
152
173
  const dateFormatted = cmd.lastModified.toLocaleDateString();
153
174
 
154
- const row = chalk.white(cmd.name.padEnd(18)) +
155
- chalk.cyan(sizeFormatted) +
156
- chalk.yellow(linesFormatted) +
157
- chalk.green(wordsFormatted) +
158
- chalk.magenta(tokensFormatted) +
175
+ const row = chalk.white(displayName.padEnd(nameWidth)) + chalk.gray(' │ ') +
176
+ chalk.cyan(sizeFormatted) + chalk.gray(' │ ') +
177
+ chalk.yellow(linesFormatted) + chalk.gray(' │ ') +
178
+ chalk.green(wordsFormatted) + chalk.gray(' │ ') +
179
+ chalk.magenta(tokensFormatted) + chalk.gray(' │ ') +
159
180
  chalk.gray(dateFormatted);
160
181
 
161
182
  console.log(row);
162
183
  });
163
184
 
164
- console.log(chalk.gray('─'.repeat(97)));
185
+ console.log(chalk.gray('─'.repeat(separatorLength)));
165
186
  console.log(chalk.bold(`Total: ${analysis.total} commands, ${totalSizeKB} KB, ~${totalTokens} tokens`));
166
187
  return true; // Indicate commands were found and displayed
167
188
  }