-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample-setup.sh
More file actions
executable file
·108 lines (102 loc) · 2.34 KB
/
example-setup.sh
File metadata and controls
executable file
·108 lines (102 loc) · 2.34 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#!/bin/bash
# Example setup script for Claude Code Ntfy Service
echo "🚀 Setting up Claude Code Ntfy Service..."
# Build the project
echo "📦 Building the project..."
cargo build --release
# Create symbolic links for easier access (optional)
echo "🔗 Creating symbolic links..."
sudo ln -sf "$(pwd)/target/release/claude-ntfy" /usr/local/bin/claude-ntfy
sudo ln -sf "$(pwd)/target/release/claude-ntfy-daemon" /usr/local/bin/claude-ntfy-daemon
# Initialize configuration
echo "⚙️ Initializing configuration..."
claude-ntfy init --global
# Show example Claude Code settings
echo ""
echo "📝 Add the following to your .claude/settings.json or ~/.claude/settings.json:"
echo ""
cat <<EOF
{
"hooks": {
"PreToolUse": [
{
"matcher": "*",
"hooks": [
{
"type": "command",
"command": "claude-ntfy --project \$CLAUDE_PROJECT_DIR"
}
]
}
],
"PostToolUse": [
{
"matcher": "*",
"hooks": [
{
"type": "command",
"command": "claude-ntfy --project \$CLAUDE_PROJECT_DIR"
}
]
}
],
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "claude-ntfy --project \$CLAUDE_PROJECT_DIR"
}
]
}
],
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "claude-ntfy --project \$CLAUDE_PROJECT_DIR"
}
]
}
],
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "claude-ntfy --project \$CLAUDE_PROJECT_DIR"
}
]
}
],
"Notification": [
{
"hooks": [
{
"type": "command",
"command": "claude-ntfy --project \$CLAUDE_PROJECT_DIR"
}
]
}
],
"SubagentStop": [
{
"hooks": [
{
"type": "command",
"command": "claude-ntfy --project \$CLAUDE_PROJECT_DIR"
}
]
}
]
}
}
EOF
echo ""
echo "🎯 Next steps:"
echo "1. Subscribe to 'claude-code-hooks' topic in your ntfy app"
echo "2. Start the daemon: claude-ntfy daemon start"
echo "3. Test with: claude-ntfy test 'Hello from Claude Code!'"
echo ""
echo "✅ Setup complete!"