cc-safe-setup 1.9.1 → 1.9.2
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/README.md +1 -1
- package/index.mjs +20 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -154,7 +154,7 @@ Or browse all available examples in [`examples/`](examples/):
|
|
|
154
154
|
## Learn More
|
|
155
155
|
|
|
156
156
|
- [Official Hooks Reference](https://code.claude.com/docs/en/hooks) — Claude Code hooks documentation
|
|
157
|
-
- [Hooks Cookbook](https://github.com/yurukusa/claude-code-hooks/blob/main/COOKBOOK.md) —
|
|
157
|
+
- [Hooks Cookbook](https://github.com/yurukusa/claude-code-hooks/blob/main/COOKBOOK.md) — 14 ready-to-use recipes from real GitHub Issues
|
|
158
158
|
- [Japanese guide (Qiita)](https://qiita.com/yurukusa/items/a9714b33f5d974e8f1e8) — この記事の日本語解説
|
|
159
159
|
- [The incident that inspired this tool](https://github.com/anthropics/claude-code/issues/36339) — NTFS junction rm -rf
|
|
160
160
|
|
package/index.mjs
CHANGED
|
@@ -179,6 +179,23 @@ function status() {
|
|
|
179
179
|
console.log();
|
|
180
180
|
console.log(' ' + (settingsOk ? c.green + '✓' : c.red + '✗') + c.reset + ' settings.json ' + (settingsOk ? 'has hooks configured' : 'missing hook configuration'));
|
|
181
181
|
|
|
182
|
+
// Check installed examples
|
|
183
|
+
const exampleFiles = [
|
|
184
|
+
'allowlist.sh', 'auto-approve-build.sh', 'auto-approve-docker.sh',
|
|
185
|
+
'auto-approve-git-read.sh', 'auto-approve-python.sh', 'auto-approve-ssh.sh',
|
|
186
|
+
'auto-checkpoint.sh', 'auto-snapshot.sh', 'block-database-wipe.sh',
|
|
187
|
+
'edit-guard.sh', 'enforce-tests.sh', 'notify-waiting.sh',
|
|
188
|
+
'protect-dotfiles.sh', 'scope-guard.sh',
|
|
189
|
+
];
|
|
190
|
+
const installedExamples = exampleFiles.filter(f => existsSync(join(HOOKS_DIR, f)));
|
|
191
|
+
if (installedExamples.length > 0) {
|
|
192
|
+
console.log();
|
|
193
|
+
console.log(' ' + c.bold + 'Example hooks installed:' + c.reset);
|
|
194
|
+
for (const f of installedExamples) {
|
|
195
|
+
console.log(' ' + c.green + '✓' + c.reset + ' ' + f);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
182
199
|
console.log();
|
|
183
200
|
if (missing === 0) {
|
|
184
201
|
console.log(c.bold + ' All ' + installed + ' hooks installed.' + c.reset);
|
|
@@ -186,6 +203,9 @@ function status() {
|
|
|
186
203
|
console.log(c.bold + ' ' + installed + '/' + Object.keys(HOOKS).length + ' hooks installed.' + c.reset);
|
|
187
204
|
console.log(' ' + c.dim + 'Run: npx cc-safe-setup' + c.reset);
|
|
188
205
|
}
|
|
206
|
+
if (installedExamples.length > 0) {
|
|
207
|
+
console.log(' ' + c.dim + '+ ' + installedExamples.length + ' example hooks' + c.reset);
|
|
208
|
+
}
|
|
189
209
|
console.log();
|
|
190
210
|
|
|
191
211
|
// Exit code for CI: 0 = all installed, 1 = missing hooks
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cc-safe-setup",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.2",
|
|
4
4
|
"description": "One command to make Claude Code safe for autonomous operation. 8 hooks: destructive blocker, branch guard, force-push protection, secret leak prevention, syntax checks, and more.",
|
|
5
5
|
"main": "index.mjs",
|
|
6
6
|
"bin": {
|