cc-safe-setup 1.5.0 → 1.5.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 +4 -4
- package/index.mjs +5 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -36,9 +36,9 @@ Installs 8 production-tested safety hooks in ~10 seconds. Zero dependencies. No
|
|
|
36
36
|
● cd+git Auto-Approver
|
|
37
37
|
● Secret Leak Prevention
|
|
38
38
|
|
|
39
|
-
Install all
|
|
39
|
+
Install all 8 safety hooks? [Y/n] Y
|
|
40
40
|
|
|
41
|
-
✓ Done.
|
|
41
|
+
✓ Done. 8 safety hooks installed.
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
## Why This Exists
|
|
@@ -116,7 +116,7 @@ npx cc-health-check
|
|
|
116
116
|
|
|
117
117
|
## Full Kit
|
|
118
118
|
|
|
119
|
-
cc-safe-setup gives you
|
|
119
|
+
cc-safe-setup gives you 8 essential hooks. For the complete autonomous operation toolkit:
|
|
120
120
|
|
|
121
121
|
**[Claude Code Ops Kit](https://yurukusa.github.io/cc-ops-kit-landing/?utm_source=github&utm_medium=readme&utm_campaign=safe-setup)** — 16 hooks + 5 templates + 3 exclusive tools + install.sh. Production-ready in 15 minutes.
|
|
122
122
|
|
|
@@ -124,7 +124,7 @@ Or start with the free hooks: [claude-code-hooks](https://github.com/yurukusa/cl
|
|
|
124
124
|
|
|
125
125
|
## Examples
|
|
126
126
|
|
|
127
|
-
Need custom hooks beyond the
|
|
127
|
+
Need custom hooks beyond the 8 built-in ones? See [`examples/`](examples/) for ready-to-use recipes:
|
|
128
128
|
|
|
129
129
|
- **auto-approve-git-read.sh** — Auto-approve `git status`, `git log`, even with `-C` flags
|
|
130
130
|
- **auto-approve-ssh.sh** — Auto-approve safe SSH commands (`uptime`, `whoami`, etc.)
|
package/index.mjs
CHANGED
|
@@ -202,6 +202,11 @@ async function verify() {
|
|
|
202
202
|
{ hook: 'destructive-guard', input: '{"tool_input":{"command":"git checkout --force main"}}', expect: 2, desc: 'blocks git checkout --force' },
|
|
203
203
|
{ hook: 'secret-guard', input: '{"tool_input":{"command":"git add .env"}}', expect: 2, desc: 'blocks git add .env' },
|
|
204
204
|
{ hook: 'secret-guard', input: '{"tool_input":{"command":"git add src/app.js"}}', expect: 0, desc: 'allows git add safe files' },
|
|
205
|
+
{ hook: 'api-error-alert', input: '{"stop_reason":"user"}', expect: 0, desc: 'ignores normal stops' },
|
|
206
|
+
{ hook: 'destructive-guard', input: '{"tool_input":{"command":"cd /tmp && rm -rf /"}}', expect: 2, desc: 'blocks compound rm -rf' },
|
|
207
|
+
{ hook: 'branch-guard', input: '{"tool_input":{"command":"git push --force origin feature"}}', expect: 2, desc: 'blocks force-push' },
|
|
208
|
+
{ hook: 'destructive-guard', input: '{"tool_input":{"command":"git reset --hard HEAD~5"}}', expect: 2, desc: 'blocks git reset --hard' },
|
|
209
|
+
{ hook: 'destructive-guard', input: '{"tool_input":{"command":"sudo rm -rf /var"}}', expect: 2, desc: 'blocks sudo + destructive' },
|
|
205
210
|
];
|
|
206
211
|
|
|
207
212
|
let pass = 0, fail = 0;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cc-safe-setup",
|
|
3
|
-
"version": "1.5.
|
|
4
|
-
"description": "One command to make Claude Code safe for autonomous operation.
|
|
3
|
+
"version": "1.5.2",
|
|
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": {
|
|
7
7
|
"cc-safe-setup": "index.mjs"
|