cc-safe-setup 29.6.3 → 29.6.4
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/examples/fish-shell-wrapper.sh +37 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -117,7 +117,7 @@ Install any of these: `npx cc-safe-setup --install-example <name>`
|
|
|
117
117
|
| `--scan [--apply]` | Tech stack detection |
|
|
118
118
|
| `--export / --import` | Team config sharing |
|
|
119
119
|
| `--verify` | Test each hook |
|
|
120
|
-
| `--install-example <name>` | Install from
|
|
120
|
+
| `--install-example <name>` | Install from 412 examples |
|
|
121
121
|
| `--examples [filter]` | Browse examples by keyword |
|
|
122
122
|
| `--full` | All-in-one setup |
|
|
123
123
|
| `--status` | Check installed hooks |
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# ================================================================
|
|
3
|
+
# fish-shell-wrapper.sh — Run Bash tool commands in fish shell
|
|
4
|
+
# ================================================================
|
|
5
|
+
# PURPOSE:
|
|
6
|
+
# Users who develop in fish lose PATH, aliases, and env vars because
|
|
7
|
+
# Claude Code's Bash tool uses the system default shell (usually zsh/bash).
|
|
8
|
+
# This hook wraps commands in `fish -c '...'` so they execute in fish.
|
|
9
|
+
#
|
|
10
|
+
# TRIGGER: PreToolUse
|
|
11
|
+
# MATCHER: "Bash"
|
|
12
|
+
#
|
|
13
|
+
# See: https://github.com/anthropics/claude-code/issues/7490
|
|
14
|
+
# ================================================================
|
|
15
|
+
|
|
16
|
+
INPUT=$(cat)
|
|
17
|
+
COMMAND=$(echo "$INPUT" | jq -r '.tool_input.command // empty' 2>/dev/null)
|
|
18
|
+
[ -z "$COMMAND" ] && exit 0
|
|
19
|
+
|
|
20
|
+
# Skip if already wrapped in fish
|
|
21
|
+
echo "$COMMAND" | grep -q '^fish -c' && exit 0
|
|
22
|
+
|
|
23
|
+
# Skip simple builtins that work identically in any shell
|
|
24
|
+
echo "$COMMAND" | grep -qE '^\s*(cd|echo|cat|ls|pwd|true|false|test|mkdir|touch|rm|cp|mv)\b' && exit 0
|
|
25
|
+
|
|
26
|
+
# Escape single quotes for fish -c '...'
|
|
27
|
+
ESCAPED=$(printf '%s' "$COMMAND" | sed "s/'/'\\\\''/g")
|
|
28
|
+
|
|
29
|
+
jq -n --arg cmd "fish -c '$ESCAPED'" '{
|
|
30
|
+
hookSpecificOutput: {
|
|
31
|
+
hookEventName: "PreToolUse",
|
|
32
|
+
permissionDecision: "allow",
|
|
33
|
+
updatedInput: { command: $cmd }
|
|
34
|
+
}
|
|
35
|
+
}'
|
|
36
|
+
|
|
37
|
+
exit 0
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cc-safe-setup",
|
|
3
|
-
"version": "29.6.
|
|
4
|
-
"description": "One command to make Claude Code safe.
|
|
3
|
+
"version": "29.6.4",
|
|
4
|
+
"description": "One command to make Claude Code safe. 413 example hooks + 8 built-in. 52 CLI commands. 5613 tests. Works with Auto Mode.",
|
|
5
5
|
"main": "index.mjs",
|
|
6
6
|
"bin": {
|
|
7
7
|
"cc-safe-setup": "index.mjs"
|