claude-code-autoconfig 1.0.87 → 1.0.88

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.
Files changed (2) hide show
  1. package/bin/cli.js +30 -5
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -152,6 +152,8 @@ if (process.argv.includes('--pull-updates')) {
152
152
  process.exit(0);
153
153
  }
154
154
 
155
+ const forceMode = process.argv.includes('--force');
156
+
155
157
  console.log('\x1b[36m%s\x1b[0m', '🚀 Claude Code Autoconfig');
156
158
  console.log();
157
159
 
@@ -317,6 +319,21 @@ function copyDir(src, dest) {
317
319
  }
318
320
  }
319
321
 
322
+ function copyDirIfMissing(src, dest) {
323
+ fs.mkdirSync(dest, { recursive: true });
324
+ const entries = fs.readdirSync(src, { withFileTypes: true });
325
+ for (const entry of entries) {
326
+ if (isReservedName(entry.name)) continue;
327
+ const srcPath = path.join(src, entry.name);
328
+ const destPath = path.join(dest, entry.name);
329
+ if (entry.isDirectory()) {
330
+ copyDirIfMissing(srcPath, destPath);
331
+ } else if (!fs.existsSync(destPath)) {
332
+ fs.copyFileSync(srcPath, destPath);
333
+ }
334
+ }
335
+ }
336
+
320
337
  // Copy commands (required for /autoconfig to work)
321
338
  if (fs.existsSync(commandsSrc)) {
322
339
  copyDir(commandsSrc, path.join(claudeDest, 'commands'));
@@ -335,20 +352,28 @@ if (fs.existsSync(agentsSrc)) {
335
352
  copyDir(agentsSrc, path.join(claudeDest, 'agents'));
336
353
  }
337
354
 
338
- // Copy feedback template
355
+ // Copy feedback template (preserve user customizations unless --force)
339
356
  if (fs.existsSync(feedbackSrc)) {
340
- copyDir(feedbackSrc, path.join(claudeDest, 'feedback'));
357
+ const copyFn = forceMode ? copyDir : copyDirIfMissing;
358
+ copyFn(feedbackSrc, path.join(claudeDest, 'feedback'));
341
359
  }
342
360
 
343
- // Copy hooks directory (scaffolding for custom hooks)
361
+ // Copy hooks directory (preserve user customizations unless --force)
344
362
  if (fs.existsSync(hooksSrc)) {
345
- copyDir(hooksSrc, path.join(claudeDest, 'hooks'));
363
+ const copyFn = forceMode ? copyDir : copyDirIfMissing;
364
+ copyFn(hooksSrc, path.join(claudeDest, 'hooks'));
365
+ }
366
+
367
+ // Copy updates directory (new update files only, never overwrite existing)
368
+ const updatesSrc = path.join(packageDir, '.claude', 'updates');
369
+ if (fs.existsSync(updatesSrc)) {
370
+ copyDirIfMissing(updatesSrc, path.join(claudeDest, 'updates'));
346
371
  }
347
372
 
348
373
  // Copy settings.json (only if user doesn't have one - preserves existing config)
349
374
  const settingsSrc = path.join(packageDir, '.claude', 'settings.json');
350
375
  const settingsDest = path.join(claudeDest, 'settings.json');
351
- if (fs.existsSync(settingsSrc) && !fs.existsSync(settingsDest)) {
376
+ if (fs.existsSync(settingsSrc) && (forceMode || !fs.existsSync(settingsDest))) {
352
377
  fs.copyFileSync(settingsSrc, settingsDest);
353
378
  }
354
379
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-autoconfig",
3
- "version": "1.0.87",
3
+ "version": "1.0.88",
4
4
  "description": "Intelligent, self-configuring setup for Claude Code. One command analyzes your project, configures Claude, and shows you what it did.",
5
5
  "author": "ADAC 1001 <info@adac1001.com>",
6
6
  "license": "MIT",