@kood/claude-code 0.1.9 → 0.1.10
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/index.js +54 -35
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -281,8 +281,31 @@ var init = async (options) => {
|
|
|
281
281
|
}
|
|
282
282
|
logger.blank();
|
|
283
283
|
logger.success(`Total: ${totalFiles} files, ${totalDirectories} directories`);
|
|
284
|
-
|
|
285
|
-
|
|
284
|
+
const { hasSkills, hasCommands } = await checkSkillsAndCommandsExist(templates);
|
|
285
|
+
let installSkills = options.skills ?? false;
|
|
286
|
+
let installCommands = options.commands ?? false;
|
|
287
|
+
if (!options.skills && !options.commands && (hasSkills || hasCommands)) {
|
|
288
|
+
logger.blank();
|
|
289
|
+
if (hasSkills) {
|
|
290
|
+
const skillsResponse = await prompts({
|
|
291
|
+
type: "confirm",
|
|
292
|
+
name: "install",
|
|
293
|
+
message: "Install skills to .claude/skills/?",
|
|
294
|
+
initial: true
|
|
295
|
+
});
|
|
296
|
+
installSkills = skillsResponse.install ?? false;
|
|
297
|
+
}
|
|
298
|
+
if (hasCommands) {
|
|
299
|
+
const commandsResponse = await prompts({
|
|
300
|
+
type: "confirm",
|
|
301
|
+
name: "install",
|
|
302
|
+
message: "Install commands to .claude/commands/?",
|
|
303
|
+
initial: true
|
|
304
|
+
});
|
|
305
|
+
installCommands = commandsResponse.install ?? false;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
if (installSkills || installCommands) {
|
|
286
309
|
const existingClaudeFiles = await checkExistingClaudeFiles(targetDir);
|
|
287
310
|
if (existingClaudeFiles.length > 0 && !options.force) {
|
|
288
311
|
logger.warn("The following .claude files/folders already exist:");
|
|
@@ -296,37 +319,33 @@ var init = async (options) => {
|
|
|
296
319
|
});
|
|
297
320
|
if (!response.overwrite) {
|
|
298
321
|
logger.info("Skipping skills/commands installation.");
|
|
299
|
-
|
|
300
|
-
|
|
322
|
+
installSkills = false;
|
|
323
|
+
installCommands = false;
|
|
301
324
|
}
|
|
302
|
-
} else {
|
|
303
|
-
await installSkillsAndCommands();
|
|
304
325
|
}
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
logger.warn("No commands found in selected templates.");
|
|
329
|
-
}
|
|
326
|
+
if (installSkills && hasSkills) {
|
|
327
|
+
logger.blank();
|
|
328
|
+
logger.info("Installing skills...");
|
|
329
|
+
const skillsResult = await copySkills(templates, targetDir);
|
|
330
|
+
totalFiles += skillsResult.files;
|
|
331
|
+
totalDirectories += skillsResult.directories;
|
|
332
|
+
logger.success(
|
|
333
|
+
`Skills: ${skillsResult.files} files, ${skillsResult.directories} directories`
|
|
334
|
+
);
|
|
335
|
+
} else if (installSkills && !hasSkills) {
|
|
336
|
+
logger.warn("No skills found in selected templates.");
|
|
337
|
+
}
|
|
338
|
+
if (installCommands && hasCommands) {
|
|
339
|
+
logger.blank();
|
|
340
|
+
logger.info("Installing commands...");
|
|
341
|
+
const commandsResult = await copyCommands(templates, targetDir);
|
|
342
|
+
totalFiles += commandsResult.files;
|
|
343
|
+
totalDirectories += commandsResult.directories;
|
|
344
|
+
logger.success(
|
|
345
|
+
`Commands: ${commandsResult.files} files, ${commandsResult.directories} directories`
|
|
346
|
+
);
|
|
347
|
+
} else if (installCommands && !hasCommands) {
|
|
348
|
+
logger.warn("No commands found in selected templates.");
|
|
330
349
|
}
|
|
331
350
|
}
|
|
332
351
|
logger.blank();
|
|
@@ -334,13 +353,13 @@ var init = async (options) => {
|
|
|
334
353
|
logger.blank();
|
|
335
354
|
logger.info("Installed templates:");
|
|
336
355
|
templates.forEach((t) => logger.step(t));
|
|
337
|
-
if (
|
|
356
|
+
if (installSkills || installCommands) {
|
|
338
357
|
logger.blank();
|
|
339
358
|
logger.info("Installed extras:");
|
|
340
|
-
if (
|
|
359
|
+
if (installSkills) {
|
|
341
360
|
logger.step("Skills \u2192 .claude/skills/");
|
|
342
361
|
}
|
|
343
|
-
if (
|
|
362
|
+
if (installCommands) {
|
|
344
363
|
logger.step("Commands \u2192 .claude/commands/");
|
|
345
364
|
}
|
|
346
365
|
}
|
|
@@ -353,7 +372,7 @@ var init = async (options) => {
|
|
|
353
372
|
|
|
354
373
|
// src/index.ts
|
|
355
374
|
var program = new Command();
|
|
356
|
-
program.name("claude-code").description("Claude Code documentation installer for projects").version("0.1.
|
|
375
|
+
program.name("claude-code").description("Claude Code documentation installer for projects").version("0.1.10");
|
|
357
376
|
program.option(
|
|
358
377
|
"-t, --template <names>",
|
|
359
378
|
"template names (comma-separated: tanstack-start,hono)"
|