@quantiya/codevibe-gemini-plugin 1.0.13 → 1.0.15
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/bin/codevibe-gemini +31 -13
- package/gemini-hooks-settings.json +82 -0
- package/package.json +3 -2
package/bin/codevibe-gemini
CHANGED
|
@@ -78,23 +78,41 @@ configure_hooks_if_needed() {
|
|
|
78
78
|
mkdir -p "$GEMINI_SETTINGS_DIR"
|
|
79
79
|
|
|
80
80
|
# Check if hooks need to be configured
|
|
81
|
+
# Guard: if template is missing, skip auto-configure entirely
|
|
82
|
+
if [ ! -f "$TEMPLATE_FILE" ]; then
|
|
83
|
+
echo "⚠ Hooks template not found at: $TEMPLATE_FILE"
|
|
84
|
+
echo " Try: npm install -g @quantiya/codevibe@latest"
|
|
85
|
+
return
|
|
86
|
+
fi
|
|
87
|
+
|
|
81
88
|
if [ ! -f "$GEMINI_SETTINGS_FILE" ]; then
|
|
82
|
-
# No settings file
|
|
89
|
+
# No settings file — create from template
|
|
83
90
|
echo "Configuring Gemini CLI hooks for CodeVibe..."
|
|
84
91
|
sed "s|__CODEVIBE_HOOKS_DIR__|$HOOKS_DIR|g" "$TEMPLATE_FILE" > "$GEMINI_SETTINGS_FILE"
|
|
85
92
|
echo "✓ Hooks configured at: $GEMINI_SETTINGS_FILE"
|
|
86
|
-
elif ! grep -q "
|
|
87
|
-
# Settings
|
|
88
|
-
echo "
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
93
|
+
elif ! grep -q "codevibe" "$GEMINI_SETTINGS_FILE" 2>/dev/null; then
|
|
94
|
+
# Settings exists but no CodeVibe hooks present — append ours
|
|
95
|
+
echo "Adding CodeVibe hooks to Gemini CLI settings..."
|
|
96
|
+
if command -v jq >/dev/null 2>&1; then
|
|
97
|
+
HOOKS_JSON=$(sed "s|__CODEVIBE_HOOKS_DIR__|$HOOKS_DIR|g" "$TEMPLATE_FILE")
|
|
98
|
+
# Append CodeVibe hook entries to each hook array, preserving existing user hooks
|
|
99
|
+
jq -s '
|
|
100
|
+
.[0] as $existing | .[1] as $new |
|
|
101
|
+
$existing | .hooks = (
|
|
102
|
+
($existing.hooks // {}) as $eh |
|
|
103
|
+
($new.hooks // {}) as $nh |
|
|
104
|
+
($eh | keys) + ($nh | keys) | unique | map(
|
|
105
|
+
{ (.) : (($eh[.] // []) + ($nh[.] // [])) }
|
|
106
|
+
) | add // {}
|
|
107
|
+
)
|
|
108
|
+
' "$GEMINI_SETTINGS_FILE" <(echo "$HOOKS_JSON") > "${GEMINI_SETTINGS_FILE}.tmp" && \
|
|
109
|
+
mv "${GEMINI_SETTINGS_FILE}.tmp" "$GEMINI_SETTINGS_FILE" && \
|
|
110
|
+
echo "✓ CodeVibe hooks added to: $GEMINI_SETTINGS_FILE" || \
|
|
111
|
+
echo "⚠ Failed to add hooks. Delete $GEMINI_SETTINGS_FILE and restart to auto-configure."
|
|
112
|
+
else
|
|
113
|
+
echo "⚠ jq not found — cannot add hooks to existing settings."
|
|
114
|
+
echo " Delete $GEMINI_SETTINGS_FILE and restart to auto-configure."
|
|
115
|
+
fi
|
|
98
116
|
fi
|
|
99
117
|
}
|
|
100
118
|
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/google-gemini/gemini-cli/main/packages/core/src/settings.schema.json",
|
|
3
|
+
"hooks": {
|
|
4
|
+
"SessionStart": [
|
|
5
|
+
{
|
|
6
|
+
"matcher": "*",
|
|
7
|
+
"hooks": [
|
|
8
|
+
{
|
|
9
|
+
"type": "command",
|
|
10
|
+
"command": "__CODEVIBE_HOOKS_DIR__/session-start.sh"
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"SessionEnd": [
|
|
16
|
+
{
|
|
17
|
+
"matcher": "*",
|
|
18
|
+
"hooks": [
|
|
19
|
+
{
|
|
20
|
+
"type": "command",
|
|
21
|
+
"command": "__CODEVIBE_HOOKS_DIR__/session-end.sh"
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"BeforeAgent": [
|
|
27
|
+
{
|
|
28
|
+
"matcher": "*",
|
|
29
|
+
"hooks": [
|
|
30
|
+
{
|
|
31
|
+
"type": "command",
|
|
32
|
+
"command": "__CODEVIBE_HOOKS_DIR__/before-agent.sh"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"AfterAgent": [
|
|
38
|
+
{
|
|
39
|
+
"matcher": "*",
|
|
40
|
+
"hooks": [
|
|
41
|
+
{
|
|
42
|
+
"type": "command",
|
|
43
|
+
"command": "__CODEVIBE_HOOKS_DIR__/after-agent.sh"
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"BeforeTool": [
|
|
49
|
+
{
|
|
50
|
+
"matcher": "*",
|
|
51
|
+
"hooks": [
|
|
52
|
+
{
|
|
53
|
+
"type": "command",
|
|
54
|
+
"command": "__CODEVIBE_HOOKS_DIR__/before-tool.sh"
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"AfterTool": [
|
|
60
|
+
{
|
|
61
|
+
"matcher": "*",
|
|
62
|
+
"hooks": [
|
|
63
|
+
{
|
|
64
|
+
"type": "command",
|
|
65
|
+
"command": "__CODEVIBE_HOOKS_DIR__/after-tool.sh"
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
"Notification": [
|
|
71
|
+
{
|
|
72
|
+
"matcher": "*",
|
|
73
|
+
"hooks": [
|
|
74
|
+
{
|
|
75
|
+
"type": "command",
|
|
76
|
+
"command": "__CODEVIBE_HOOKS_DIR__/notification.sh"
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quantiya/codevibe-gemini-plugin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.15",
|
|
4
4
|
"description": "Control Gemini CLI from your iPhone and Android — real-time sync, approve file edits, send prompts by voice. Part of CodeVibe.",
|
|
5
5
|
"main": "dist/server.js",
|
|
6
6
|
"bin": {
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
"hooks",
|
|
13
13
|
"gemini-extension.json",
|
|
14
14
|
"README.md",
|
|
15
|
-
".env.example"
|
|
15
|
+
".env.example",
|
|
16
|
+
"gemini-hooks-settings.json"
|
|
16
17
|
],
|
|
17
18
|
"scripts": {
|
|
18
19
|
"typecheck": "tsc --noEmit",
|