-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·93 lines (83 loc) · 3.22 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·93 lines (83 loc) · 3.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/usr/bin/env bash
# Master installer for the Claude Code Toolkit.
# Wraps the sub-installers in tools/*/install.sh and runs the ones the
# user opts into. Always interactive — never auto-installs everything.
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$ROOT"
ok() { printf ' \033[32m✓\033[0m %s\n' "$*"; }
info() { printf ' • %s\n' "$*"; }
warn() { printf ' \033[33m!\033[0m %s\n' "$*"; }
prompt_yn() {
local q="$1"
printf ' ? %s [y/N] ' "$q"
read -r ans
[[ "$ans" =~ ^[Yy] ]]
}
echo "Claude Code Toolkit — interactive installer"
echo "Read docs/SAFETY.md before saying yes."
echo
# secret-scrub pre-commit
if [ -x secret-scrub/install.sh ]; then
if prompt_yn "Install secret-scrub pre-commit hook (per-repo)?"; then
secret-scrub/install.sh
ok "secret-scrub pre-commit installed"
else
info "skipped secret-scrub pre-commit"
fi
fi
# OS-appropriate scheduler picker. macOS → launchd, Linux → systemd
# user timer. The two scrubber scheduled jobs (sessions + working-trees)
# each have a launchd and a systemd installer; pick the right one.
OS="$(uname -s)"
case "$OS" in
Darwin) SESSIONS_SCHED=secret-scrub/install-launchd.sh; TREES_SCHED=secret-scrub/install-launchd-trees.sh ;;
Linux) SESSIONS_SCHED=secret-scrub/install-systemd.sh; TREES_SCHED=secret-scrub/install-systemd-trees.sh ;;
*) SESSIONS_SCHED=''; TREES_SCHED='' ;;
esac
# secret-scrub session scrubber (scheduled — sessions transcripts)
if [ -n "$SESSIONS_SCHED" ] && [ -x "$SESSIONS_SCHED" ]; then
if prompt_yn "Install secret-scrub SESSIONS scrubber (scans ~/.claude/projects every 30 min)?"; then
"$SESSIONS_SCHED"
ok "secret-scrub sessions scrubber installed ($OS)"
else
info "skipped sessions scrubber"
fi
fi
# secret-scrub working-trees scrubber (scheduled — uncommitted files in
# your repos; the third leak pathway the pre-commit hook can't see)
if [ -n "$TREES_SCHED" ] && [ -x "$TREES_SCHED" ]; then
if prompt_yn "Install secret-scrub WORKING-TREES scrubber (scans your repos for uncommitted secrets every 30 min)?"; then
"$TREES_SCHED"
ok "secret-scrub working-trees scrubber installed ($OS)"
info " → add repos to scan: edit ~/.config/secret-scrub/working-trees.txt"
else
info "skipped working-trees scrubber"
fi
fi
# docgen pre-push
if [ -x docgen/install-push-hook.sh ]; then
if prompt_yn "Install docgen pre-push hook (auto-refresh per-dir READMEs on push)?"; then
docgen/install-push-hook.sh
ok "docgen pre-push installed"
else
info "skipped docgen pre-push"
fi
fi
# identity-guard (Claude Code PreToolUse hook — keeps the wrong GitHub
# account out of the wrong repo)
if [ -x identity-guard/install.sh ]; then
if prompt_yn "Install identity-guard (blocks pushes/merges under the wrong GitHub account)?"; then
identity-guard/install.sh
ok "identity-guard installed"
info " → add repo patterns: ~/.claude/hooks/sensitive-repos.txt + personal-repos.txt"
else
info "skipped identity-guard"
fi
fi
echo
ok "done."
if [ -n "$SESSIONS_SCHED" ]; then
info "verify scrubbers: $SESSIONS_SCHED status ; $TREES_SCHED status"
fi
info "to uninstall: each tool has its own uninstall path — see tool README"