claude-code-autoconfig 1.0.135 → 1.0.136
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/.claude/settings.json +81 -77
- package/bin/cli.js +28 -3
- package/package.json +1 -1
package/.claude/settings.json
CHANGED
|
@@ -1,77 +1,81 @@
|
|
|
1
|
-
{
|
|
2
|
-
"env": {
|
|
3
|
-
"CLAUDE_CODE_DISABLE_AUTO_MEMORY": "0"
|
|
4
|
-
},
|
|
5
|
-
"hooks": {
|
|
6
|
-
"SessionStart": [
|
|
7
|
-
{
|
|
8
|
-
"matcher": "",
|
|
9
|
-
"hooks": [
|
|
10
|
-
{
|
|
11
|
-
"type": "command",
|
|
12
|
-
"command": "node .claude/hooks/migrate-feedback.js"
|
|
13
|
-
}
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
],
|
|
17
|
-
"PostToolUse": [
|
|
18
|
-
{
|
|
19
|
-
"matcher": "Edit|Write",
|
|
20
|
-
"hooks": [
|
|
21
|
-
{
|
|
22
|
-
"type": "command",
|
|
23
|
-
"command": "node .claude/hooks/feedback-rule-check.js"
|
|
24
|
-
}
|
|
25
|
-
]
|
|
26
|
-
}
|
|
27
|
-
]
|
|
28
|
-
},
|
|
29
|
-
"permissions": {
|
|
30
|
-
"allow": [
|
|
31
|
-
"Read(./**)",
|
|
32
|
-
"Edit(./**)",
|
|
33
|
-
"Write(./**)",
|
|
34
|
-
"Glob",
|
|
35
|
-
"Grep",
|
|
36
|
-
"WebSearch",
|
|
37
|
-
"WebFetch",
|
|
38
|
-
"Bash(npm
|
|
39
|
-
"Bash(npm
|
|
40
|
-
"Bash(npm run
|
|
41
|
-
"Bash(npm run
|
|
42
|
-
"Bash(npm run
|
|
43
|
-
"Bash(npm run
|
|
44
|
-
"Bash(npm run
|
|
45
|
-
"Bash(npm run
|
|
46
|
-
"Bash(
|
|
47
|
-
"Bash(
|
|
48
|
-
"Bash(git
|
|
49
|
-
"Bash(git
|
|
50
|
-
"Bash(git
|
|
51
|
-
"Bash(git
|
|
52
|
-
"Bash(git
|
|
53
|
-
"Bash(git
|
|
54
|
-
"Bash(
|
|
55
|
-
"Bash(
|
|
56
|
-
"Bash(
|
|
57
|
-
"Bash(
|
|
58
|
-
"Bash(
|
|
59
|
-
"Bash(
|
|
60
|
-
"Bash(
|
|
61
|
-
"Bash(
|
|
62
|
-
"Bash(
|
|
63
|
-
"Bash(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
"Read(
|
|
71
|
-
"Read(
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
1
|
+
{
|
|
2
|
+
"env": {
|
|
3
|
+
"CLAUDE_CODE_DISABLE_AUTO_MEMORY": "0"
|
|
4
|
+
},
|
|
5
|
+
"hooks": {
|
|
6
|
+
"SessionStart": [
|
|
7
|
+
{
|
|
8
|
+
"matcher": "",
|
|
9
|
+
"hooks": [
|
|
10
|
+
{
|
|
11
|
+
"type": "command",
|
|
12
|
+
"command": "node .claude/hooks/migrate-feedback.js"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"PostToolUse": [
|
|
18
|
+
{
|
|
19
|
+
"matcher": "Edit|Write",
|
|
20
|
+
"hooks": [
|
|
21
|
+
{
|
|
22
|
+
"type": "command",
|
|
23
|
+
"command": "node .claude/hooks/feedback-rule-check.js"
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"permissions": {
|
|
30
|
+
"allow": [
|
|
31
|
+
"Read(./**)",
|
|
32
|
+
"Edit(./**)",
|
|
33
|
+
"Write(./**)",
|
|
34
|
+
"Glob",
|
|
35
|
+
"Grep",
|
|
36
|
+
"WebSearch",
|
|
37
|
+
"WebFetch",
|
|
38
|
+
"Bash(npm test)",
|
|
39
|
+
"Bash(npm test *)",
|
|
40
|
+
"Bash(npm run dev)",
|
|
41
|
+
"Bash(npm run build)",
|
|
42
|
+
"Bash(npm run lint)",
|
|
43
|
+
"Bash(npm run lint:fix)",
|
|
44
|
+
"Bash(npm run typecheck)",
|
|
45
|
+
"Bash(npm run test)",
|
|
46
|
+
"Bash(npm run test:*)",
|
|
47
|
+
"Bash(npm run validate)",
|
|
48
|
+
"Bash(git status)",
|
|
49
|
+
"Bash(git status *)",
|
|
50
|
+
"Bash(git diff *)",
|
|
51
|
+
"Bash(git add *)",
|
|
52
|
+
"Bash(git commit *)",
|
|
53
|
+
"Bash(git push *)",
|
|
54
|
+
"Bash(git pull)",
|
|
55
|
+
"Bash(git pull *)",
|
|
56
|
+
"Bash(git checkout *)",
|
|
57
|
+
"Bash(git branch *)",
|
|
58
|
+
"Bash(ls *)",
|
|
59
|
+
"Bash(dir *)",
|
|
60
|
+
"Bash(mkdir *)",
|
|
61
|
+
"Bash(mkdir -p *)",
|
|
62
|
+
"Bash(start *)",
|
|
63
|
+
"Bash(start .claude *)",
|
|
64
|
+
"Bash(open *)",
|
|
65
|
+
"Bash(open .claude *)",
|
|
66
|
+
"Bash(xdg-open *)",
|
|
67
|
+
"Bash(xdg-open .claude *)"
|
|
68
|
+
],
|
|
69
|
+
"deny": [
|
|
70
|
+
"Read(./.env)",
|
|
71
|
+
"Read(./.env.*)",
|
|
72
|
+
"Read(./secrets/**)",
|
|
73
|
+
"Read(./**/credentials.*)",
|
|
74
|
+
"Read(./**/*.pem)",
|
|
75
|
+
"Read(./**/*.key)",
|
|
76
|
+
"Bash(rm -rf *)",
|
|
77
|
+
"Bash(curl *)",
|
|
78
|
+
"Bash(wget *)"
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
}
|
package/bin/cli.js
CHANGED
|
@@ -451,17 +451,19 @@ if (fs.existsSync(updatesSrc)) {
|
|
|
451
451
|
copyDirIfMissing(updatesSrc, path.join(claudeDest, 'updates'));
|
|
452
452
|
}
|
|
453
453
|
|
|
454
|
-
// Copy settings.json — fresh install gets full copy, upgrades get hooks merged
|
|
454
|
+
// Copy settings.json — fresh install gets full copy, upgrades get hooks + permissions merged
|
|
455
455
|
const settingsSrc = path.join(packageDir, '.claude', 'settings.json');
|
|
456
456
|
const settingsDest = path.join(claudeDest, 'settings.json');
|
|
457
457
|
if (fs.existsSync(settingsSrc)) {
|
|
458
458
|
if (forceMode || !fs.existsSync(settingsDest)) {
|
|
459
459
|
fs.copyFileSync(settingsSrc, settingsDest);
|
|
460
460
|
} else {
|
|
461
|
-
// Merge hooks from package into existing settings
|
|
461
|
+
// Merge hooks and permissions from package into existing settings
|
|
462
462
|
try {
|
|
463
463
|
const pkgSettings = JSON.parse(fs.readFileSync(settingsSrc, 'utf8'));
|
|
464
464
|
const userSettings = JSON.parse(fs.readFileSync(settingsDest, 'utf8'));
|
|
465
|
+
|
|
466
|
+
// Merge hooks
|
|
465
467
|
if (pkgSettings.hooks) {
|
|
466
468
|
if (!userSettings.hooks) userSettings.hooks = {};
|
|
467
469
|
for (const [event, matchers] of Object.entries(pkgSettings.hooks)) {
|
|
@@ -488,8 +490,31 @@ if (fs.existsSync(settingsSrc)) {
|
|
|
488
490
|
}
|
|
489
491
|
}
|
|
490
492
|
}
|
|
491
|
-
fs.writeFileSync(settingsDest, JSON.stringify(userSettings, null, 2));
|
|
492
493
|
}
|
|
494
|
+
|
|
495
|
+
// Merge permissions — add missing allow/deny entries, migrate deprecated :* syntax
|
|
496
|
+
if (pkgSettings.permissions) {
|
|
497
|
+
if (!userSettings.permissions) userSettings.permissions = {};
|
|
498
|
+
for (const key of ['allow', 'deny']) {
|
|
499
|
+
if (!pkgSettings.permissions[key]) continue;
|
|
500
|
+
if (!userSettings.permissions[key]) {
|
|
501
|
+
userSettings.permissions[key] = pkgSettings.permissions[key];
|
|
502
|
+
} else {
|
|
503
|
+
// Migrate deprecated :* syntax to space-* in existing entries
|
|
504
|
+
userSettings.permissions[key] = userSettings.permissions[key].map(rule =>
|
|
505
|
+
rule.replace(/^(Bash\([^)]*):(\*\))$/, '$1 $2')
|
|
506
|
+
);
|
|
507
|
+
// Add any package rules not already present
|
|
508
|
+
for (const rule of pkgSettings.permissions[key]) {
|
|
509
|
+
if (!userSettings.permissions[key].includes(rule)) {
|
|
510
|
+
userSettings.permissions[key].push(rule);
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
fs.writeFileSync(settingsDest, JSON.stringify(userSettings, null, 2));
|
|
493
518
|
} catch (err) {
|
|
494
519
|
// If merge fails, don't break the install
|
|
495
520
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-code-autoconfig",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.136",
|
|
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",
|