-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-hook.sh
More file actions
executable file
·32 lines (22 loc) · 952 Bytes
/
install-hook.sh
File metadata and controls
executable file
·32 lines (22 loc) · 952 Bytes
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
#!/bin/bash
# Get Git hooks directory for the current repository
HOOKS_DIR=$(git rev-parse --git-path hooks)
# Ensure the hooks directory exists
mkdir -p "$HOOKS_DIR"
# Create the prepare-commit-msg hook
HOOK_PATH="$HOOKS_DIR/prepare-commit-msg"
# Download the hook script from remote URL
curl -fsSL https://raw.githubusercontent.com/cyqlelabs/llm-commit-msg/refs/heads/main/prepare-commit-msg -o "$HOOK_PATH"
# Make the hook executable
chmod +x "$HOOK_PATH"
read -p "Enter OpenAI API key: " openai_apikey
git config openai.apikey "$openai_apikey"
read -p "Enter OpenAI model [o3-mini]: " openai_model
openai_model=${openai_model:-o3-mini}
git config openai.model "$openai_model"
read -p "Enter Groq API key: " groq_apikey
git config groq.apikey "$groq_apikey"
read -p "Enter Groq model [qwen-qwq-32b]: " groq_model
groq_model=${groq_model:-qwen/qwen3-32b}
git config groq.model "$groq_model"
echo "Hook installed successfully at $HOOK_PATH"