Files
cline-multi-mirror/sdk/examples/hooks/PreToolUse.sh
T
HybridTalentComputing 8d519391b1 Sync with upstream v3.83.0
Replace all files with clean upstream Cline v3.83.0 content.
ShengSuanYun provider code automatically removed.
2026-05-15 13:02:01 +08:00

17 lines
516 B
Bash
Executable File

#!/usr/bin/env bash
# Cline Hook: PreToolUse
# Logs every tool call before it executes
# Copy to ~/.cline/hooks/PreToolUse.sh and chmod +x
input=$(cat)
tool=$(echo "$input" | jq -r '.tool_call.name // "unknown"')
args=$(echo "$input" | jq -r '.preToolUse.parameters | to_entries | map("\(.key)=\(.value)") | join(", ")' 2>/dev/null || echo "")
echo "🔧 Tool: $tool" >&2
if [ -n "$args" ] && [ "$args" != "null" ]; then
echo " Args: $args" >&2
fi
# Return empty object to allow the call to proceed
echo '{}'